74 lines
2.4 KiB
Protocol Buffer
74 lines
2.4 KiB
Protocol Buffer
syntax = "proto3";
|
||
package mall;
|
||
option go_package = "bsm/full/module/ec/mall/pb;mall";
|
||
import "module/ec/mall/proto/const.proto";
|
||
|
||
// Store(店铺)微服务-工作人员
|
||
service Staff {
|
||
// 登录
|
||
rpc Login(LoginRequest) returns (LoginReply) {}
|
||
|
||
// 获取工作人员列表
|
||
rpc Fetch(blocks.MallFetchRequest) returns (StaffListReply) {}
|
||
|
||
// 创建工作人员
|
||
rpc Create(StaffItem) returns (blocks.IdentityStatusReply) {}
|
||
|
||
// 删除工作人员
|
||
rpc Delete(blocks.IdentRequest) returns (blocks.IdentityStatusReply) {}
|
||
|
||
// 获取个人信息
|
||
rpc GetProfile(blocks.IdentRequest) returns (StaffItem) {}
|
||
|
||
// 设置个人信息
|
||
rpc SetProfile(StaffItem) returns (blocks.IdentityStatusReply) {}
|
||
|
||
// 设置账号密码
|
||
rpc SetPassword(SetAccountRequest) returns (blocks.IdentityStatusReply) {}
|
||
}
|
||
|
||
message LoginRequest {
|
||
string account = 1;
|
||
string password = 2;
|
||
string phone = 3;
|
||
string verify_code = 4 [json_name="verify_code"];
|
||
int32 login_genre = 5 [json_name="login_genre"]; // 登陆类型: 1 账密; 2 手机验证码
|
||
}
|
||
|
||
message LoginReply {
|
||
string token = 1; // token 授权码
|
||
string identity = 2; // 唯一标识
|
||
string store_identity = 3 [json_name="store_identity"]; // 店铺唯一标识
|
||
string name = 4; // 姓名
|
||
string account = 5; // 账号
|
||
string role = 6; // 角色
|
||
int32 status = 7; // 状态
|
||
string created_at = 8 [json_name="created_at"]; // 创建时间
|
||
string store_name = 9 [json_name="store_name"]; // 店铺名称
|
||
}
|
||
|
||
message SetAccountRequest {
|
||
string account = 1; // 账号
|
||
string password = 2; // 密码
|
||
string password_confirmed = 3 [json_name="password_confirmed"]; // 确认密码
|
||
}
|
||
|
||
message StaffItem {
|
||
int64 id = 1; // id
|
||
string identity = 2; // 唯一标识
|
||
string name = 3; // 姓名
|
||
string account = 4; // 账号
|
||
string password =5; // 密码
|
||
string profile = 6; // 简介
|
||
string role =7; // 角色
|
||
string phone = 8; // 手机号
|
||
string email = 9; // 邮箱
|
||
int32 status = 10; // 状态:默认为0,-1禁止,1为正常
|
||
string avatar = 11; // 头像
|
||
string created_at = 12 [json_name="created_at"];
|
||
}
|
||
|
||
message StaffListReply {
|
||
repeated StaffItem data = 1;
|
||
int64 count = 2;
|
||
} |