2022-11-15 16:33:33 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Controller\PunchCard\User;
|
|
|
|
|
2022-11-17 10:14:12 +08:00
|
|
|
use App\Controller\AuthController;
|
2022-11-15 16:33:33 +08:00
|
|
|
use App\JsonRpc\PunchCardSystemExternalServiceInterface;
|
|
|
|
use App\JsonRpc\UserExternalServiceInterface;
|
|
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
|
|
use Hyperf\HttpServer\Annotation\GetMapping;
|
|
|
|
use Hyperf\HttpServer\Annotation\PostMapping;
|
|
|
|
|
|
|
|
#[Controller(prefix: "kq")]
|
2022-11-17 10:14:12 +08:00
|
|
|
class UserController extends AuthController
|
2022-11-15 16:33:33 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 用户中心对外RPC服务
|
|
|
|
*
|
|
|
|
* @var UserExternalServiceInterface
|
|
|
|
*/
|
|
|
|
#[Inject]
|
|
|
|
protected UserExternalServiceInterface $userExternalService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 考勤系统设置对外RPC服务
|
|
|
|
*
|
|
|
|
* @var PunchCardSystemExternalServiceInterface
|
|
|
|
*/
|
|
|
|
#[Inject]
|
|
|
|
protected PunchCardSystemExternalServiceInterface $punchCardSystemExternalService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取个人资料
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
#[GetMapping(path: "user/information")]
|
|
|
|
public function information() : array
|
|
|
|
{
|
|
|
|
$openid = $this->request->input('openid', '');
|
|
|
|
return $this->getServiceResult($this->userExternalService->getUserInfo($openid, [
|
|
|
|
'user_name',
|
|
|
|
'user_phone',
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存个人资料
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
#[PostMapping(path: "user/save_information")]
|
|
|
|
public function saveInformation() : void
|
|
|
|
{
|
|
|
|
$phone = $this->request->input('phone', '');
|
|
|
|
// TODO 逻辑完善
|
|
|
|
}
|
|
|
|
|
2022-11-16 15:57:58 +08:00
|
|
|
/**
|
|
|
|
* 获取问题反馈类型列表
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
#[GetMapping(path: "user/feedback_type")]
|
|
|
|
public function getFeedbackTypeList() : array
|
|
|
|
{
|
|
|
|
return $this->getServiceResult($this->punchCardSystemExternalService->getFeedbackTypeList());
|
|
|
|
}
|
|
|
|
|
2022-11-15 16:33:33 +08:00
|
|
|
/**
|
|
|
|
* 保存问题反馈
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
#[PostMapping(path: "user/save_feedback")]
|
|
|
|
public function saveFeedback() : array
|
|
|
|
{
|
|
|
|
return $this->getServiceResult($this->punchCardSystemExternalService->saveFeedback($this->request));
|
|
|
|
}
|
2022-11-16 15:41:43 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取紧急联系人关系列表
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
#[GetMapping(path: "user/emergency_contact_kinship")]
|
|
|
|
public function getEmergencyContactKinshipList() : array
|
|
|
|
{
|
|
|
|
return $this->getServiceResult($this->userExternalService->getEmergencyContactKinshipList());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存紧急联系人
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
#[PostMapping(path: "user/add_emergency_contact")]
|
|
|
|
public function addEmergencyContact() : array
|
|
|
|
{
|
|
|
|
return $this->getServiceResult($this->userExternalService->addEmergencyContact($this->request));
|
|
|
|
}
|
2022-11-15 16:33:33 +08:00
|
|
|
}
|