From 33ab76f73ed68b61c80facd49a999c01d257e44b Mon Sep 17 00:00:00 2001 From: oneao Date: Thu, 4 Dec 2025 21:48:22 +0800 Subject: [PATCH] u --- .../src/app/system/settings/index.tsx | 9 +- .../system/share/components/SpaceInvite.tsx | 128 ++++++++--- .../base-app/src/components/custom/Header.tsx | 2 +- .../base-app/src/request/index.ts | 4 +- .../base-app/src/types/space/spaceUser.ts | 11 - .../biz/handler/space/space_user_service.go | 78 +------ .../base-go-v3/biz/model/api/api.pb.go | 2 +- .../base-go-v3/biz/model/space/space.pb.go | 79 +++---- .../biz/model/space/space_types.pb.go | 2 +- .../biz/model/space/space_user_types.pb.go | 215 +++--------------- .../base-go-v3/biz/router/space/space.go | 1 - .../base-go-v3/idl/space/space.proto | 4 - .../idl/space/space_user_types.proto | 11 - 13 files changed, 172 insertions(+), 374 deletions(-) diff --git a/code/base-project/base-app/src/app/system/settings/index.tsx b/code/base-project/base-app/src/app/system/settings/index.tsx index 248bd74a..a96af01a 100644 --- a/code/base-project/base-app/src/app/system/settings/index.tsx +++ b/code/base-project/base-app/src/app/system/settings/index.tsx @@ -39,13 +39,6 @@ export default function Share() { - setShowExitModal(false)} - onClose={() => setShowExitModal(false)} - onConfirm={exitLogin} - /> - + ) } diff --git a/code/base-project/base-app/src/app/system/share/components/SpaceInvite.tsx b/code/base-project/base-app/src/app/system/share/components/SpaceInvite.tsx index 4392ed48..8d586a1e 100644 --- a/code/base-project/base-app/src/app/system/share/components/SpaceInvite.tsx +++ b/code/base-project/base-app/src/app/system/share/components/SpaceInvite.tsx @@ -1,10 +1,17 @@ import type { SpaceUser, UserSpace } from '@/types/space/spaceUser' import * as Clipboard from 'expo-clipboard' import { useState } from 'react' -import { FlatList, Pressable, TouchableOpacity, View } from 'react-native' +import { FlatList, TouchableHighlight, TouchableOpacity, View } from 'react-native' +import { + Menu, + MenuOption, + MenuOptions, + MenuTrigger, + renderers, +} from 'react-native-popup-menu' import QRCode from 'react-native-qrcode-svg' - import { AButton, ADivider, LucideIcon } from '@/components/common/ao' +import { AModal } from '@/components/common/ao/index' import { Accordion, AccordionContent, @@ -23,9 +30,9 @@ import { Badge, BadgeText } from '@/components/ui/badge' import { Heading } from '@/components/ui/heading' import { HStack } from '@/components/ui/hstack' import { ChevronDownIcon, ChevronUpIcon } from '@/components/ui/icon' -import { Menu, MenuItem, MenuItemLabel } from '@/components/ui/menu' import { Text } from '@/components/ui/text' import { VStack } from '@/components/ui/vstack' +import { exitSpaceApi } from '@/request/api/space/spaceUser' import { useUserStore } from '@/store/user' import { formatRelativeTime } from '@/utils/time' import { toast } from '@/utils/toast' @@ -41,6 +48,17 @@ export default function SpaceInvite({ }: SpaceInviteProps) { const userStore = useUserStore() + // 踢出 退出 解散 + const [modal, setModal] = useState<{ + open: boolean + title: string + type: 'exit' | 'remove' | 'dissolve' + }>({ + open: false, + title: '', + type: 'dissolve', + }) + , const [accordion, setAccordion] = useState(['a']) async function copyInviteCode() { @@ -51,6 +69,10 @@ export default function SpaceInvite({ }) } + function exitSpace() { + + } + return ( {item.username} - {[0, 1].includes(item.space_role) && ( + {item.space_role === 0 && ( - - {item.space_role === 0 ? '创建者' : '管理员'} - + 创建者 )} - { - (userStore.userInfo?.id === item.user_id) && ( - + userStore.userInfo?.id === item.user_id && ( + 我 ) } - {formatRelativeTime(item.active_time)} - - ( - + + + + + + + - - - )} - > - - 添加为管理员 - - - 移出空间 - - - + { + }} + > + + 授予管理员 + + + { + }} + > + + 踢出空间 + + + + + + )} + )} @@ -197,6 +249,14 @@ export default function SpaceInvite({ 退出该空间 + + setShowExitModal(false)} + onClose={() => setShowExitModal(false)} + onConfirm={exitLogin} + /> ) } diff --git a/code/base-project/base-app/src/components/custom/Header.tsx b/code/base-project/base-app/src/components/custom/Header.tsx index 09b7e1c5..dc83c0e2 100644 --- a/code/base-project/base-app/src/components/custom/Header.tsx +++ b/code/base-project/base-app/src/components/custom/Header.tsx @@ -61,7 +61,7 @@ export default function CustomHeader(props: CustomHeaderProps) { {...screenProps} options={{ ...screenProps?.options, - headerShown: false, + headerShown: true, header: () => ( space.CreateSpaceParams @@ -107,18 +98,16 @@ var file_space_proto_depIdxs = []int32{ 3, // 3: space.SpaceUserService.ExitSpace:input_type -> space.ExitSpaceParams 4, // 4: space.SpaceUserService.ListSpaceUsers:input_type -> space.ListSpaceUsersParams 5, // 5: space.SpaceUserService.RemoveSpaceUser:input_type -> space.RemoveSpaceUserParams - 6, // 6: space.SpaceUserService.UpdateSpaceUserRole:input_type -> space.UpdateSpaceUserRoleParams - 7, // 7: space.SpaceUserService.JoinSpace:input_type -> space.JoinSpaceParams - 0, // 8: space.SpaceService.CreateSpace:output_type -> space.CreateSpaceParams - 8, // 9: space.SpaceService.DissolveSpace:output_type -> space.DissolveSpaceResult - 9, // 10: space.SpaceUserService.getUserSpace:output_type -> space.GetUserSpaceResult - 10, // 11: space.SpaceUserService.ExitSpace:output_type -> space.ExitSpaceResult - 11, // 12: space.SpaceUserService.ListSpaceUsers:output_type -> space.ListSpaceUsersResult - 12, // 13: space.SpaceUserService.RemoveSpaceUser:output_type -> space.RemoveSpaceUserResult - 13, // 14: space.SpaceUserService.UpdateSpaceUserRole:output_type -> space.UpdateSpaceUserRoleResult - 14, // 15: space.SpaceUserService.JoinSpace:output_type -> space.JoinSpaceResult - 8, // [8:16] is the sub-list for method output_type - 0, // [0:8] is the sub-list for method input_type + 6, // 6: space.SpaceUserService.JoinSpace:input_type -> space.JoinSpaceParams + 0, // 7: space.SpaceService.CreateSpace:output_type -> space.CreateSpaceParams + 7, // 8: space.SpaceService.DissolveSpace:output_type -> space.DissolveSpaceResult + 8, // 9: space.SpaceUserService.getUserSpace:output_type -> space.GetUserSpaceResult + 9, // 10: space.SpaceUserService.ExitSpace:output_type -> space.ExitSpaceResult + 10, // 11: space.SpaceUserService.ListSpaceUsers:output_type -> space.ListSpaceUsersResult + 11, // 12: space.SpaceUserService.RemoveSpaceUser:output_type -> space.RemoveSpaceUserResult + 12, // 13: space.SpaceUserService.JoinSpace:output_type -> space.JoinSpaceResult + 7, // [7:14] is the sub-list for method output_type + 0, // [0:7] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/code/base-project/base-go-v3/biz/model/space/space_types.pb.go b/code/base-project/base-go-v3/biz/model/space/space_types.pb.go index 70ab913b..b0506d37 100644 --- a/code/base-project/base-go-v3/biz/model/space/space_types.pb.go +++ b/code/base-project/base-go-v3/biz/model/space/space_types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v4.25.3 +// protoc v6.33.1 // source: space/space_types.proto package space diff --git a/code/base-project/base-go-v3/biz/model/space/space_user_types.pb.go b/code/base-project/base-go-v3/biz/model/space/space_user_types.pb.go index 55934078..a5f3617f 100644 --- a/code/base-project/base-go-v3/biz/model/space/space_user_types.pb.go +++ b/code/base-project/base-go-v3/biz/model/space/space_user_types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v4.25.3 +// protoc v6.33.1 // source: space/space_user_types.proto package space @@ -435,108 +435,6 @@ func (*RemoveSpaceUserResult) Descriptor() ([]byte, []int) { return file_space_space_user_types_proto_rawDescGZIP(), []int{8} } -// 更新用户权限 -type UpdateSpaceUserRoleParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SpaceId int64 `protobuf:"varint,1,opt,name=SpaceId,proto3" form:"space_id" json:"space_id" vd:"$ != 0"` - UserId int64 `protobuf:"varint,2,opt,name=UserId,proto3" form:"user_id" json:"user_id" vd:"$ != 0"` - Role int32 `protobuf:"varint,3,opt,name=Role,proto3" form:"role" json:"role" vd:"$ == 1 || $ == 2"` -} - -func (x *UpdateSpaceUserRoleParams) Reset() { - *x = UpdateSpaceUserRoleParams{} - if protoimpl.UnsafeEnabled { - mi := &file_space_space_user_types_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSpaceUserRoleParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSpaceUserRoleParams) ProtoMessage() {} - -func (x *UpdateSpaceUserRoleParams) ProtoReflect() protoreflect.Message { - mi := &file_space_space_user_types_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateSpaceUserRoleParams.ProtoReflect.Descriptor instead. -func (*UpdateSpaceUserRoleParams) Descriptor() ([]byte, []int) { - return file_space_space_user_types_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateSpaceUserRoleParams) GetSpaceId() int64 { - if x != nil { - return x.SpaceId - } - return 0 -} - -func (x *UpdateSpaceUserRoleParams) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UpdateSpaceUserRoleParams) GetRole() int32 { - if x != nil { - return x.Role - } - return 0 -} - -type UpdateSpaceUserRoleResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateSpaceUserRoleResult) Reset() { - *x = UpdateSpaceUserRoleResult{} - if protoimpl.UnsafeEnabled { - mi := &file_space_space_user_types_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSpaceUserRoleResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSpaceUserRoleResult) ProtoMessage() {} - -func (x *UpdateSpaceUserRoleResult) ProtoReflect() protoreflect.Message { - mi := &file_space_space_user_types_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateSpaceUserRoleResult.ProtoReflect.Descriptor instead. -func (*UpdateSpaceUserRoleResult) Descriptor() ([]byte, []int) { - return file_space_space_user_types_proto_rawDescGZIP(), []int{10} -} - // 获取当前用户的空间信息 type GetUserSpaceParams struct { state protoimpl.MessageState @@ -547,7 +445,7 @@ type GetUserSpaceParams struct { func (x *GetUserSpaceParams) Reset() { *x = GetUserSpaceParams{} if protoimpl.UnsafeEnabled { - mi := &file_space_space_user_types_proto_msgTypes[11] + mi := &file_space_space_user_types_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -560,7 +458,7 @@ func (x *GetUserSpaceParams) String() string { func (*GetUserSpaceParams) ProtoMessage() {} func (x *GetUserSpaceParams) ProtoReflect() protoreflect.Message { - mi := &file_space_space_user_types_proto_msgTypes[11] + mi := &file_space_space_user_types_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -573,7 +471,7 @@ func (x *GetUserSpaceParams) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSpaceParams.ProtoReflect.Descriptor instead. func (*GetUserSpaceParams) Descriptor() ([]byte, []int) { - return file_space_space_user_types_proto_rawDescGZIP(), []int{11} + return file_space_space_user_types_proto_rawDescGZIP(), []int{9} } type GetUserSpaceResult struct { @@ -590,7 +488,7 @@ type GetUserSpaceResult struct { func (x *GetUserSpaceResult) Reset() { *x = GetUserSpaceResult{} if protoimpl.UnsafeEnabled { - mi := &file_space_space_user_types_proto_msgTypes[12] + mi := &file_space_space_user_types_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -603,7 +501,7 @@ func (x *GetUserSpaceResult) String() string { func (*GetUserSpaceResult) ProtoMessage() {} func (x *GetUserSpaceResult) ProtoReflect() protoreflect.Message { - mi := &file_space_space_user_types_proto_msgTypes[12] + mi := &file_space_space_user_types_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -616,7 +514,7 @@ func (x *GetUserSpaceResult) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSpaceResult.ProtoReflect.Descriptor instead. func (*GetUserSpaceResult) Descriptor() ([]byte, []int) { - return file_space_space_user_types_proto_rawDescGZIP(), []int{12} + return file_space_space_user_types_proto_rawDescGZIP(), []int{10} } func (x *GetUserSpaceResult) GetSpaceId() int64 { @@ -688,35 +586,22 @@ var file_space_space_user_types_proto_rawDesc = []byte{ 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0xae, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, - 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x16, - 0xca, 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, - 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x2d, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, - 0x15, 0xca, 0xbb, 0x18, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0xda, 0xbb, 0x18, 0x06, - 0x24, 0x20, 0x21, 0x3d, 0x20, 0x30, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, - 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x1c, 0xca, 0xbb, - 0x18, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0xda, 0xbb, 0x18, 0x10, 0x24, 0x20, 0x3d, 0x3d, 0x20, 0x31, - 0x20, 0x7c, 0x7c, 0x20, 0x24, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x52, 0x04, 0x52, 0x6f, 0x6c, 0x65, - 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x14, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, 0xbb, 0x18, - 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xca, 0xbb, 0x18, 0x0a, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x2f, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0xca, 0xbb, 0x18, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, - 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, - 0x08, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x42, - 0x22, 0x5a, 0x20, 0x63, 0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x2f, 0x62, 0x61, 0x73, 0x65, - 0x2d, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x70, 0x61, 0x63, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x07, + 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, 0xca, + 0xbb, 0x18, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x52, 0x07, 0x53, 0x70, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xca, 0xbb, 0x18, 0x0a, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0xca, 0xbb, 0x18, 0x0b, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x42, 0x08, 0xca, 0xbb, 0x18, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x52, 0x6f, 0x6c, + 0x65, 0x42, 0x22, 0x5a, 0x20, 0x63, 0x6e, 0x2f, 0x6f, 0x6e, 0x65, 0x61, 0x6f, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -731,21 +616,19 @@ func file_space_space_user_types_proto_rawDescGZIP() []byte { return file_space_space_user_types_proto_rawDescData } -var file_space_space_user_types_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_space_space_user_types_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_space_space_user_types_proto_goTypes = []interface{}{ - (*ListSpaceUsersParams)(nil), // 0: space.ListSpaceUsersParams - (*SpaceUser)(nil), // 1: space.SpaceUser - (*ListSpaceUsersResult)(nil), // 2: space.ListSpaceUsersResult - (*JoinSpaceParams)(nil), // 3: space.JoinSpaceParams - (*JoinSpaceResult)(nil), // 4: space.JoinSpaceResult - (*ExitSpaceParams)(nil), // 5: space.ExitSpaceParams - (*ExitSpaceResult)(nil), // 6: space.ExitSpaceResult - (*RemoveSpaceUserParams)(nil), // 7: space.RemoveSpaceUserParams - (*RemoveSpaceUserResult)(nil), // 8: space.RemoveSpaceUserResult - (*UpdateSpaceUserRoleParams)(nil), // 9: space.UpdateSpaceUserRoleParams - (*UpdateSpaceUserRoleResult)(nil), // 10: space.UpdateSpaceUserRoleResult - (*GetUserSpaceParams)(nil), // 11: space.GetUserSpaceParams - (*GetUserSpaceResult)(nil), // 12: space.GetUserSpaceResult + (*ListSpaceUsersParams)(nil), // 0: space.ListSpaceUsersParams + (*SpaceUser)(nil), // 1: space.SpaceUser + (*ListSpaceUsersResult)(nil), // 2: space.ListSpaceUsersResult + (*JoinSpaceParams)(nil), // 3: space.JoinSpaceParams + (*JoinSpaceResult)(nil), // 4: space.JoinSpaceResult + (*ExitSpaceParams)(nil), // 5: space.ExitSpaceParams + (*ExitSpaceResult)(nil), // 6: space.ExitSpaceResult + (*RemoveSpaceUserParams)(nil), // 7: space.RemoveSpaceUserParams + (*RemoveSpaceUserResult)(nil), // 8: space.RemoveSpaceUserResult + (*GetUserSpaceParams)(nil), // 9: space.GetUserSpaceParams + (*GetUserSpaceResult)(nil), // 10: space.GetUserSpaceResult } var file_space_space_user_types_proto_depIdxs = []int32{ 1, // 0: space.ListSpaceUsersResult.users:type_name -> space.SpaceUser @@ -871,30 +754,6 @@ func file_space_space_user_types_proto_init() { } } file_space_space_user_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSpaceUserRoleParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_space_space_user_types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSpaceUserRoleResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_space_space_user_types_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetUserSpaceParams); i { case 0: return &v.state @@ -906,7 +765,7 @@ func file_space_space_user_types_proto_init() { return nil } } - file_space_space_user_types_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_space_space_user_types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetUserSpaceResult); i { case 0: return &v.state @@ -925,7 +784,7 @@ func file_space_space_user_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_space_space_user_types_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/code/base-project/base-go-v3/biz/router/space/space.go b/code/base-project/base-go-v3/biz/router/space/space.go index fe223aa8..ae5bcb86 100644 --- a/code/base-project/base-go-v3/biz/router/space/space.go +++ b/code/base-project/base-go-v3/biz/router/space/space.go @@ -28,7 +28,6 @@ func Register(r *server.Hertz) { _user.POST("/join", append(_joinspaceMw(), space.JoinSpace)...) _user.POST("/list", append(_listspaceusersMw(), space.ListSpaceUsers)...) _user.POST("/remove", append(_removespaceuserMw(), space.RemoveSpaceUser)...) - _user.POST("/updateRole", append(_updatespaceuserroleMw(), space.UpdateSpaceUserRole)...) } } } diff --git a/code/base-project/base-go-v3/idl/space/space.proto b/code/base-project/base-go-v3/idl/space/space.proto index 5a576f4c..f5d584df 100644 --- a/code/base-project/base-go-v3/idl/space/space.proto +++ b/code/base-project/base-go-v3/idl/space/space.proto @@ -36,10 +36,6 @@ service SpaceUserService{ rpc RemoveSpaceUser(RemoveSpaceUserParams) returns (RemoveSpaceUserResult){ option (api.post) = '/space/user/remove'; }; - // 更新用户权限 - rpc UpdateSpaceUserRole(UpdateSpaceUserRoleParams) returns (UpdateSpaceUserRoleResult){ - option (api.post) = '/space/user/updateRole'; - }; // 加入空间 rpc JoinSpace(JoinSpaceParams) returns (JoinSpaceResult) { option (api.post) = "/space/user/join"; diff --git a/code/base-project/base-go-v3/idl/space/space_user_types.proto b/code/base-project/base-go-v3/idl/space/space_user_types.proto index 17e395c6..634df8ad 100644 --- a/code/base-project/base-go-v3/idl/space/space_user_types.proto +++ b/code/base-project/base-go-v3/idl/space/space_user_types.proto @@ -48,17 +48,6 @@ 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{ - -} - // 获取当前用户的空间信息 message GetUserSpaceParams{