| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- syntax = "proto3";
- option go_package =".;im";
- package im;
- enum ErrorCode{
- OK = 0;
- PARAM = 4001;
- Exist = 4002;
- Token = 4003;
- PasswordWrongTooMuch = 4004;
- VerifyCode = 4005;
- }
- // metadata: 综合管理系统前端调用需要字段 token 用作登录验证;子系统调用需要字段 sys_token 用作系统验证
- service Api {
- rpc GenVerifyImage(GenVerifyImageRequest)returns(GenVerifyImageReply){}
- rpc SignUpUserCode (SignUpRequest) returns (CreateReply) {}
- rpc SignUpPhone (SignUpRequest) returns (CreateReply) {}
- rpc SignInUserCode (SignInPasswordRequest) returns (SignInReply) {}
- rpc SignInWithPhonePassword (SignInPasswordRequest) returns (SignInReply) {}
- // ---子系统专用---
- // 检查token有效性
- rpc SubSessionCheck (TokenParam) returns (SessionCheckReply) {}
- // 检查token所属用户是否拥有调用service权限
- rpc SubPermissionListCheck (PermissionCheck) returns (PermissionCheckReply) {}
- // 登出传入token
- rpc SubSignOut (TokenParam) returns (DefaultReply) {}
- // 批量保存service
- rpc SubServiceSaveList (SaveServiceListRequest) returns (DefaultReply) {}
- // ---子系统专用---
- // 用户列表
- rpc UserList (UserListRequest) returns (UserListReply) {}
- // 单个用户信息详情
- rpc UserGetInfo (UserGetInfoRequest) returns (UserInfo) {}
- // 用户添加多个角色
- rpc UserAddRoles(UserRolesRequest) returns (DefaultReply) {}
- // 用户移除多个角色
- rpc UserRemoveRoles(UserRolesRequest) returns (DefaultReply) {}
- // 用户获取栏目列表
- rpc UserGetColumnList(UserGetColumnListRequest) returns (UserGetColumnListReply) {}
- // 创建角色
- rpc RoleCreate(CreateRoleRequest) returns (DefaultReply) {}
- // 角色列表
- rpc RoleList(RoleListRequest) returns (RoleListReply) {}
- // 角色编辑
- rpc RoleEdit(Role) returns (DefaultReply) {}
- // 角色添加多个service权限
- rpc RoleAddPermissions(RolePermissionRequest) returns (DefaultReply) {}
- // 角色移除多个service权限
- rpc RoleRemovePermissions(RolePermissionRequest) returns (DefaultReply) {}
- // service权限列表
- rpc ServiceList(ServiceListRequest) returns (ServiceListReply) {}
- // 移除service
- rpc ServiceRemoveList(ServiceRemoveRequest) returns (DefaultReply) {}
- // 创建商户
- rpc ShopCreate (CreateShopRequest) returns (CreateReply) {}
- // 商户列表
- rpc ShopList (ShopListRequest) returns (ShopListReply) {}
- // 商户添加用户
- rpc ShopAddUser (ShopAddUserRequest) returns (DefaultReply) {}
- // 商户添加许可证
- rpc ShopAddLicense (ShopAddLicenseRequest) returns (DefaultReply) {}
- // 系统添加商户
- rpc SystemAddShop (SystemAddShopRequest) returns (DefaultReply) {}
- // 系统添加用户
- rpc SystemAddUser (SystemAddUserRequest) returns (DefaultReply) {}
- // 创建栏目
- rpc ColumnCreate (ColumnCreateRequest) returns (CreateReply) {}
- // 创建许可
- rpc LicenseCreate (LicenseCreateRequest) returns (CreateReply) {}
- // 许可证批量绑定栏目(之前绑定的会全部取消)
- rpc LicenseBindColumns (LicenseBindColumnsRequest) returns (DefaultReply) {}
- // ---总后台专用API---
- rpc IMSystemCreate (CreateSystemRequest) returns (TokenParam) {}
- rpc IMSignOut (DefaultRequest) returns (DefaultReply) {}
- rpc IMSelfInfo (DefaultRequest) returns (UserInfo) {}
- rpc IMMessageRcv (DefaultRequest) returns (stream Message) {}
- // ---总后台专用API---
- }
- message DefaultRequest{
- }
- message GenVerifyImageRequest{
- int32 height = 1;
- int32 width = 2;
- }
- message GenVerifyImageReply{
- string codeId = 1;
- string imageBase64 = 2;
- }
- message TokenParam{
- string token = 1;
- }
- message SignInReply{
- string token = 1;
- int64 userId = 2;
- }
- message DefaultReply{}
- message CreateReply{
- int64 id = 1;
- }
- message SignInPasswordRequest {
- string codeId = 1;
- string verifyCode = 2;
- //登录凭据,用户名、手机号等
- string credential = 3;
- string password = 4;
- //仅综合管理后台有效
- int64 sysId = 5;
- //session有效期,单位:秒
- int64 expirationSec = 6;
- string ip = 7;
- string clientInfo = 8;
- }
- enum Status{
- Null = 0;
- Ban = 1;
- On = 2;
- Delete = 9;
- }
- message SignUpRequest {
- string userCode = 1 ;
- string name = 2 ;
- string email = 3 ;
- string phone = 4 ;
- string wxOpenId = 5;
- string qq = 6;
- string password = 7;
- string question = 8;
- string answer = 9;
- string memo = 10;
- }
- message UserInfo {
- int64 id = 1 ;
- string userCode = 2 ;
- string name = 3 ;
- string email = 4 ;
- string phone = 5 ;
- string qq = 7;
- string memo = 11;
- Status status = 12;
- }
- message PermissionCheck {
- string token = 1;
- int64 shopId = 2;
- // servicePath全路径,区分大小写,如User/List
- repeated string servicePathList = 3;
- }
- message SessionCheckReply {
- int64 userId = 1;
- }
- message PermissionCheckReply{
- repeated bool resultList = 1;
- }
- message Service {
- string path = 1;
- string memo = 2;
- }
- message SaveServiceListRequest{
- repeated Service list = 1;
- }
- message CreateSystemRequest{
- string fullName = 1;
- string shortname = 2;
- string sysUrl = 3;
- string memo = 4;
- }
- message UserGetColumnListRequest{
- int64 userId = 1;
- int64 shopId = 2;
- // 最顶层为0
- int32 parentId = 3;
- // 仅综合管理后台调用有效
- int64 sysId = 4;
- }
- message Column{
- string name = 1;
- string url = 2;
- string code = 3;
- // 顺序
- int32 sn = 4;
- Status status = 5;
- bool navShow = 6;
- int64 id = 7;
- }
- message UserGetColumnListReply{
- repeated Column list = 1;
- }
- message CreateRoleRequest{
- string name = 1;
- string memo = 2;
- }
- message Role {
- int64 id = 1;
- string name = 2;
- string memo = 3;
- Status status = 4;
- string systemName = 5;
- }
- message RoleListRequest{
- int64 userId = 1;
- int64 sysId = 2;
- }
- message UserListRequest{
- // 0为全部
- int64 roleId = 1;
- Status status = 2;
- // 模糊查询
- string name = 3;
- int64 lcstypeid = 4;
- // 仅总后台请求时有效
- int64 sysId = 5;
- }
- message UserListReply{
- repeated UserInfo list = 1;
- }
- message UserGetInfoRequest{
- int64 userId = 1;
- }
- message UserRolesRequest{
- int64 userId = 1;
- repeated int64 roleIdList = 2;
- }
- message RoleListReply {
- repeated Role list = 1;
- }
- message RolePermissionRequest{
- int64 roleId = 1;
- repeated string servicePath = 2;
- }
- message ServiceListRequest{
- // 仅总系统有效
- int64 sysId = 1;
- }
- message ServiceListReply{
- repeated Service list = 1;
- }
- message ServiceRemoveRequest{
- repeated string pathList = 1;
- }
- message CreateShopRequest{
- string name = 1;
- string key = 2;
- //上级商家Id
- int64 sId = 3;
- string addr = 4;
- string phone = 5;
- string contacts =6;
- int64 createUser = 7;
- }
- message ShopListRequest{
- // 子系统调用时,0:展示所有商家,大于0则展示本系统商家
- int64 sysId = 1;
- // 模糊查询
- string name = 2;
- // Status_Null查询全部
- Status status = 3;
- //上级商家Id, -1 时查询全部
- int64 sId = 4;
- }
- message ShopAddUserRequest{
- int64 shopId = 1;
- int64 userId = 2;
- }
- message ShopAddLicenseRequest{
- int64 shopId = 1;
- int64 licenseId = 2;
- int64 feeId = 3;
- int64 beginTimestamp = 4;
- int64 execUserId = 5;
- string memo = 6;
- }
- message ShopInfo{
- int64 shopId =1;
- string name =2;
- int64 sId =3;
- string addr =4;
- string phone =5;
- string contacts =6;
- Status status =7;
- int64 created_at =8;
- int64 created_user =9;
- int64 updated_at =10;
- int64 updated_user =11;
- }
- message ShopListReply{
- repeated ShopInfo list = 1;
- }
- message SystemAddShopRequest{
- // 仅总后台调用有效
- int64 sysId = 1;
- int64 shopId = 2;
- }
- message SystemAddUserRequest{
- // 仅总后台调用有效
- int64 sysId = 1;
- int64 userId = 2;
- string memo = 3;
- }
- message ColumnCreateRequest{
- // 仅总后台调用有效
- int64 sysId = 1;
- // 父级栏目ID
- int64 parentId = 2;
- string name = 3;
- string url = 4;
- // 栏目代码
- string code = 5;
- // 栏目序号,排序用
- int32 no = 6;
- bool show = 7;
- }
- message LicenseCreateRequest{
- // 仅总后台调用有效
- int64 sysId = 1;
- string name = 2;
- // 有效期时长,单位秒
- int64 validPeriodSec = 3;
- // 单位:分
- int32 price = 4;
- string memo = 5;
- int64 execUser = 6;
- }
- message LicenseBindColumnsRequest{
- int64 licenseId =1;
- repeated int64 columnIdList = 2;
- string memo = 3;
- int64 execUser = 4;
- }
- message Message{
- int64 id = 1;
- string title = 2;
- string content = 3;
- enum Level{
- Null = 0;
- Normal = 1;
- Warn = 2;
- Error = 3;
- }
- Level level = 4;
- int64 createAt = 5;
- }
|