219 lines
6.3 KiB
PHP
219 lines
6.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Constants\HttpEnumCode;
|
|
use App\Exception\BusinessException;
|
|
use App\Model\DoctorInquiryTime;
|
|
use App\Model\UserCaCert;
|
|
use App\Model\OrderInquiry;
|
|
use App\Model\UserDoctor;
|
|
use App\Request\UserRequest;
|
|
use App\Services\ImService;
|
|
use App\Services\UserDoctorService;
|
|
use App\Services\UserService;
|
|
use App\Utils\Http;
|
|
use App\Utils\Log;
|
|
use Extend\Alibaba\Oss;
|
|
use Extend\Ca\Ca;
|
|
use Extend\Prescription\Prescription;
|
|
use Extend\TencentIm\Account;
|
|
use Extend\TencentIm\Friend;
|
|
use Extend\TencentIm\Group;
|
|
use Extend\TencentIm\Message;
|
|
use Extend\TencentIm\Profile;
|
|
use Extend\TencentIm\RecentContact;
|
|
use Extend\VerifyDun\BankCard;
|
|
use Extend\VerifyDun\IdCard;
|
|
use Extend\Wechat\Wechat;
|
|
use Extend\Wechat\WechatPay;
|
|
use Hyperf\Amqp\Producer;
|
|
use Hyperf\DbConnection\Db;
|
|
use Hyperf\Snowflake\IdGeneratorInterface;
|
|
use Hyperf\Utils\ApplicationContext;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
|
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
|
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
|
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
|
|
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
|
|
|
class UserController extends AbstractController
|
|
{
|
|
/**
|
|
* 修改用户头像
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putUserAvatar(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('putUserAvatar')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->putUserAvatar();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 修改用户名
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putUserName(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('putUserName')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->putUserName();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 退出登陆
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putLoginout(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->putLoginout();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取用户收获地址列表
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getUserAddress(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->getUserAddress();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取用户收获地址详情
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getUserAddressInfo(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->getUserAddressInfo();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 添加用户收获地址
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function addUserAddress(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('addUserAddress')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->addUserAddress();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 修改用户收获地址
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putUserAddress(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('putUserAddress')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->putUserAddress();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 删除用户收获地址
|
|
* @return ResponseInterface
|
|
*/
|
|
public function deleteUserAddress(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->deleteUserAddress();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取弹窗数据
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getUserPopup(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('getUserPopup')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->getUserPopup();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 上报用户地址
|
|
* @return ResponseInterface
|
|
*/
|
|
public function postLocation(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->postLocation();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取用户地址
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getLocation(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->getLocation();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取用户配置
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getUserSystem(): ResponseInterface
|
|
{
|
|
$UserService = new UserService();
|
|
$data = $UserService->getUserSystem();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 修改用户配置
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function putUserSystem(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(UserRequest::class);
|
|
$request->scene('putUserSystem')->validateResolved();
|
|
|
|
$UserService = new UserService();
|
|
$data = $UserService->putUserSystem();
|
|
return $this->response->json($data);
|
|
}
|
|
} |