74 lines
1.4 KiB
Protocol Buffer
74 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package admin;
|
|
option go_package="./admin";
|
|
|
|
import "google/protobuf/any.proto";
|
|
import "google/api/annotations.proto";
|
|
|
|
message AdminEditRequest {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string password = 3;
|
|
string avatar = 4;
|
|
string phone = 5;
|
|
string email = 6;
|
|
repeated int64 roles = 7;
|
|
}
|
|
|
|
|
|
message StatusRequest {
|
|
int64 id = 1 ;
|
|
int32 status = 2 ;
|
|
string reason = 3;
|
|
}
|
|
|
|
message Response {
|
|
int32 code = 1;
|
|
string msg = 2;
|
|
google.protobuf.Any data = 3;
|
|
}
|
|
|
|
message PasswordRequest {
|
|
int64 id = 1;
|
|
string password = 2;
|
|
}
|
|
|
|
message OwnPasswordRequest {
|
|
string password = 1;
|
|
}
|
|
|
|
message AdminInfoRequest {
|
|
int64 id = 1;
|
|
}
|
|
|
|
message AdminItemsRequest {
|
|
int32 page = 1;
|
|
int32 size = 2;
|
|
string phone = 3;
|
|
string name = 5;
|
|
string email = 6;
|
|
int32 status = 7;
|
|
}
|
|
|
|
message AdminLoginRequest {
|
|
int32 username = 1;
|
|
int32 password = 2;
|
|
}
|
|
|
|
service Admin {
|
|
rpc AdminAdd(AdminEditRequest) returns(Response){
|
|
option (google.api.http) = {
|
|
post: "/admin/v3/admin/add"
|
|
body: "*"
|
|
};
|
|
};
|
|
|
|
rpc AdminEdit(AdminEditRequest) returns(Response);
|
|
rpc AdminStatus(StatusRequest) returns(Response);
|
|
rpc Password(PasswordRequest) returns(Response);
|
|
rpc OwnPassword(OwnPasswordRequest) returns(Response);
|
|
rpc AdminInfo(AdminInfoRequest) returns(Response);
|
|
rpc AdminItems(AdminItemsRequest) returns(Response);
|
|
rpc AdminLogin(AdminLoginRequest) returns(Response);
|
|
} |