Files
EdgeCommon/pkg/rpc/protos/service_admin.proto

106 lines
2.2 KiB
Protocol Buffer
Raw Normal View History

2020-09-13 19:27:47 +08:00
syntax = "proto3";
option go_package = "./pb";
package pb;
2020-10-14 19:42:28 +08:00
import "model_admin.proto";
import "rpc_messages.proto";
2020-09-13 19:27:47 +08:00
service AdminService {
// 登录
2020-10-13 20:05:18 +08:00
rpc loginAdmin (LoginAdminRequest) returns (LoginAdminResponse);
2020-09-13 19:27:47 +08:00
// 检查管理员是否存在
2020-10-13 20:05:18 +08:00
rpc checkAdminExists (CheckAdminExistsRequest) returns (CheckAdminExistsResponse);
2020-09-13 19:27:47 +08:00
2020-10-14 19:42:28 +08:00
// 检查用户名是否存在
rpc checkAdminUsername (CheckAdminUsernameRequest) returns (CheckAdminUsernameResponse);
2020-09-13 19:27:47 +08:00
// 获取管理员名称
2020-10-13 20:05:18 +08:00
rpc findAdminFullname (FindAdminFullnameRequest) returns (FindAdminFullnameResponse);
2020-09-13 19:27:47 +08:00
2020-10-14 19:42:28 +08:00
// 获取管理员信息
rpc findEnabledAdmin (FindEnabledAdminRequest) returns (FindEnabledAdminResponse);
2020-10-13 20:05:18 +08:00
// 创建或修改管理员
rpc createOrUpdateAdmin (CreateOrUpdateAdminRequest) returns (CreateOrUpdateAdminResponse);
2020-10-14 19:42:28 +08:00
// 修改管理员信息
rpc updateAdmin (UpdateAdminRequest) returns (RPCUpdateSuccess);
// 修改管理员登录信息
rpc updateAdminLogin (UpdateAdminLoginRequest) returns (RPCUpdateSuccess);
2020-09-13 19:27:47 +08:00
}
2020-10-13 20:05:18 +08:00
// 登录
2020-09-13 19:27:47 +08:00
message LoginAdminRequest {
string username = 1;
string password = 2;
}
message LoginAdminResponse {
int64 adminId = 1;
bool isOk = 2;
string message = 3;
}
2020-10-13 20:05:18 +08:00
// 检查管理员是否存在
2020-09-13 19:27:47 +08:00
message CheckAdminExistsRequest {
int64 adminId = 1;
}
message CheckAdminExistsResponse {
bool isOk = 1;
string message = 2;
}
2020-10-14 19:42:28 +08:00
// 检查用户名是否存在
message CheckAdminUsernameRequest {
int64 adminId = 1;
string username = 2;
}
message CheckAdminUsernameResponse {
bool exists = 1;
}
2020-10-13 20:05:18 +08:00
// 获取管理员名称
2020-09-13 19:27:47 +08:00
message FindAdminFullnameRequest {
int64 adminId = 1;
}
message FindAdminFullnameResponse {
string fullname = 1;
}
2020-10-14 19:42:28 +08:00
// 获取管理员信息
message FindEnabledAdminRequest {
int64 adminId = 1;
}
message FindEnabledAdminResponse {
Admin admin = 1;
}
2020-10-13 20:05:18 +08:00
// 创建或修改管理员
message CreateOrUpdateAdminRequest {
string username = 1;
string password = 2;
}
message CreateOrUpdateAdminResponse {
int64 adminId = 1;
2020-10-14 19:42:28 +08:00
}
// 修改管理员信息
message UpdateAdminRequest {
int64 adminId = 1;
string fullname = 2;
}
// 修改管理员登录信息
message UpdateAdminLoginRequest {
int64 adminId = 1;
string username = 2;
string password = 3;
2020-10-13 20:05:18 +08:00
}