u
This commit is contained in:
1 parent
f7b0c6ad2f
commit
e81f605999
23 files changed
+1286
-413
No files matched your search
File renamed without changes.
@@ -7,10 +7,31 @@ option go_package = "space";
|
||||
import "api.proto";
|
||||
|
||||
import "space/space_types.proto";
|
||||
//import "space/space_user_types.proto";
|
||||
import "space/space_user_types.proto";
|
||||
|
||||
service SpaceService {
|
||||
rpc InsertSpace(InsertSpaceParams) returns (InsertSpaceResult){
|
||||
option (api.post) = '/space/insert';
|
||||
};
|
||||
|
||||
rpc DeleteSpace(DeleteSpaceParams) returns (DeleteSpaceResult){
|
||||
option (api.post) = '/space/delete';
|
||||
};
|
||||
}
|
||||
|
||||
service SpaceUserService{
|
||||
rpc ExitSpace(ExitSpaceParams) returns (ExitSpaceResult){
|
||||
option (api.post) = '/space_user/exit';
|
||||
};
|
||||
rpc ListSpaceUsers(ListSpaceUsersParams) returns (ListSpaceUsersResult){
|
||||
option (api.post) = '/space_user/list';
|
||||
};
|
||||
// 踢出某人
|
||||
rpc RemoveSpaceUser(RemoveSpaceUserParams) returns (RemoveSpaceUserResult){
|
||||
option (api.post) = '/space_user/remove';
|
||||
};
|
||||
// 更新用户权限
|
||||
rpc UpdateSpaceUserRole(UpdateSpaceUserRoleParams) returns (UpdateSpaceUserRoleResult){
|
||||
option (api.post) = '/space_user/updateRole';
|
||||
};
|
||||
}
|
||||
@@ -24,16 +24,3 @@ message DeleteSpaceParams {
|
||||
message DeleteSpaceResult {
|
||||
|
||||
}
|
||||
|
||||
// 获取空间下的所有用户
|
||||
message QuerySpaceUsersParams{
|
||||
int64 SpaceId = 1 [(api.body)="space_id", (api.vd)="$ != 0"];
|
||||
}
|
||||
|
||||
message SpaceUser {
|
||||
|
||||
}
|
||||
|
||||
message QuerySpaceUsersResult{
|
||||
|
||||
}
|
||||
@@ -5,13 +5,57 @@ package space;
|
||||
option go_package = "space";
|
||||
|
||||
import "api.proto";
|
||||
// 获取空间下的成员
|
||||
message ListSpaceUsersParams {
|
||||
int64 SpaceId = 1 [(api.body)="space_id",(api.vd)="$ != 0"];
|
||||
}
|
||||
|
||||
message SpaceUser {
|
||||
int64 UserId = 1 [(api.body)="user_id"];
|
||||
string Username = 2 [(api.body)="username"];
|
||||
int32 SpaceRole = 4 [(api.body)="space_role"];
|
||||
}
|
||||
|
||||
message ListSpaceUsersResult {
|
||||
repeated SpaceUser users = 1;
|
||||
}
|
||||
|
||||
// 加入空间
|
||||
message InsertSpaceUserParams {
|
||||
message JoinSpaceParams {
|
||||
int64 InviteCode = 1 [(api.body)="invite_code"]; // 邀请码
|
||||
}
|
||||
|
||||
message InsertSpaceUserResult {
|
||||
message JoinSpaceResult {
|
||||
int64 SpaceId = 1 [(api.body)="space_id"];
|
||||
string InviteCode = 2 [(api.body)="invite_code"];
|
||||
}
|
||||
|
||||
// 退出空间
|
||||
message ExitSpaceParams {
|
||||
|
||||
}
|
||||
|
||||
message ExitSpaceResult {
|
||||
|
||||
}
|
||||
|
||||
// 踢出成员
|
||||
message RemoveSpaceUserParams {
|
||||
int64 SpaceId = 1 [(api.body) = "space_id",(api.vd)="$ != 0"];
|
||||
int64 UserId = 2 [(api.body) = "user_id",(api.vd)="$ != 0"];
|
||||
}
|
||||
|
||||
message RemoveSpaceUserResult {
|
||||
|
||||
}
|
||||
|
||||
// 更新用户权限
|
||||
message UpdateSpaceUserRoleParams {
|
||||
int64 SpaceId = 1[(api.body) = "space_id",(api.vd)="$ != 0"];
|
||||
int64 UserId = 2[(api.body) = "user_id",(api.vd)="$ != 0"];
|
||||
int32 Role = 3 [(api.body) = "role", (api.vd) = "$ == 1 || $ == 2"];
|
||||
}
|
||||
|
||||
message UpdateSpaceUserRoleResult{
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user