Merge remote-tracking branch 'origin/main' into zd-feature
This commit is contained in:
54
consumers/admin_user_service.php
Normal file
54
consumers/admin_user_service.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 管理员用户服务
|
||||
*/
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'AdminUserService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \App\JsonRpcService\UserService\AdminUserService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env("CONSUMERS_PROTOCOL", "consul"),
|
||||
'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"),
|
||||
],
|
||||
// 'nodes' => [
|
||||
// ['host' => '172.18.0.4', 'port' => 9502],
|
||||
// ],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
// 根据协议不同,区分配置
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
// 'open_length_check' => true,
|
||||
// 'package_length_type' => 'N',
|
||||
// 'package_length_offset' => 0,
|
||||
// 'package_body_offset' => 4,
|
||||
],
|
||||
// 重试次数,默认值为 2,收包超时不进行重试。暂只支持 JsonRpcPoolTransporter
|
||||
'retry_count' => 2,
|
||||
// 重试间隔,毫秒
|
||||
'retry_interval' => 100,
|
||||
// 使用多路复用 RPC 时的心跳间隔,null 为不触发心跳
|
||||
'heartbeat' => 30,
|
||||
// 当使用 JsonRpcPoolTransporter 时会用到以下配置
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
54
consumers/user_service.php
Executable file
54
consumers/user_service.php
Executable file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
*/
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'UserService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \App\JsonRpcService\UserService\UserService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env("CONSUMERS_PROTOCOL", "consul"),
|
||||
'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"),
|
||||
],
|
||||
// 'nodes' => [
|
||||
// ['host' => '172.18.0.4', 'port' => 9502],
|
||||
// ],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
// 根据协议不同,区分配置
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
// 'open_length_check' => true,
|
||||
// 'package_length_type' => 'N',
|
||||
// 'package_length_offset' => 0,
|
||||
// 'package_body_offset' => 4,
|
||||
],
|
||||
// 重试次数,默认值为 2,收包超时不进行重试。暂只支持 JsonRpcPoolTransporter
|
||||
'retry_count' => 2,
|
||||
// 重试间隔,毫秒
|
||||
'retry_interval' => 100,
|
||||
// 使用多路复用 RPC 时的心跳间隔,null 为不触发心跳
|
||||
'heartbeat' => 30,
|
||||
// 当使用 JsonRpcPoolTransporter 时会用到以下配置
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
54
consumers/wecheat_service.php
Executable file
54
consumers/wecheat_service.php
Executable file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 微信小程序服务 公共
|
||||
*/
|
||||
|
||||
return [
|
||||
// 对应消费者类的 $serviceName
|
||||
'name' => 'WecheatMiniService',
|
||||
// 服务接口名,可选,默认值等于 name 配置的值,如果 name 直接定义为接口类则可忽略此行配置,如 name 为字符串则需要配置 service 对应到接口类
|
||||
'service' => \App\JsonRpcService\UserService\WecheatMiniService::class,
|
||||
// 服务提供者的服务协议,可选,默认值为 jsonrpc-http
|
||||
// 可选 jsonrpc-http jsonrpc jsonrpc-tcp-length-check
|
||||
'protocol' => 'jsonrpc-http',
|
||||
// 负载均衡算法,可选,默认值为 random
|
||||
'load_balancer' => 'random',
|
||||
// 这个消费者要从哪个服务中心获取节点信息,如不配置则不会从服务中心获取节点信息
|
||||
'registry' => [
|
||||
'protocol' => env("CONSUMERS_PROTOCOL", "consul"),
|
||||
'address' => env("CONSUMERS_ADDRESS", "http://127.0.0.1:8500"),
|
||||
],
|
||||
// 'nodes' => [
|
||||
// ['host' => '172.18.0.4', 'port' => 9502],
|
||||
// ],
|
||||
// 配置项,会影响到 Packer 和 Transporter
|
||||
'options' => [
|
||||
'connect_timeout' => 5.0,
|
||||
'recv_timeout' => 5.0,
|
||||
'settings' => [
|
||||
// 根据协议不同,区分配置
|
||||
'open_eof_split' => true,
|
||||
'package_eof' => "\r\n",
|
||||
// 'open_length_check' => true,
|
||||
// 'package_length_type' => 'N',
|
||||
// 'package_length_offset' => 0,
|
||||
// 'package_body_offset' => 4,
|
||||
],
|
||||
// 重试次数,默认值为 2,收包超时不进行重试。暂只支持 JsonRpcPoolTransporter
|
||||
'retry_count' => 2,
|
||||
// 重试间隔,毫秒
|
||||
'retry_interval' => 100,
|
||||
// 使用多路复用 RPC 时的心跳间隔,null 为不触发心跳
|
||||
'heartbeat' => 30,
|
||||
// 当使用 JsonRpcPoolTransporter 时会用到以下配置
|
||||
'pool' => [
|
||||
'min_connections' => 1,
|
||||
'max_connections' => 32,
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -38,7 +38,6 @@ interface DataServiceInterface
|
||||
// 招考类型相关
|
||||
public function getExamTypes(array $data): array;
|
||||
public function getExamTypeBy(int $id): array;
|
||||
public function deleteExamType(int $id): bool;
|
||||
public function getExamTypesByCampusId(int $campusId): array;
|
||||
public function getExamTypeByIds(array $ids): array;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace Dhd\Micro\Interface\FileService;
|
||||
|
||||
interface FileService extends
|
||||
FileServiceInterface,
|
||||
QuestionParseInterface,
|
||||
QuestionQrCodeInterface,
|
||||
ExcelParseInterface {}
|
||||
\Dhd\Micro\Interface\JsonRpcInterface\FileService\FileServiceInterface,
|
||||
\Dhd\Micro\Interface\JsonRpcInterface\FileService\QuestionParseInterface,
|
||||
\Dhd\Micro\Interface\JsonRpcInterface\FileService\QuestionQrCodeInterface,
|
||||
\Dhd\Micro\Interface\JsonRpcInterface\FileService\ExcelParseInterface {}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* JsonRpc服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\FileService;
|
||||
namespace Dhd\Micro\Interface\JsonRpcInterface\FileService;
|
||||
|
||||
interface ExcelParseInterface
|
||||
{
|
||||
@@ -4,7 +4,7 @@
|
||||
* JsonRpc服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\FileService;
|
||||
namespace Dhd\Micro\Interface\JsonRpcInterface\FileService;
|
||||
|
||||
interface FileServiceInterface
|
||||
{
|
||||
@@ -4,7 +4,7 @@
|
||||
* JsonRpc服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\FileService;
|
||||
namespace Dhd\Micro\Interface\JsonRpcInterface\FileService;
|
||||
|
||||
interface QuestionParseInterface
|
||||
{
|
||||
@@ -4,7 +4,7 @@
|
||||
* JsonRpc服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\FileService;
|
||||
namespace Dhd\Micro\Interface\JsonRpcInterface\FileService;
|
||||
|
||||
interface QuestionQrCodeInterface
|
||||
{
|
||||
9
src/UserService/AdminUserService.php
Normal file
9
src/UserService/AdminUserService.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\JsonRpcService\UserService;
|
||||
|
||||
interface AdminUserService extends
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\admin\AdminUserServiceInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\admin\AdminLoginInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\admin\AdminMenuInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\admin\AdminRoleInterface {}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface;
|
||||
|
||||
interface UserDownloadRecordInterface
|
||||
{
|
||||
/**
|
||||
* 记录下载
|
||||
*/
|
||||
public function recordDownload(array $params): array;
|
||||
|
||||
/**
|
||||
* 检查是否已下载
|
||||
*/
|
||||
public function checkDownloaded(int $userId, int $resourceType, int $resourceId): array;
|
||||
|
||||
/**
|
||||
* 批量检查是否已下载
|
||||
*/
|
||||
public function batchCheckDownloaded(int $userId, int $resourceType, array $resourceIds): array;
|
||||
|
||||
/**
|
||||
* 获取用户下载记录列表
|
||||
*/
|
||||
public function getUserDownloadList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取资源下载统计
|
||||
*/
|
||||
public function getResourceDownloadStats(int $resourceType, int $resourceId): array;
|
||||
|
||||
/**
|
||||
* 获取用户下载统计
|
||||
*/
|
||||
public function getUserDownloadStats(int $userId): array;
|
||||
|
||||
/**
|
||||
* 删除下载记录
|
||||
*/
|
||||
public function deleteDownloadRecord(int $userId, int $id): array;
|
||||
|
||||
/**
|
||||
* 按来源获取下载历史(课程ID)
|
||||
*/
|
||||
public function getDownloadHistoryBySource(int $userId, int $courseId): array;
|
||||
|
||||
/**
|
||||
* 更新本地存储路径
|
||||
*/
|
||||
public function updateLocalPath(int $userId, int $resourceType, int $resourceId, string $localPath): array;
|
||||
|
||||
/**
|
||||
* 获取下载记录详情
|
||||
*/
|
||||
public function getDownloadRecordDetail(int $userId, int $resourceType, int $resourceId): array;
|
||||
|
||||
/**
|
||||
* 按资源类型获取下载历史
|
||||
*/
|
||||
public function getDownloadHistoryByType(int $userId, int $resourceType): array;
|
||||
|
||||
/**
|
||||
* 获取用户某类型资源的已下载ID列表
|
||||
*/
|
||||
public function getDownloadedResourceIds(int $userId, int $resourceType): array;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 管理员登录接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\admin;
|
||||
|
||||
interface AdminLoginInterface
|
||||
{
|
||||
/**
|
||||
* 登录
|
||||
* @param string $account 账号
|
||||
* @param string $password 密码
|
||||
* @param string $ip IP地址
|
||||
* @return array
|
||||
*/
|
||||
public function login(string $account, string $password, string $ip): array;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
* @param string $oldToken 旧token
|
||||
* @return array
|
||||
*/
|
||||
public function refreshToken(string $oldToken): array;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 管理网站菜单管理
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\admin;
|
||||
|
||||
interface AdminMenuInterface
|
||||
{
|
||||
/**
|
||||
* 获取菜单列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getMenuList(array $params): array;
|
||||
|
||||
/**
|
||||
* 创建、修改菜单
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function editMenu(array $params): array;
|
||||
|
||||
/**
|
||||
* 修改菜单状态
|
||||
* @param int $menuId 菜单id
|
||||
* @param int $status 状态
|
||||
* @return array
|
||||
*/
|
||||
public function editMenuStatus(int $menuId, int $status): array;
|
||||
|
||||
/**
|
||||
* 修改菜单排序
|
||||
* @param int $menuId 菜单id
|
||||
* @param int $sort 排序
|
||||
* @return array
|
||||
*/
|
||||
public function editMenuSort(int $menuId, int $sort): array;
|
||||
|
||||
/**
|
||||
* 获取菜单树
|
||||
* @param int $userId 用户id
|
||||
* @return array
|
||||
*/
|
||||
public function getMenuTree(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取用户菜单列表
|
||||
* @param int $userId 用户id
|
||||
* @return array
|
||||
*/
|
||||
public function getUserMenuList(int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取菜单权限码
|
||||
* @param int $menuId 菜单ID
|
||||
*/
|
||||
public function getButtonCodeList(int $menuId): array;
|
||||
|
||||
/**
|
||||
* 新增、修改权限码
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function editButtonCode(array $params): array;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 角色管理
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\admin;
|
||||
|
||||
interface AdminRoleInterface
|
||||
{
|
||||
/**
|
||||
* 获取角色列表
|
||||
* @param array $params 查询参数
|
||||
*/
|
||||
public function getRoleList(array $params): array;
|
||||
|
||||
/**
|
||||
* 新增/修改角色
|
||||
* @param array $params
|
||||
*/
|
||||
public function editRole(array $params): array;
|
||||
|
||||
/**
|
||||
* 修改角色状态
|
||||
* @param int $roleId 角色ID
|
||||
* @param int $status 状态
|
||||
*/
|
||||
public function editRoleStatus(int $roleId, int $status): array;
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param int $roleId
|
||||
*/
|
||||
public function deleteRole(int $roleId): array;
|
||||
|
||||
/**
|
||||
* 获取所有角色,用于下拉选择
|
||||
*/
|
||||
public function getRoleSelectList(): array;
|
||||
|
||||
/**
|
||||
* 获取管理员户权限码
|
||||
* @param int $userId
|
||||
*/
|
||||
public function getUserCodes(int $userId): array;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 管理员服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\admin;
|
||||
|
||||
interface AdminUserServiceInterface
|
||||
{
|
||||
/**
|
||||
* 获取管理员列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取所有管理员列表
|
||||
*/
|
||||
public function getAllAdminList(): array;
|
||||
|
||||
/**
|
||||
* 根据id获取管理员信息
|
||||
* @@param int $userId 管理员id
|
||||
* @return array 管理员信息
|
||||
*/
|
||||
public function getUserInfoById(int $userId): array;
|
||||
|
||||
/**
|
||||
* 创建、修改管理员
|
||||
* @param array $params 创建参数
|
||||
* @return array
|
||||
*/
|
||||
public function editUser(array $params): array;
|
||||
|
||||
/**
|
||||
* 修改管理员密码
|
||||
* @param int $userId 管理员id
|
||||
* @param string $password 新密码
|
||||
* @return array
|
||||
*/
|
||||
public function editPassword(int $userId, string $password): array;
|
||||
}
|
||||
121
src/UserService/JsonRpcInterface/user/LoginServiceInterface.php
Executable file
121
src/UserService/JsonRpcInterface/user/LoginServiceInterface.php
Executable file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* JsonRpc服务接口
|
||||
* 登录服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
interface LoginServiceInterface
|
||||
{
|
||||
/**
|
||||
* 用户账号、密码登录
|
||||
* @param array $params [account,password,ip] 均为必填
|
||||
* @return array
|
||||
*/
|
||||
public function login(array $params): null|array;
|
||||
|
||||
/**
|
||||
* 用户账号、密码注册
|
||||
* @param array $params [account,password] 均为必填
|
||||
* @return array
|
||||
*/
|
||||
public function register(array $params): array;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
* @param string $oldToken 旧token
|
||||
* @return array 新token
|
||||
*/
|
||||
public function refreshToken(string $oldToken): array;
|
||||
|
||||
/**
|
||||
* 获取短信验证码key,用于发送验证码
|
||||
* @return array
|
||||
*/
|
||||
public function getSmsKey(): array;
|
||||
|
||||
/**
|
||||
* 发送手机号登录/注册,短信验证码
|
||||
* @param string $phone 手机号
|
||||
* @param string $key 验证码key
|
||||
* @return array
|
||||
*/
|
||||
public function sendLoginSmsCode(string $phone, string $key): array;
|
||||
|
||||
/**
|
||||
* 手机号登录/注册
|
||||
* @param string $phone 手机号
|
||||
* @param string $smsCode 验证码
|
||||
* @param string $ip ip地址
|
||||
* @param int $loginType 登录方式
|
||||
* @return array
|
||||
*/
|
||||
public function loginByPhone(string $phone, string $smsCode, string $ip, int $loginType): array;
|
||||
|
||||
/**
|
||||
* 微信登录
|
||||
* @param string $code 微信code
|
||||
* @param string $ip ip地址
|
||||
* @return array
|
||||
*/
|
||||
public function wxLogin(string $code, string $ip): array;
|
||||
|
||||
/**
|
||||
* 微信绑定用户
|
||||
* @param string $bindId 微信绑定id
|
||||
* @param string $phone 手机号
|
||||
* @param string $smsCode 验证码
|
||||
* @param string $ip ip地址
|
||||
* @return array
|
||||
*/
|
||||
public function wxBindUser(string $bindId, string $phone, string $smsCode, string $ip): array;
|
||||
|
||||
/**
|
||||
* 获取官网登录二维码
|
||||
* @return array
|
||||
*/
|
||||
public function getOfficialLoginQrCode(): array;
|
||||
|
||||
/**
|
||||
* 轮询官网登录状态
|
||||
* @param string $code 官网登录二维码code
|
||||
* @return array
|
||||
*/
|
||||
public function pollOfficialLoginStatus(string $code): array;
|
||||
|
||||
/**
|
||||
* app扫码登录官网
|
||||
* @param int $uid 用户id
|
||||
* @param string $code 官网登录二维码code
|
||||
* @param string $ip ip地址
|
||||
* @return array
|
||||
*/
|
||||
public function appScanOfficialLogin(int $uid, string $code, string $ip): array;
|
||||
|
||||
/**
|
||||
* 密钥登录
|
||||
* @param int $uid 用户id
|
||||
* @param string $ip ip地址
|
||||
* @param string $key1 密钥1
|
||||
* @param string $key2 密钥2
|
||||
* @param string $key3 密钥3
|
||||
* @return array
|
||||
*/
|
||||
public function loginBySecretKey(int $uid, string $ip, string $key1, string $key2, string $key3): array;
|
||||
|
||||
/**
|
||||
* 极光一键登录
|
||||
* @param string $loginToken 极光返回的loginToken
|
||||
* @param string $ip ip地址
|
||||
* @return array
|
||||
*/
|
||||
public function jiguangLogin(string $loginToken, string $ip): array;
|
||||
|
||||
/**
|
||||
* 获取极光配置信息
|
||||
* @return array
|
||||
*/
|
||||
public function getJiguangConfig(): array;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
/**
|
||||
* 用户成绩弹幕(晒分)接口
|
||||
*/
|
||||
interface StudentScoreInterface
|
||||
{
|
||||
/**
|
||||
* 获取成绩弹幕列表(后台管理)
|
||||
*/
|
||||
public function getStudentScoreList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取成绩弹幕列表(前端展示)
|
||||
*/
|
||||
public function getStudentScoreBarrage(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取成绩弹幕详情
|
||||
*/
|
||||
public function getStudentScoreDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 新增/编辑成绩弹幕
|
||||
*/
|
||||
public function editStudentScore(array $data): int;
|
||||
|
||||
/**
|
||||
* 删除成绩弹幕
|
||||
*/
|
||||
public function deleteStudentScore(int $id): bool;
|
||||
|
||||
/**
|
||||
* 批量删除成绩弹幕
|
||||
*/
|
||||
public function batchDeleteStudentScore(array $ids): bool;
|
||||
|
||||
/**
|
||||
* 修改显示状态
|
||||
*/
|
||||
public function editStudentScoreShow(int $id, int $isShow): bool;
|
||||
|
||||
/**
|
||||
* 修改排序
|
||||
*/
|
||||
public function editStudentScoreSort(int $id, int $sort): bool;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
interface UserCurriculumVitaeInterface
|
||||
{
|
||||
/**
|
||||
* 获取用户简历
|
||||
* @param int $userId 用户id
|
||||
* @return array
|
||||
*/
|
||||
public function getCurriculumVitae(int $userId): array;
|
||||
/**
|
||||
* 编辑用户简历
|
||||
* @param array $params 简历参数
|
||||
* @param int $userId 用户id
|
||||
* @return void
|
||||
*/
|
||||
public function editCurriculumVitae(array $params, int $userId): array;
|
||||
/**
|
||||
* 删除用户教育经历
|
||||
* @param int $userId 用户id
|
||||
* @param int $educationId 教育经历id
|
||||
* @return void
|
||||
*/
|
||||
public function deleteUserEducation(int $userId, int $educationId): array;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
interface UserInfoCheckInterface
|
||||
{
|
||||
/**
|
||||
* 用户提交信息修改
|
||||
* @param int $userId 用户ID
|
||||
* @param int $type 修改信息类型
|
||||
* @param string $data 修改信息
|
||||
* @return void
|
||||
*/
|
||||
public function submitUserInfo(int $userId, int $type, string $data): array;
|
||||
|
||||
/**
|
||||
* 获取用户信息修改审核列表
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfoCheckList(array $params): array;
|
||||
|
||||
/**
|
||||
* 审核用户信息修改
|
||||
* @param int $adminUserId 管理员用户ID
|
||||
* @param array $params 参数
|
||||
* @return void
|
||||
*/
|
||||
public function checkUserInfo(int $adminUserId, array $params): array;
|
||||
}
|
||||
78
src/UserService/JsonRpcInterface/user/UserServiceInterface.php
Executable file
78
src/UserService/JsonRpcInterface/user/UserServiceInterface.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用户服务接口
|
||||
*/
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\user;
|
||||
|
||||
interface UserServiceInterface
|
||||
{
|
||||
/**
|
||||
* 根据token获取用户信息
|
||||
* @param string $token 登录token
|
||||
* @return array 用户信息
|
||||
*/
|
||||
public function getUserInfoByToken(string $token): array;
|
||||
|
||||
/**
|
||||
* 根据id获取用户信息
|
||||
* @@param int $uid 用户id
|
||||
* @return array 用户信息
|
||||
*/
|
||||
public function getUserInfoById(int $uid): array;
|
||||
|
||||
/**
|
||||
* 同步用户信息,从原来的app用户表同步过来,后期全面更换为微服务后将删除该接口
|
||||
* @param int $uid 用户原id
|
||||
* @return array
|
||||
*/
|
||||
public function syncUserInfo(int $uid): array;
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
* @param int $uid 用户id
|
||||
* @param string $pwd 新密码
|
||||
* @return array
|
||||
*/
|
||||
public function editUserPwd(int $uid, string $pwd): array;
|
||||
|
||||
/**
|
||||
* 修改用户昵称
|
||||
* @param int $uid 用户id
|
||||
* @param string $nickName 新昵称
|
||||
* @return array
|
||||
*/
|
||||
public function editUserNickName(int $uid, string $nickName): array;
|
||||
|
||||
/**
|
||||
* 获取用户新增数据
|
||||
*/
|
||||
public function getUserGrowData(): array;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
public function getUserList(array $params): array;
|
||||
|
||||
/**
|
||||
* 统计用户数据
|
||||
*/
|
||||
public function getUserTotalByDateType(string $dateType): array;
|
||||
|
||||
/**
|
||||
* 用户注销
|
||||
* @param int $uid 用户ID
|
||||
* @return mixed
|
||||
*/
|
||||
public function userCancel(int $uid): array;
|
||||
|
||||
/**
|
||||
* 设置用户学生信息,若手机号已存在则更新
|
||||
* @param string $phone 手机号
|
||||
* @param array $params 参数
|
||||
* @return mixed
|
||||
*/
|
||||
public function setUserStudentInfoByPhone(string $phone, array $params): array;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Dhd\Micro\Interface\UserService\JsonRpcInterface\wechat;
|
||||
|
||||
interface WecheatMiniInterface
|
||||
{
|
||||
/**
|
||||
* 通过微信手机授权code进行登录
|
||||
* @param string $code 微信授权code
|
||||
* @param string $ip ip
|
||||
* @return array
|
||||
*/
|
||||
public function loginWithPhoneCode(string $code, string $ip): array;
|
||||
}
|
||||
15
src/UserService/UserService.php
Executable file
15
src/UserService/UserService.php
Executable file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用户中心服务
|
||||
*/
|
||||
|
||||
namespace App\JsonRpcService\UserService;
|
||||
|
||||
interface UserService extends
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\LoginServiceInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\UserServiceInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\UserInfoCheckInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\UserCurriculumVitaeInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\UserDownloadRecordInterface,
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\user\StudentScoreInterface {}
|
||||
11
src/UserService/WecheatMiniService.php
Normal file
11
src/UserService/WecheatMiniService.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 微信小程序服务
|
||||
* 公共
|
||||
*/
|
||||
|
||||
namespace App\JsonRpcService\UserService;
|
||||
|
||||
interface WecheatMiniService extends
|
||||
\Dhd\Micro\Interface\UserService\JsonRpcInterface\wechat\WecheatMiniInterface {}
|
||||
Reference in New Issue
Block a user