完善用户中心紧急联系人功能
parent
e6266edc07
commit
fe656375b4
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\JsonRpc;
|
||||||
|
|
||||||
|
use Hyperf\RpcClient\AbstractServiceClient;
|
||||||
|
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||||
|
|
||||||
|
class UserExternalServiceConsumer extends AbstractServiceClient implements UserExternalServiceInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 定义对应服务提供者的服务名称
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $serviceName = 'UserExternalService';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
*
|
||||||
|
* @param string $openid
|
||||||
|
* @param array $field
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getUserInfo(string $openid, array $field = []) : array
|
||||||
|
{
|
||||||
|
return $this->__request(__FUNCTION__, compact('openid', 'field'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过微信授权新建用户
|
||||||
|
*
|
||||||
|
* @param string $openid
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function wechatNewUser(string $openid) : array
|
||||||
|
{
|
||||||
|
return $this->__request(__FUNCTION__, compact('openid'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取紧急联系人关系列表
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getEmergencyContactKinshipList() : array
|
||||||
|
{
|
||||||
|
return $this->__request(__FUNCTION__, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存紧急联系人
|
||||||
|
*
|
||||||
|
* @param RequestInterface $request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function addEmergencyContact(RequestInterface $request) : array
|
||||||
|
{
|
||||||
|
return $this->__request(__FUNCTION__, $request->all());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue