From cb46385644a800b8b1f80d8de5de8c909de4fe04 Mon Sep 17 00:00:00 2001 From: Yavolte Date: Wed, 18 Jun 2025 15:42:20 +0800 Subject: [PATCH] update proto --- pb/organize.pb.go | 785 ++++++++++--------------------------- pb/organize.pb.validate.go | 600 ---------------------------- pb/organize.proto | 47 --- pb/organize_grpc.pb.go | 102 ----- pb/organize_http.pb.go | 29 +- pb/organize_model.pb.go | 293 ++++---------- pb/system.pb.go | 440 +++++++++++++++++++++ pb/system.pb.validate.go | 636 ++++++++++++++++++++++++++++++ pb/system.proto | 59 +++ pb/system_grpc.pb.go | 121 ++++++ pb/system_http.pb.go | 38 ++ pb/system_model.pb.go | 142 +++++++ service/auth.go | 2 +- 13 files changed, 1730 insertions(+), 1564 deletions(-) create mode 100644 pb/system.pb.go create mode 100644 pb/system.pb.validate.go create mode 100644 pb/system.proto create mode 100644 pb/system_grpc.pb.go create mode 100644 pb/system_http.pb.go create mode 100644 pb/system_model.pb.go diff --git a/pb/organize.pb.go b/pb/organize.pb.go index 3f10d6b..123eb84 100644 --- a/pb/organize.pb.go +++ b/pb/organize.pb.go @@ -747,184 +747,6 @@ func (x *Login) GetUserAgent() string { return "" } -// Setting 参数设置表 -type Setting struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Setting) Reset() { - *x = Setting{} - mi := &file_organize_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Setting) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Setting) ProtoMessage() {} - -func (x *Setting) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Setting.ProtoReflect.Descriptor instead. -func (*Setting) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{7} -} - -func (x *Setting) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Setting) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - -func (x *Setting) GetUpdatedAt() int64 { - if x != nil { - return x.UpdatedAt - } - return 0 -} - -func (x *Setting) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Setting) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Setting) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -// Activity 活动记录 -type Activity struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` - Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` - Module string `protobuf:"bytes,5,opt,name=module,proto3" json:"module,omitempty"` - Table string `protobuf:"bytes,6,opt,name=table,proto3" json:"table,omitempty"` - Data string `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Activity) Reset() { - *x = Activity{} - mi := &file_organize_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Activity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Activity) ProtoMessage() {} - -func (x *Activity) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Activity.ProtoReflect.Descriptor instead. -func (*Activity) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{8} -} - -func (x *Activity) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Activity) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - -func (x *Activity) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *Activity) GetAction() string { - if x != nil { - return x.Action - } - return "" -} - -func (x *Activity) GetModule() string { - if x != nil { - return x.Module - } - return "" -} - -func (x *Activity) GetTable() string { - if x != nil { - return x.Table - } - return "" -} - -func (x *Activity) GetData() string { - if x != nil { - return x.Data - } - return "" -} - type LabelValue struct { state protoimpl.MessageState `protogen:"open.v1"` Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` @@ -935,7 +757,7 @@ type LabelValue struct { func (x *LabelValue) Reset() { *x = LabelValue{} - mi := &file_organize_proto_msgTypes[9] + mi := &file_organize_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -947,7 +769,7 @@ func (x *LabelValue) String() string { func (*LabelValue) ProtoMessage() {} func (x *LabelValue) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[9] + mi := &file_organize_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -960,7 +782,7 @@ func (x *LabelValue) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelValue.ProtoReflect.Descriptor instead. func (*LabelValue) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{9} + return file_organize_proto_rawDescGZIP(), []int{7} } func (x *LabelValue) GetLabel() string { @@ -987,7 +809,7 @@ type PermissionItem struct { func (x *PermissionItem) Reset() { *x = PermissionItem{} - mi := &file_organize_proto_msgTypes[10] + mi := &file_organize_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -999,7 +821,7 @@ func (x *PermissionItem) String() string { func (*PermissionItem) ProtoMessage() {} func (x *PermissionItem) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[10] + mi := &file_organize_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1012,7 +834,7 @@ func (x *PermissionItem) ProtoReflect() protoreflect.Message { // Deprecated: Use PermissionItem.ProtoReflect.Descriptor instead. func (*PermissionItem) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{10} + return file_organize_proto_rawDescGZIP(), []int{8} } func (x *PermissionItem) GetValue() string { @@ -1047,7 +869,7 @@ type MenuItem struct { func (x *MenuItem) Reset() { *x = MenuItem{} - mi := &file_organize_proto_msgTypes[11] + mi := &file_organize_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1059,7 +881,7 @@ func (x *MenuItem) String() string { func (*MenuItem) ProtoMessage() {} func (x *MenuItem) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[11] + mi := &file_organize_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1072,7 +894,7 @@ func (x *MenuItem) ProtoReflect() protoreflect.Message { // Deprecated: Use MenuItem.ProtoReflect.Descriptor instead. func (*MenuItem) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{11} + return file_organize_proto_rawDescGZIP(), []int{9} } func (x *MenuItem) GetLabel() string { @@ -1148,7 +970,7 @@ type GetMenuRequest struct { func (x *GetMenuRequest) Reset() { *x = GetMenuRequest{} - mi := &file_organize_proto_msgTypes[12] + mi := &file_organize_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1160,7 +982,7 @@ func (x *GetMenuRequest) String() string { func (*GetMenuRequest) ProtoMessage() {} func (x *GetMenuRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[12] + mi := &file_organize_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1173,7 +995,7 @@ func (x *GetMenuRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenuRequest.ProtoReflect.Descriptor instead. func (*GetMenuRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{12} + return file_organize_proto_rawDescGZIP(), []int{10} } func (x *GetMenuRequest) GetPermission() bool { @@ -1193,7 +1015,7 @@ type GetMenuResponse struct { func (x *GetMenuResponse) Reset() { *x = GetMenuResponse{} - mi := &file_organize_proto_msgTypes[13] + mi := &file_organize_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1205,7 +1027,7 @@ func (x *GetMenuResponse) String() string { func (*GetMenuResponse) ProtoMessage() {} func (x *GetMenuResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[13] + mi := &file_organize_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1218,7 +1040,7 @@ func (x *GetMenuResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenuResponse.ProtoReflect.Descriptor instead. func (*GetMenuResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{13} + return file_organize_proto_rawDescGZIP(), []int{11} } func (x *GetMenuResponse) GetData() []*MenuItem { @@ -1238,7 +1060,7 @@ type GetProfileRequest struct { func (x *GetProfileRequest) Reset() { *x = GetProfileRequest{} - mi := &file_organize_proto_msgTypes[14] + mi := &file_organize_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1250,7 +1072,7 @@ func (x *GetProfileRequest) String() string { func (*GetProfileRequest) ProtoMessage() {} func (x *GetProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[14] + mi := &file_organize_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1263,7 +1085,7 @@ func (x *GetProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead. func (*GetProfileRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{14} + return file_organize_proto_rawDescGZIP(), []int{12} } func (x *GetProfileRequest) GetUid() string { @@ -1289,7 +1111,7 @@ type GetProfileResponse struct { func (x *GetProfileResponse) Reset() { *x = GetProfileResponse{} - mi := &file_organize_proto_msgTypes[15] + mi := &file_organize_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1123,7 @@ func (x *GetProfileResponse) String() string { func (*GetProfileResponse) ProtoMessage() {} func (x *GetProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[15] + mi := &file_organize_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1136,7 @@ func (x *GetProfileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetProfileResponse.ProtoReflect.Descriptor instead. func (*GetProfileResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{15} + return file_organize_proto_rawDescGZIP(), []int{13} } func (x *GetProfileResponse) GetUid() string { @@ -1377,7 +1199,7 @@ type ResetPasswordRequest struct { func (x *ResetPasswordRequest) Reset() { *x = ResetPasswordRequest{} - mi := &file_organize_proto_msgTypes[16] + mi := &file_organize_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1389,7 +1211,7 @@ func (x *ResetPasswordRequest) String() string { func (*ResetPasswordRequest) ProtoMessage() {} func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[16] + mi := &file_organize_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1402,7 +1224,7 @@ func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead. func (*ResetPasswordRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{16} + return file_organize_proto_rawDescGZIP(), []int{14} } func (x *ResetPasswordRequest) GetUid() string { @@ -1435,7 +1257,7 @@ type ResetPasswordResponse struct { func (x *ResetPasswordResponse) Reset() { *x = ResetPasswordResponse{} - mi := &file_organize_proto_msgTypes[17] + mi := &file_organize_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1447,7 +1269,7 @@ func (x *ResetPasswordResponse) String() string { func (*ResetPasswordResponse) ProtoMessage() {} func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[17] + mi := &file_organize_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1460,7 +1282,7 @@ func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead. func (*ResetPasswordResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{17} + return file_organize_proto_rawDescGZIP(), []int{15} } func (x *ResetPasswordResponse) GetUid() string { @@ -1483,7 +1305,7 @@ type UpdateProfileRequest struct { func (x *UpdateProfileRequest) Reset() { *x = UpdateProfileRequest{} - mi := &file_organize_proto_msgTypes[18] + mi := &file_organize_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1495,7 +1317,7 @@ func (x *UpdateProfileRequest) String() string { func (*UpdateProfileRequest) ProtoMessage() {} func (x *UpdateProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[18] + mi := &file_organize_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1508,7 +1330,7 @@ func (x *UpdateProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateProfileRequest.ProtoReflect.Descriptor instead. func (*UpdateProfileRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{18} + return file_organize_proto_rawDescGZIP(), []int{16} } func (x *UpdateProfileRequest) GetUid() string { @@ -1555,7 +1377,7 @@ type UpdateProfileResponse struct { func (x *UpdateProfileResponse) Reset() { *x = UpdateProfileResponse{} - mi := &file_organize_proto_msgTypes[19] + mi := &file_organize_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1567,7 +1389,7 @@ func (x *UpdateProfileResponse) String() string { func (*UpdateProfileResponse) ProtoMessage() {} func (x *UpdateProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[19] + mi := &file_organize_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1580,7 +1402,7 @@ func (x *UpdateProfileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateProfileResponse.ProtoReflect.Descriptor instead. func (*UpdateProfileResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{19} + return file_organize_proto_rawDescGZIP(), []int{17} } func (x *UpdateProfileResponse) GetUid() string { @@ -1599,7 +1421,7 @@ type GetPermissionRequest struct { func (x *GetPermissionRequest) Reset() { *x = GetPermissionRequest{} - mi := &file_organize_proto_msgTypes[20] + mi := &file_organize_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1611,7 +1433,7 @@ func (x *GetPermissionRequest) String() string { func (*GetPermissionRequest) ProtoMessage() {} func (x *GetPermissionRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[20] + mi := &file_organize_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1624,7 +1446,7 @@ func (x *GetPermissionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetPermissionRequest.ProtoReflect.Descriptor instead. func (*GetPermissionRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{20} + return file_organize_proto_rawDescGZIP(), []int{18} } func (x *GetPermissionRequest) GetUid() string { @@ -1644,7 +1466,7 @@ type GetPermissionResponse struct { func (x *GetPermissionResponse) Reset() { *x = GetPermissionResponse{} - mi := &file_organize_proto_msgTypes[21] + mi := &file_organize_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1656,7 +1478,7 @@ func (x *GetPermissionResponse) String() string { func (*GetPermissionResponse) ProtoMessage() {} func (x *GetPermissionResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[21] + mi := &file_organize_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1669,7 +1491,7 @@ func (x *GetPermissionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetPermissionResponse.ProtoReflect.Descriptor instead. func (*GetPermissionResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{21} + return file_organize_proto_rawDescGZIP(), []int{19} } func (x *GetPermissionResponse) GetUid() string { @@ -1694,7 +1516,7 @@ type GetUserLabelRequest struct { func (x *GetUserLabelRequest) Reset() { *x = GetUserLabelRequest{} - mi := &file_organize_proto_msgTypes[22] + mi := &file_organize_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1706,7 +1528,7 @@ func (x *GetUserLabelRequest) String() string { func (*GetUserLabelRequest) ProtoMessage() {} func (x *GetUserLabelRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[22] + mi := &file_organize_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1719,7 +1541,7 @@ func (x *GetUserLabelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserLabelRequest.ProtoReflect.Descriptor instead. func (*GetUserLabelRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{22} + return file_organize_proto_rawDescGZIP(), []int{20} } type GetUserLabelResponse struct { @@ -1731,7 +1553,7 @@ type GetUserLabelResponse struct { func (x *GetUserLabelResponse) Reset() { *x = GetUserLabelResponse{} - mi := &file_organize_proto_msgTypes[23] + mi := &file_organize_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1743,7 +1565,7 @@ func (x *GetUserLabelResponse) String() string { func (*GetUserLabelResponse) ProtoMessage() {} func (x *GetUserLabelResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[23] + mi := &file_organize_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1756,7 +1578,7 @@ func (x *GetUserLabelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserLabelResponse.ProtoReflect.Descriptor instead. func (*GetUserLabelResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{23} + return file_organize_proto_rawDescGZIP(), []int{21} } func (x *GetUserLabelResponse) GetData() []*LabelValue { @@ -1774,7 +1596,7 @@ type GetUserTagRequest struct { func (x *GetUserTagRequest) Reset() { *x = GetUserTagRequest{} - mi := &file_organize_proto_msgTypes[24] + mi := &file_organize_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1786,7 +1608,7 @@ func (x *GetUserTagRequest) String() string { func (*GetUserTagRequest) ProtoMessage() {} func (x *GetUserTagRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[24] + mi := &file_organize_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1799,7 +1621,7 @@ func (x *GetUserTagRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserTagRequest.ProtoReflect.Descriptor instead. func (*GetUserTagRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{24} + return file_organize_proto_rawDescGZIP(), []int{22} } type GetUserTagResponse struct { @@ -1811,7 +1633,7 @@ type GetUserTagResponse struct { func (x *GetUserTagResponse) Reset() { *x = GetUserTagResponse{} - mi := &file_organize_proto_msgTypes[25] + mi := &file_organize_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1823,7 +1645,7 @@ func (x *GetUserTagResponse) String() string { func (*GetUserTagResponse) ProtoMessage() {} func (x *GetUserTagResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[25] + mi := &file_organize_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1836,7 +1658,7 @@ func (x *GetUserTagResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserTagResponse.ProtoReflect.Descriptor instead. func (*GetUserTagResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{25} + return file_organize_proto_rawDescGZIP(), []int{23} } func (x *GetUserTagResponse) GetData() []*LabelValue { @@ -1856,7 +1678,7 @@ type DepartmentLabelValue struct { func (x *DepartmentLabelValue) Reset() { *x = DepartmentLabelValue{} - mi := &file_organize_proto_msgTypes[26] + mi := &file_organize_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1868,7 +1690,7 @@ func (x *DepartmentLabelValue) String() string { func (*DepartmentLabelValue) ProtoMessage() {} func (x *DepartmentLabelValue) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[26] + mi := &file_organize_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1881,7 +1703,7 @@ func (x *DepartmentLabelValue) ProtoReflect() protoreflect.Message { // Deprecated: Use DepartmentLabelValue.ProtoReflect.Descriptor instead. func (*DepartmentLabelValue) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{26} + return file_organize_proto_rawDescGZIP(), []int{24} } func (x *DepartmentLabelValue) GetLabel() string { @@ -1910,7 +1732,7 @@ type DepartmentUserValue struct { func (x *DepartmentUserValue) Reset() { *x = DepartmentUserValue{} - mi := &file_organize_proto_msgTypes[27] + mi := &file_organize_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1922,7 +1744,7 @@ func (x *DepartmentUserValue) String() string { func (*DepartmentUserValue) ProtoMessage() {} func (x *DepartmentUserValue) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[27] + mi := &file_organize_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1935,7 +1757,7 @@ func (x *DepartmentUserValue) ProtoReflect() protoreflect.Message { // Deprecated: Use DepartmentUserValue.ProtoReflect.Descriptor instead. func (*DepartmentUserValue) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{27} + return file_organize_proto_rawDescGZIP(), []int{25} } func (x *DepartmentUserValue) GetLabel() string { @@ -1974,7 +1796,7 @@ type GetDepartmentLabelRequest struct { func (x *GetDepartmentLabelRequest) Reset() { *x = GetDepartmentLabelRequest{} - mi := &file_organize_proto_msgTypes[28] + mi := &file_organize_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1986,7 +1808,7 @@ func (x *GetDepartmentLabelRequest) String() string { func (*GetDepartmentLabelRequest) ProtoMessage() {} func (x *GetDepartmentLabelRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[28] + mi := &file_organize_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1999,7 +1821,7 @@ func (x *GetDepartmentLabelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentLabelRequest.ProtoReflect.Descriptor instead. func (*GetDepartmentLabelRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{28} + return file_organize_proto_rawDescGZIP(), []int{26} } type GetDepartmentLabelResponse struct { @@ -2011,7 +1833,7 @@ type GetDepartmentLabelResponse struct { func (x *GetDepartmentLabelResponse) Reset() { *x = GetDepartmentLabelResponse{} - mi := &file_organize_proto_msgTypes[29] + mi := &file_organize_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2023,7 +1845,7 @@ func (x *GetDepartmentLabelResponse) String() string { func (*GetDepartmentLabelResponse) ProtoMessage() {} func (x *GetDepartmentLabelResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[29] + mi := &file_organize_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2036,7 +1858,7 @@ func (x *GetDepartmentLabelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentLabelResponse.ProtoReflect.Descriptor instead. func (*GetDepartmentLabelResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{29} + return file_organize_proto_rawDescGZIP(), []int{27} } func (x *GetDepartmentLabelResponse) GetData() []*DepartmentLabelValue { @@ -2054,7 +1876,7 @@ type GetDepartmentUserRequest struct { func (x *GetDepartmentUserRequest) Reset() { *x = GetDepartmentUserRequest{} - mi := &file_organize_proto_msgTypes[30] + mi := &file_organize_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2066,7 +1888,7 @@ func (x *GetDepartmentUserRequest) String() string { func (*GetDepartmentUserRequest) ProtoMessage() {} func (x *GetDepartmentUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[30] + mi := &file_organize_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2079,7 +1901,7 @@ func (x *GetDepartmentUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentUserRequest.ProtoReflect.Descriptor instead. func (*GetDepartmentUserRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{30} + return file_organize_proto_rawDescGZIP(), []int{28} } type GetDepartmentUserResponse struct { @@ -2091,7 +1913,7 @@ type GetDepartmentUserResponse struct { func (x *GetDepartmentUserResponse) Reset() { *x = GetDepartmentUserResponse{} - mi := &file_organize_proto_msgTypes[31] + mi := &file_organize_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2103,7 +1925,7 @@ func (x *GetDepartmentUserResponse) String() string { func (*GetDepartmentUserResponse) ProtoMessage() {} func (x *GetDepartmentUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[31] + mi := &file_organize_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2116,7 +1938,7 @@ func (x *GetDepartmentUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentUserResponse.ProtoReflect.Descriptor instead. func (*GetDepartmentUserResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{31} + return file_organize_proto_rawDescGZIP(), []int{29} } func (x *GetDepartmentUserResponse) GetData() []*DepartmentUserValue { @@ -2137,7 +1959,7 @@ type DepartmentLevelValue struct { func (x *DepartmentLevelValue) Reset() { *x = DepartmentLevelValue{} - mi := &file_organize_proto_msgTypes[32] + mi := &file_organize_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2149,7 +1971,7 @@ func (x *DepartmentLevelValue) String() string { func (*DepartmentLevelValue) ProtoMessage() {} func (x *DepartmentLevelValue) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[32] + mi := &file_organize_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2162,7 +1984,7 @@ func (x *DepartmentLevelValue) ProtoReflect() protoreflect.Message { // Deprecated: Use DepartmentLevelValue.ProtoReflect.Descriptor instead. func (*DepartmentLevelValue) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{32} + return file_organize_proto_rawDescGZIP(), []int{30} } func (x *DepartmentLevelValue) GetLabel() string { @@ -2194,7 +2016,7 @@ type GetDepartmentLevelLabelsRequest struct { func (x *GetDepartmentLevelLabelsRequest) Reset() { *x = GetDepartmentLevelLabelsRequest{} - mi := &file_organize_proto_msgTypes[33] + mi := &file_organize_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2206,7 +2028,7 @@ func (x *GetDepartmentLevelLabelsRequest) String() string { func (*GetDepartmentLevelLabelsRequest) ProtoMessage() {} func (x *GetDepartmentLevelLabelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[33] + mi := &file_organize_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2219,7 +2041,7 @@ func (x *GetDepartmentLevelLabelsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentLevelLabelsRequest.ProtoReflect.Descriptor instead. func (*GetDepartmentLevelLabelsRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{33} + return file_organize_proto_rawDescGZIP(), []int{31} } type GetDepartmentLevelLabelsResponse struct { @@ -2231,7 +2053,7 @@ type GetDepartmentLevelLabelsResponse struct { func (x *GetDepartmentLevelLabelsResponse) Reset() { *x = GetDepartmentLevelLabelsResponse{} - mi := &file_organize_proto_msgTypes[34] + mi := &file_organize_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2243,7 +2065,7 @@ func (x *GetDepartmentLevelLabelsResponse) String() string { func (*GetDepartmentLevelLabelsResponse) ProtoMessage() {} func (x *GetDepartmentLevelLabelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[34] + mi := &file_organize_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2256,7 +2078,7 @@ func (x *GetDepartmentLevelLabelsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDepartmentLevelLabelsResponse.ProtoReflect.Descriptor instead. func (*GetDepartmentLevelLabelsResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{34} + return file_organize_proto_rawDescGZIP(), []int{32} } func (x *GetDepartmentLevelLabelsResponse) GetData() []*DepartmentLevelValue { @@ -2274,7 +2096,7 @@ type GetRoleLabelRequest struct { func (x *GetRoleLabelRequest) Reset() { *x = GetRoleLabelRequest{} - mi := &file_organize_proto_msgTypes[35] + mi := &file_organize_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2286,7 +2108,7 @@ func (x *GetRoleLabelRequest) String() string { func (*GetRoleLabelRequest) ProtoMessage() {} func (x *GetRoleLabelRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[35] + mi := &file_organize_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2299,7 +2121,7 @@ func (x *GetRoleLabelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRoleLabelRequest.ProtoReflect.Descriptor instead. func (*GetRoleLabelRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{35} + return file_organize_proto_rawDescGZIP(), []int{33} } type GetRoleLabelResponse struct { @@ -2311,7 +2133,7 @@ type GetRoleLabelResponse struct { func (x *GetRoleLabelResponse) Reset() { *x = GetRoleLabelResponse{} - mi := &file_organize_proto_msgTypes[36] + mi := &file_organize_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2323,7 +2145,7 @@ func (x *GetRoleLabelResponse) String() string { func (*GetRoleLabelResponse) ProtoMessage() {} func (x *GetRoleLabelResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[36] + mi := &file_organize_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2336,7 +2158,7 @@ func (x *GetRoleLabelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRoleLabelResponse.ProtoReflect.Descriptor instead. func (*GetRoleLabelResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{36} + return file_organize_proto_rawDescGZIP(), []int{34} } func (x *GetRoleLabelResponse) GetData() []*LabelValue { @@ -2355,7 +2177,7 @@ type GetRolePermissionRequest struct { func (x *GetRolePermissionRequest) Reset() { *x = GetRolePermissionRequest{} - mi := &file_organize_proto_msgTypes[37] + mi := &file_organize_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2367,7 +2189,7 @@ func (x *GetRolePermissionRequest) String() string { func (*GetRolePermissionRequest) ProtoMessage() {} func (x *GetRolePermissionRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[37] + mi := &file_organize_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2380,7 +2202,7 @@ func (x *GetRolePermissionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRolePermissionRequest.ProtoReflect.Descriptor instead. func (*GetRolePermissionRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{37} + return file_organize_proto_rawDescGZIP(), []int{35} } func (x *GetRolePermissionRequest) GetRole() string { @@ -2400,7 +2222,7 @@ type GetRolePermissionResponse struct { func (x *GetRolePermissionResponse) Reset() { *x = GetRolePermissionResponse{} - mi := &file_organize_proto_msgTypes[38] + mi := &file_organize_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2412,7 +2234,7 @@ func (x *GetRolePermissionResponse) String() string { func (*GetRolePermissionResponse) ProtoMessage() {} func (x *GetRolePermissionResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[38] + mi := &file_organize_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2425,7 +2247,7 @@ func (x *GetRolePermissionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRolePermissionResponse.ProtoReflect.Descriptor instead. func (*GetRolePermissionResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{38} + return file_organize_proto_rawDescGZIP(), []int{36} } func (x *GetRolePermissionResponse) GetRole() string { @@ -2452,7 +2274,7 @@ type SaveRolePermissionRequest struct { func (x *SaveRolePermissionRequest) Reset() { *x = SaveRolePermissionRequest{} - mi := &file_organize_proto_msgTypes[39] + mi := &file_organize_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2464,7 +2286,7 @@ func (x *SaveRolePermissionRequest) String() string { func (*SaveRolePermissionRequest) ProtoMessage() {} func (x *SaveRolePermissionRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[39] + mi := &file_organize_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2477,7 +2299,7 @@ func (x *SaveRolePermissionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveRolePermissionRequest.ProtoReflect.Descriptor instead. func (*SaveRolePermissionRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{39} + return file_organize_proto_rawDescGZIP(), []int{37} } func (x *SaveRolePermissionRequest) GetRole() string { @@ -2503,7 +2325,7 @@ type SaveRolePermissionResponse struct { func (x *SaveRolePermissionResponse) Reset() { *x = SaveRolePermissionResponse{} - mi := &file_organize_proto_msgTypes[40] + mi := &file_organize_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2515,7 +2337,7 @@ func (x *SaveRolePermissionResponse) String() string { func (*SaveRolePermissionResponse) ProtoMessage() {} func (x *SaveRolePermissionResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[40] + mi := &file_organize_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2528,7 +2350,7 @@ func (x *SaveRolePermissionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveRolePermissionResponse.ProtoReflect.Descriptor instead. func (*SaveRolePermissionResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{40} + return file_organize_proto_rawDescGZIP(), []int{38} } func (x *SaveRolePermissionResponse) GetRole() string { @@ -2549,7 +2371,7 @@ type MenuLevelValue struct { func (x *MenuLevelValue) Reset() { *x = MenuLevelValue{} - mi := &file_organize_proto_msgTypes[41] + mi := &file_organize_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2561,7 +2383,7 @@ func (x *MenuLevelValue) String() string { func (*MenuLevelValue) ProtoMessage() {} func (x *MenuLevelValue) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[41] + mi := &file_organize_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2574,7 +2396,7 @@ func (x *MenuLevelValue) ProtoReflect() protoreflect.Message { // Deprecated: Use MenuLevelValue.ProtoReflect.Descriptor instead. func (*MenuLevelValue) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{41} + return file_organize_proto_rawDescGZIP(), []int{39} } func (x *MenuLevelValue) GetLabel() string { @@ -2606,7 +2428,7 @@ type GetMenuLevelLabelsRequest struct { func (x *GetMenuLevelLabelsRequest) Reset() { *x = GetMenuLevelLabelsRequest{} - mi := &file_organize_proto_msgTypes[42] + mi := &file_organize_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2618,7 +2440,7 @@ func (x *GetMenuLevelLabelsRequest) String() string { func (*GetMenuLevelLabelsRequest) ProtoMessage() {} func (x *GetMenuLevelLabelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[42] + mi := &file_organize_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2631,7 +2453,7 @@ func (x *GetMenuLevelLabelsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenuLevelLabelsRequest.ProtoReflect.Descriptor instead. func (*GetMenuLevelLabelsRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{42} + return file_organize_proto_rawDescGZIP(), []int{40} } type GetMenuLevelLabelsResponse struct { @@ -2643,7 +2465,7 @@ type GetMenuLevelLabelsResponse struct { func (x *GetMenuLevelLabelsResponse) Reset() { *x = GetMenuLevelLabelsResponse{} - mi := &file_organize_proto_msgTypes[43] + mi := &file_organize_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2655,7 +2477,7 @@ func (x *GetMenuLevelLabelsResponse) String() string { func (*GetMenuLevelLabelsResponse) ProtoMessage() {} func (x *GetMenuLevelLabelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[43] + mi := &file_organize_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2668,7 +2490,7 @@ func (x *GetMenuLevelLabelsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenuLevelLabelsResponse.ProtoReflect.Descriptor instead. func (*GetMenuLevelLabelsResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{43} + return file_organize_proto_rawDescGZIP(), []int{41} } func (x *GetMenuLevelLabelsResponse) GetData() []*MenuLevelValue { @@ -2689,7 +2511,7 @@ type LoginRequest struct { func (x *LoginRequest) Reset() { *x = LoginRequest{} - mi := &file_organize_proto_msgTypes[44] + mi := &file_organize_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2701,7 +2523,7 @@ func (x *LoginRequest) String() string { func (*LoginRequest) ProtoMessage() {} func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[44] + mi := &file_organize_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2714,7 +2536,7 @@ func (x *LoginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{44} + return file_organize_proto_rawDescGZIP(), []int{42} } func (x *LoginRequest) GetUsername() string { @@ -2750,7 +2572,7 @@ type LoginResponse struct { func (x *LoginResponse) Reset() { *x = LoginResponse{} - mi := &file_organize_proto_msgTypes[45] + mi := &file_organize_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2762,7 +2584,7 @@ func (x *LoginResponse) String() string { func (*LoginResponse) ProtoMessage() {} func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[45] + mi := &file_organize_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2775,7 +2597,7 @@ func (x *LoginResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{45} + return file_organize_proto_rawDescGZIP(), []int{43} } func (x *LoginResponse) GetUid() string { @@ -2815,7 +2637,7 @@ type LogoutRequest struct { func (x *LogoutRequest) Reset() { *x = LogoutRequest{} - mi := &file_organize_proto_msgTypes[46] + mi := &file_organize_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2827,7 +2649,7 @@ func (x *LogoutRequest) String() string { func (*LogoutRequest) ProtoMessage() {} func (x *LogoutRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[46] + mi := &file_organize_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2840,7 +2662,7 @@ func (x *LogoutRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. func (*LogoutRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{46} + return file_organize_proto_rawDescGZIP(), []int{44} } func (x *LogoutRequest) GetToken() string { @@ -2859,7 +2681,7 @@ type LogoutResponse struct { func (x *LogoutResponse) Reset() { *x = LogoutResponse{} - mi := &file_organize_proto_msgTypes[47] + mi := &file_organize_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2871,7 +2693,7 @@ func (x *LogoutResponse) String() string { func (*LogoutResponse) ProtoMessage() {} func (x *LogoutResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[47] + mi := &file_organize_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2884,7 +2706,7 @@ func (x *LogoutResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. func (*LogoutResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{47} + return file_organize_proto_rawDescGZIP(), []int{45} } func (x *LogoutResponse) GetUid() string { @@ -2894,138 +2716,6 @@ func (x *LogoutResponse) GetUid() string { return "" } -type SettingItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SettingItem) Reset() { - *x = SettingItem{} - mi := &file_organize_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SettingItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SettingItem) ProtoMessage() {} - -func (x *SettingItem) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[48] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SettingItem.ProtoReflect.Descriptor instead. -func (*SettingItem) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{48} -} - -func (x *SettingItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SettingItem) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type GetSettingRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSettingRequest) Reset() { - *x = GetSettingRequest{} - mi := &file_organize_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSettingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSettingRequest) ProtoMessage() {} - -func (x *GetSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[49] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSettingRequest.ProtoReflect.Descriptor instead. -func (*GetSettingRequest) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{49} -} - -type GetSettingResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Data []*SettingItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSettingResponse) Reset() { - *x = GetSettingResponse{} - mi := &file_organize_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSettingResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSettingResponse) ProtoMessage() {} - -func (x *GetSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_organize_proto_msgTypes[50] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSettingResponse.ProtoReflect.Descriptor instead. -func (*GetSettingResponse) Descriptor() ([]byte, []int) { - return file_organize_proto_rawDescGZIP(), []int{50} -} - -func (x *GetSettingResponse) GetData() []*SettingItem { - if x != nil { - return x.Data - } - return nil -} - var File_organize_proto protoreflect.FileDescriptor const file_organize_proto_rawDesc = "" + @@ -3179,41 +2869,7 @@ const file_organize_proto_rawDesc = "" + "user_agent\x18\n" + " \x01(\tB/\xb2\xb9\x19+\n" + "\tsize:1024\x12\f用户代理\x1a\x10list;view;exportR\tuserAgent:\f\xba\xb9\x19\b\n" + - "\x06logins\"\xd8\x03\n" + - "\aSetting\x12$\n" + - "\x02id\x18\x01 \x01(\x03B\x14\xb2\xb9\x19\x10\n" + - "\n" + - "primaryKey\x12\x02IDR\x02id\x12E\n" + - "\n" + - "created_at\x18\x02 \x01(\x03B&\xb2\xb9\x19\"\x12\f创建时间\x1a\x12search;view;exportR\tcreatedAt\x12E\n" + - "\n" + - "updated_at\x18\x03 \x01(\x03B&\xb2\xb9\x19\"\x12\f更新时间\x1a\x12search;view;exportR\tupdatedAt\x12N\n" + - "\x04name\x18\x04 \x01(\tB:\xfaB\x04r\x02\x18\x14\xb2\xb9\x19/\n" + - "\asize:60\x12\t配置项2\x0freadonly:update:\brequiredR\x04name\x12K\n" + - "\x05value\x18\x05 \x01(\tB5\xfaB\x05r\x03\x18\x80\x04\xb2\xb9\x19)\n" + - "\bsize:512\x12\t配置值*\btextarea:\brequiredR\x05value\x12l\n" + - "\vdescription\x18\x06 \x01(\tBJ\xfaB\x05r\x03\x18\x80\b\xb2\xb9\x19>\n" + - "\tsize:1024\x12\f备注说明\x1a\x19create;update;view;export*\btextareaR\vdescription:\x0e\xba\xb9\x19\n" + - "\n" + - "\bsettings\"\xd8\x05\n" + - "\bActivity\x12$\n" + - "\x02id\x18\x01 \x01(\x03B\x14\xb2\xb9\x19\x10\n" + - "\n" + - "primaryKey\x12\x02IDR\x02id\x12L\n" + - "\n" + - "created_at\x18\x02 \x01(\x03B-\xb2\xb9\x19)\x12\f创建时间\x1a\x19search;search;view;exportR\tcreatedAt\x12W\n" + - "\x03uid\x18\x03 \x01(\tBE\xfaB\x06r\x04\x10\x05\x18\x14\xb2\xb9\x198\n" + - "\rindex;size:20\x12\x06用户*\x04user2\x0freadonly:update:\brequiredR\x03uid\x12\xbf\x01\n" + - "\x06action\x18\x04 \x01(\tB\xa6\x01\xb2\xb9\x19\xa1\x01\n" + - "!index;size:20;not null;default:''\x12\x06行为\x1a%search;list;create;update;view;export2\rmatch:exactlyR>create:新建#198754;update:更新#f09d00;delete:删除#e63757R\x06action\x12h\n" + - "\x06module\x18\x05 \x01(\tBP\xb2\xb9\x19L\n" + - "\x1bsize:60;not null;default:''\x12\x06模块\x1a%search;list;create;update;view;exportR\x06module\x12_\n" + - "\x05table\x18\x06 \x01(\tBI\xb2\xb9\x19E\n" + - "\x1bsize:60;not null;default:''\x12\x06数据\x1a\x1elist;create;update;view;exportR\x05table\x12`\n" + - "\x04data\x18\a \x01(\tBL\xb2\xb9\x19H\n" + - "\x1esize:10240;not null;default:''\x12\x06内容\x1a\x1elist;create;update;view;exportR\x04data:\x10\xba\xb9\x19\f\n" + - "\n" + - "activities\"8\n" + + "\x06logins\"8\n" + "\n" + "LabelValue\x12\x14\n" + "\x05label\x18\x01 \x01(\tR\x05label\x12\x14\n" + @@ -3325,13 +2981,7 @@ const file_organize_proto_rawDesc = "" + "\rLogoutRequest\x12\x14\n" + "\x05token\x18\x01 \x01(\tR\x05token\"\"\n" + "\x0eLogoutResponse\x12\x10\n" + - "\x03uid\x18\x01 \x01(\tR\x03uid\"7\n" + - "\vSettingItem\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\"\x13\n" + - "\x11GetSettingRequest\"?\n" + - "\x12GetSettingResponse\x12)\n" + - "\x04data\x18\x01 \x03(\v2\x15.organize.SettingItemR\x04data2\xd4\x05\n" + + "\x03uid\x18\x01 \x01(\tR\x03uid2\xd4\x05\n" + "\vUserService\x12T\n" + "\bGetMenus\x12\x18.organize.GetMenuRequest\x1a\x19.organize.GetMenuResponse\"\x13\x82\xd3\xe4\x93\x02\r\x12\v/user/menus\x12^\n" + "\n" + @@ -3354,10 +3004,7 @@ const file_organize_proto_rawDesc = "" + "\x12GetMenuLevelLabels\x12#.organize.GetMenuLevelLabelsRequest\x1a$.organize.GetMenuLevelLabelsResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/menu/level-labels2\xbd\x01\n" + "\vAuthService\x12T\n" + "\x05Login\x12\x16.organize.LoginRequest\x1a\x17.organize.LoginResponse\"\x1a\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/passport/login\x12X\n" + - "\x06Logout\x12\x17.organize.LogoutRequest\x1a\x18.organize.LogoutResponse\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/passport/logout2r\n" + - "\x0eSettingService\x12`\n" + - "\n" + - "GetSetting\x12\x1b.organize.GetSettingRequest\x1a\x1c.organize.GetSettingResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/system/settingB&Z$git.nobla.cn/golang/aeis-admin/pb;pbb\x06proto3" + "\x06Logout\x12\x17.organize.LogoutRequest\x1a\x18.organize.LogoutResponse\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/passport/logoutB&Z$git.nobla.cn/golang/aeis-admin/pb;pbb\x06proto3" var ( file_organize_proto_rawDescOnce sync.Once @@ -3371,7 +3018,7 @@ func file_organize_proto_rawDescGZIP() []byte { return file_organize_proto_rawDescData } -var file_organize_proto_msgTypes = make([]protoimpl.MessageInfo, 51) +var file_organize_proto_msgTypes = make([]protoimpl.MessageInfo, 46) var file_organize_proto_goTypes = []any{ (*Menu)(nil), // 0: organize.Menu (*Role)(nil), // 1: organize.Role @@ -3380,105 +3027,97 @@ var file_organize_proto_goTypes = []any{ (*User)(nil), // 4: organize.User (*Department)(nil), // 5: organize.Department (*Login)(nil), // 6: organize.Login - (*Setting)(nil), // 7: organize.Setting - (*Activity)(nil), // 8: organize.Activity - (*LabelValue)(nil), // 9: organize.LabelValue - (*PermissionItem)(nil), // 10: organize.PermissionItem - (*MenuItem)(nil), // 11: organize.MenuItem - (*GetMenuRequest)(nil), // 12: organize.GetMenuRequest - (*GetMenuResponse)(nil), // 13: organize.GetMenuResponse - (*GetProfileRequest)(nil), // 14: organize.GetProfileRequest - (*GetProfileResponse)(nil), // 15: organize.GetProfileResponse - (*ResetPasswordRequest)(nil), // 16: organize.ResetPasswordRequest - (*ResetPasswordResponse)(nil), // 17: organize.ResetPasswordResponse - (*UpdateProfileRequest)(nil), // 18: organize.UpdateProfileRequest - (*UpdateProfileResponse)(nil), // 19: organize.UpdateProfileResponse - (*GetPermissionRequest)(nil), // 20: organize.GetPermissionRequest - (*GetPermissionResponse)(nil), // 21: organize.GetPermissionResponse - (*GetUserLabelRequest)(nil), // 22: organize.GetUserLabelRequest - (*GetUserLabelResponse)(nil), // 23: organize.GetUserLabelResponse - (*GetUserTagRequest)(nil), // 24: organize.GetUserTagRequest - (*GetUserTagResponse)(nil), // 25: organize.GetUserTagResponse - (*DepartmentLabelValue)(nil), // 26: organize.DepartmentLabelValue - (*DepartmentUserValue)(nil), // 27: organize.DepartmentUserValue - (*GetDepartmentLabelRequest)(nil), // 28: organize.GetDepartmentLabelRequest - (*GetDepartmentLabelResponse)(nil), // 29: organize.GetDepartmentLabelResponse - (*GetDepartmentUserRequest)(nil), // 30: organize.GetDepartmentUserRequest - (*GetDepartmentUserResponse)(nil), // 31: organize.GetDepartmentUserResponse - (*DepartmentLevelValue)(nil), // 32: organize.DepartmentLevelValue - (*GetDepartmentLevelLabelsRequest)(nil), // 33: organize.GetDepartmentLevelLabelsRequest - (*GetDepartmentLevelLabelsResponse)(nil), // 34: organize.GetDepartmentLevelLabelsResponse - (*GetRoleLabelRequest)(nil), // 35: organize.GetRoleLabelRequest - (*GetRoleLabelResponse)(nil), // 36: organize.GetRoleLabelResponse - (*GetRolePermissionRequest)(nil), // 37: organize.GetRolePermissionRequest - (*GetRolePermissionResponse)(nil), // 38: organize.GetRolePermissionResponse - (*SaveRolePermissionRequest)(nil), // 39: organize.SaveRolePermissionRequest - (*SaveRolePermissionResponse)(nil), // 40: organize.SaveRolePermissionResponse - (*MenuLevelValue)(nil), // 41: organize.MenuLevelValue - (*GetMenuLevelLabelsRequest)(nil), // 42: organize.GetMenuLevelLabelsRequest - (*GetMenuLevelLabelsResponse)(nil), // 43: organize.GetMenuLevelLabelsResponse - (*LoginRequest)(nil), // 44: organize.LoginRequest - (*LoginResponse)(nil), // 45: organize.LoginResponse - (*LogoutRequest)(nil), // 46: organize.LogoutRequest - (*LogoutResponse)(nil), // 47: organize.LogoutResponse - (*SettingItem)(nil), // 48: organize.SettingItem - (*GetSettingRequest)(nil), // 49: organize.GetSettingRequest - (*GetSettingResponse)(nil), // 50: organize.GetSettingResponse + (*LabelValue)(nil), // 7: organize.LabelValue + (*PermissionItem)(nil), // 8: organize.PermissionItem + (*MenuItem)(nil), // 9: organize.MenuItem + (*GetMenuRequest)(nil), // 10: organize.GetMenuRequest + (*GetMenuResponse)(nil), // 11: organize.GetMenuResponse + (*GetProfileRequest)(nil), // 12: organize.GetProfileRequest + (*GetProfileResponse)(nil), // 13: organize.GetProfileResponse + (*ResetPasswordRequest)(nil), // 14: organize.ResetPasswordRequest + (*ResetPasswordResponse)(nil), // 15: organize.ResetPasswordResponse + (*UpdateProfileRequest)(nil), // 16: organize.UpdateProfileRequest + (*UpdateProfileResponse)(nil), // 17: organize.UpdateProfileResponse + (*GetPermissionRequest)(nil), // 18: organize.GetPermissionRequest + (*GetPermissionResponse)(nil), // 19: organize.GetPermissionResponse + (*GetUserLabelRequest)(nil), // 20: organize.GetUserLabelRequest + (*GetUserLabelResponse)(nil), // 21: organize.GetUserLabelResponse + (*GetUserTagRequest)(nil), // 22: organize.GetUserTagRequest + (*GetUserTagResponse)(nil), // 23: organize.GetUserTagResponse + (*DepartmentLabelValue)(nil), // 24: organize.DepartmentLabelValue + (*DepartmentUserValue)(nil), // 25: organize.DepartmentUserValue + (*GetDepartmentLabelRequest)(nil), // 26: organize.GetDepartmentLabelRequest + (*GetDepartmentLabelResponse)(nil), // 27: organize.GetDepartmentLabelResponse + (*GetDepartmentUserRequest)(nil), // 28: organize.GetDepartmentUserRequest + (*GetDepartmentUserResponse)(nil), // 29: organize.GetDepartmentUserResponse + (*DepartmentLevelValue)(nil), // 30: organize.DepartmentLevelValue + (*GetDepartmentLevelLabelsRequest)(nil), // 31: organize.GetDepartmentLevelLabelsRequest + (*GetDepartmentLevelLabelsResponse)(nil), // 32: organize.GetDepartmentLevelLabelsResponse + (*GetRoleLabelRequest)(nil), // 33: organize.GetRoleLabelRequest + (*GetRoleLabelResponse)(nil), // 34: organize.GetRoleLabelResponse + (*GetRolePermissionRequest)(nil), // 35: organize.GetRolePermissionRequest + (*GetRolePermissionResponse)(nil), // 36: organize.GetRolePermissionResponse + (*SaveRolePermissionRequest)(nil), // 37: organize.SaveRolePermissionRequest + (*SaveRolePermissionResponse)(nil), // 38: organize.SaveRolePermissionResponse + (*MenuLevelValue)(nil), // 39: organize.MenuLevelValue + (*GetMenuLevelLabelsRequest)(nil), // 40: organize.GetMenuLevelLabelsRequest + (*GetMenuLevelLabelsResponse)(nil), // 41: organize.GetMenuLevelLabelsResponse + (*LoginRequest)(nil), // 42: organize.LoginRequest + (*LoginResponse)(nil), // 43: organize.LoginResponse + (*LogoutRequest)(nil), // 44: organize.LogoutRequest + (*LogoutResponse)(nil), // 45: organize.LogoutResponse } var file_organize_proto_depIdxs = []int32{ - 10, // 0: organize.MenuItem.permissions:type_name -> organize.PermissionItem - 11, // 1: organize.MenuItem.children:type_name -> organize.MenuItem - 11, // 2: organize.GetMenuResponse.data:type_name -> organize.MenuItem - 9, // 3: organize.GetUserLabelResponse.data:type_name -> organize.LabelValue - 9, // 4: organize.GetUserTagResponse.data:type_name -> organize.LabelValue - 27, // 5: organize.DepartmentUserValue.children:type_name -> organize.DepartmentUserValue - 26, // 6: organize.GetDepartmentLabelResponse.data:type_name -> organize.DepartmentLabelValue - 27, // 7: organize.GetDepartmentUserResponse.data:type_name -> organize.DepartmentUserValue - 32, // 8: organize.DepartmentLevelValue.children:type_name -> organize.DepartmentLevelValue - 32, // 9: organize.GetDepartmentLevelLabelsResponse.data:type_name -> organize.DepartmentLevelValue - 9, // 10: organize.GetRoleLabelResponse.data:type_name -> organize.LabelValue - 41, // 11: organize.MenuLevelValue.children:type_name -> organize.MenuLevelValue - 41, // 12: organize.GetMenuLevelLabelsResponse.data:type_name -> organize.MenuLevelValue - 48, // 13: organize.GetSettingResponse.data:type_name -> organize.SettingItem - 12, // 14: organize.UserService.GetMenus:input_type -> organize.GetMenuRequest - 14, // 15: organize.UserService.GetProfile:input_type -> organize.GetProfileRequest - 18, // 16: organize.UserService.UpdateProfile:input_type -> organize.UpdateProfileRequest - 16, // 17: organize.UserService.ResetPassword:input_type -> organize.ResetPasswordRequest - 20, // 18: organize.UserService.GetPermissions:input_type -> organize.GetPermissionRequest - 22, // 19: organize.UserService.GetUserLabels:input_type -> organize.GetUserLabelRequest - 24, // 20: organize.UserService.GetUserTags:input_type -> organize.GetUserTagRequest - 28, // 21: organize.DepartmentService.GetDepartmentLabels:input_type -> organize.GetDepartmentLabelRequest - 30, // 22: organize.DepartmentService.GetDepartmentUsers:input_type -> organize.GetDepartmentUserRequest - 33, // 23: organize.DepartmentService.GetDepartmentLevelLabels:input_type -> organize.GetDepartmentLevelLabelsRequest - 35, // 24: organize.RoleService.GetRoleLabels:input_type -> organize.GetRoleLabelRequest - 37, // 25: organize.RoleService.GetRolePermissions:input_type -> organize.GetRolePermissionRequest - 39, // 26: organize.RoleService.SaveRolePermission:input_type -> organize.SaveRolePermissionRequest - 42, // 27: organize.MenuService.GetMenuLevelLabels:input_type -> organize.GetMenuLevelLabelsRequest - 44, // 28: organize.AuthService.Login:input_type -> organize.LoginRequest - 46, // 29: organize.AuthService.Logout:input_type -> organize.LogoutRequest - 49, // 30: organize.SettingService.GetSetting:input_type -> organize.GetSettingRequest - 13, // 31: organize.UserService.GetMenus:output_type -> organize.GetMenuResponse - 15, // 32: organize.UserService.GetProfile:output_type -> organize.GetProfileResponse - 19, // 33: organize.UserService.UpdateProfile:output_type -> organize.UpdateProfileResponse - 17, // 34: organize.UserService.ResetPassword:output_type -> organize.ResetPasswordResponse - 21, // 35: organize.UserService.GetPermissions:output_type -> organize.GetPermissionResponse - 23, // 36: organize.UserService.GetUserLabels:output_type -> organize.GetUserLabelResponse - 25, // 37: organize.UserService.GetUserTags:output_type -> organize.GetUserTagResponse - 29, // 38: organize.DepartmentService.GetDepartmentLabels:output_type -> organize.GetDepartmentLabelResponse - 31, // 39: organize.DepartmentService.GetDepartmentUsers:output_type -> organize.GetDepartmentUserResponse - 34, // 40: organize.DepartmentService.GetDepartmentLevelLabels:output_type -> organize.GetDepartmentLevelLabelsResponse - 36, // 41: organize.RoleService.GetRoleLabels:output_type -> organize.GetRoleLabelResponse - 38, // 42: organize.RoleService.GetRolePermissions:output_type -> organize.GetRolePermissionResponse - 40, // 43: organize.RoleService.SaveRolePermission:output_type -> organize.SaveRolePermissionResponse - 43, // 44: organize.MenuService.GetMenuLevelLabels:output_type -> organize.GetMenuLevelLabelsResponse - 45, // 45: organize.AuthService.Login:output_type -> organize.LoginResponse - 47, // 46: organize.AuthService.Logout:output_type -> organize.LogoutResponse - 50, // 47: organize.SettingService.GetSetting:output_type -> organize.GetSettingResponse - 31, // [31:48] is the sub-list for method output_type - 14, // [14:31] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 8, // 0: organize.MenuItem.permissions:type_name -> organize.PermissionItem + 9, // 1: organize.MenuItem.children:type_name -> organize.MenuItem + 9, // 2: organize.GetMenuResponse.data:type_name -> organize.MenuItem + 7, // 3: organize.GetUserLabelResponse.data:type_name -> organize.LabelValue + 7, // 4: organize.GetUserTagResponse.data:type_name -> organize.LabelValue + 25, // 5: organize.DepartmentUserValue.children:type_name -> organize.DepartmentUserValue + 24, // 6: organize.GetDepartmentLabelResponse.data:type_name -> organize.DepartmentLabelValue + 25, // 7: organize.GetDepartmentUserResponse.data:type_name -> organize.DepartmentUserValue + 30, // 8: organize.DepartmentLevelValue.children:type_name -> organize.DepartmentLevelValue + 30, // 9: organize.GetDepartmentLevelLabelsResponse.data:type_name -> organize.DepartmentLevelValue + 7, // 10: organize.GetRoleLabelResponse.data:type_name -> organize.LabelValue + 39, // 11: organize.MenuLevelValue.children:type_name -> organize.MenuLevelValue + 39, // 12: organize.GetMenuLevelLabelsResponse.data:type_name -> organize.MenuLevelValue + 10, // 13: organize.UserService.GetMenus:input_type -> organize.GetMenuRequest + 12, // 14: organize.UserService.GetProfile:input_type -> organize.GetProfileRequest + 16, // 15: organize.UserService.UpdateProfile:input_type -> organize.UpdateProfileRequest + 14, // 16: organize.UserService.ResetPassword:input_type -> organize.ResetPasswordRequest + 18, // 17: organize.UserService.GetPermissions:input_type -> organize.GetPermissionRequest + 20, // 18: organize.UserService.GetUserLabels:input_type -> organize.GetUserLabelRequest + 22, // 19: organize.UserService.GetUserTags:input_type -> organize.GetUserTagRequest + 26, // 20: organize.DepartmentService.GetDepartmentLabels:input_type -> organize.GetDepartmentLabelRequest + 28, // 21: organize.DepartmentService.GetDepartmentUsers:input_type -> organize.GetDepartmentUserRequest + 31, // 22: organize.DepartmentService.GetDepartmentLevelLabels:input_type -> organize.GetDepartmentLevelLabelsRequest + 33, // 23: organize.RoleService.GetRoleLabels:input_type -> organize.GetRoleLabelRequest + 35, // 24: organize.RoleService.GetRolePermissions:input_type -> organize.GetRolePermissionRequest + 37, // 25: organize.RoleService.SaveRolePermission:input_type -> organize.SaveRolePermissionRequest + 40, // 26: organize.MenuService.GetMenuLevelLabels:input_type -> organize.GetMenuLevelLabelsRequest + 42, // 27: organize.AuthService.Login:input_type -> organize.LoginRequest + 44, // 28: organize.AuthService.Logout:input_type -> organize.LogoutRequest + 11, // 29: organize.UserService.GetMenus:output_type -> organize.GetMenuResponse + 13, // 30: organize.UserService.GetProfile:output_type -> organize.GetProfileResponse + 17, // 31: organize.UserService.UpdateProfile:output_type -> organize.UpdateProfileResponse + 15, // 32: organize.UserService.ResetPassword:output_type -> organize.ResetPasswordResponse + 19, // 33: organize.UserService.GetPermissions:output_type -> organize.GetPermissionResponse + 21, // 34: organize.UserService.GetUserLabels:output_type -> organize.GetUserLabelResponse + 23, // 35: organize.UserService.GetUserTags:output_type -> organize.GetUserTagResponse + 27, // 36: organize.DepartmentService.GetDepartmentLabels:output_type -> organize.GetDepartmentLabelResponse + 29, // 37: organize.DepartmentService.GetDepartmentUsers:output_type -> organize.GetDepartmentUserResponse + 32, // 38: organize.DepartmentService.GetDepartmentLevelLabels:output_type -> organize.GetDepartmentLevelLabelsResponse + 34, // 39: organize.RoleService.GetRoleLabels:output_type -> organize.GetRoleLabelResponse + 36, // 40: organize.RoleService.GetRolePermissions:output_type -> organize.GetRolePermissionResponse + 38, // 41: organize.RoleService.SaveRolePermission:output_type -> organize.SaveRolePermissionResponse + 41, // 42: organize.MenuService.GetMenuLevelLabels:output_type -> organize.GetMenuLevelLabelsResponse + 43, // 43: organize.AuthService.Login:output_type -> organize.LoginResponse + 45, // 44: organize.AuthService.Logout:output_type -> organize.LogoutResponse + 29, // [29:45] is the sub-list for method output_type + 13, // [13:29] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_organize_proto_init() } @@ -3492,9 +3131,9 @@ func file_organize_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_organize_proto_rawDesc), len(file_organize_proto_rawDesc)), NumEnums: 0, - NumMessages: 51, + NumMessages: 46, NumExtensions: 0, - NumServices: 6, + NumServices: 5, }, GoTypes: file_organize_proto_goTypes, DependencyIndexes: file_organize_proto_depIdxs, diff --git a/pb/organize.pb.validate.go b/pb/organize.pb.validate.go index ca7dd84..d69a335 100644 --- a/pb/organize.pb.validate.go +++ b/pb/organize.pb.validate.go @@ -1057,265 +1057,6 @@ var _ interface { ErrorName() string } = LoginValidationError{} -// Validate checks the field values on Setting with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Setting) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Setting with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in SettingMultiError, or nil if none found. -func (m *Setting) ValidateAll() error { - return m.validate(true) -} - -func (m *Setting) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - // no validation rules for CreatedAt - - // no validation rules for UpdatedAt - - if utf8.RuneCountInString(m.GetName()) > 20 { - err := SettingValidationError{ - field: "Name", - reason: "value length must be at most 20 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetValue()) > 512 { - err := SettingValidationError{ - field: "Value", - reason: "value length must be at most 512 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetDescription()) > 1024 { - err := SettingValidationError{ - field: "Description", - reason: "value length must be at most 1024 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return SettingMultiError(errors) - } - - return nil -} - -// SettingMultiError is an error wrapping multiple validation errors returned -// by Setting.ValidateAll() if the designated constraints aren't met. -type SettingMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SettingMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SettingMultiError) AllErrors() []error { return m } - -// SettingValidationError is the validation error returned by Setting.Validate -// if the designated constraints aren't met. -type SettingValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SettingValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SettingValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SettingValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SettingValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SettingValidationError) ErrorName() string { return "SettingValidationError" } - -// Error satisfies the builtin error interface -func (e SettingValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSetting.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SettingValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SettingValidationError{} - -// Validate checks the field values on Activity with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Activity) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Activity with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ActivityMultiError, or nil -// if none found. -func (m *Activity) ValidateAll() error { - return m.validate(true) -} - -func (m *Activity) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - // no validation rules for CreatedAt - - if l := utf8.RuneCountInString(m.GetUid()); l < 5 || l > 20 { - err := ActivityValidationError{ - field: "Uid", - reason: "value length must be between 5 and 20 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Action - - // no validation rules for Module - - // no validation rules for Table - - // no validation rules for Data - - if len(errors) > 0 { - return ActivityMultiError(errors) - } - - return nil -} - -// ActivityMultiError is an error wrapping multiple validation errors returned -// by Activity.ValidateAll() if the designated constraints aren't met. -type ActivityMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ActivityMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ActivityMultiError) AllErrors() []error { return m } - -// ActivityValidationError is the validation error returned by -// Activity.Validate if the designated constraints aren't met. -type ActivityValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ActivityValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ActivityValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ActivityValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ActivityValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ActivityValidationError) ErrorName() string { return "ActivityValidationError" } - -// Error satisfies the builtin error interface -func (e ActivityValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sActivity.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ActivityValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ActivityValidationError{} - // Validate checks the field values on LabelValue with the rules defined in the // proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. @@ -5824,344 +5565,3 @@ var _ interface { Cause() error ErrorName() string } = LogoutResponseValidationError{} - -// Validate checks the field values on SettingItem with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *SettingItem) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SettingItem with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in SettingItemMultiError, or -// nil if none found. -func (m *SettingItem) ValidateAll() error { - return m.validate(true) -} - -func (m *SettingItem) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Value - - if len(errors) > 0 { - return SettingItemMultiError(errors) - } - - return nil -} - -// SettingItemMultiError is an error wrapping multiple validation errors -// returned by SettingItem.ValidateAll() if the designated constraints aren't met. -type SettingItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SettingItemMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SettingItemMultiError) AllErrors() []error { return m } - -// SettingItemValidationError is the validation error returned by -// SettingItem.Validate if the designated constraints aren't met. -type SettingItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SettingItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SettingItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SettingItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SettingItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SettingItemValidationError) ErrorName() string { return "SettingItemValidationError" } - -// Error satisfies the builtin error interface -func (e SettingItemValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSettingItem.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SettingItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SettingItemValidationError{} - -// Validate checks the field values on GetSettingRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *GetSettingRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetSettingRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetSettingRequestMultiError, or nil if none found. -func (m *GetSettingRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetSettingRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return GetSettingRequestMultiError(errors) - } - - return nil -} - -// GetSettingRequestMultiError is an error wrapping multiple validation errors -// returned by GetSettingRequest.ValidateAll() if the designated constraints -// aren't met. -type GetSettingRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetSettingRequestMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetSettingRequestMultiError) AllErrors() []error { return m } - -// GetSettingRequestValidationError is the validation error returned by -// GetSettingRequest.Validate if the designated constraints aren't met. -type GetSettingRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetSettingRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetSettingRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetSettingRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetSettingRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetSettingRequestValidationError) ErrorName() string { - return "GetSettingRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetSettingRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetSettingRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetSettingRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetSettingRequestValidationError{} - -// Validate checks the field values on GetSettingResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetSettingResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetSettingResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetSettingResponseMultiError, or nil if none found. -func (m *GetSettingResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetSettingResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetData() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetSettingResponseValidationError{ - field: fmt.Sprintf("Data[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetSettingResponseValidationError{ - field: fmt.Sprintf("Data[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetSettingResponseValidationError{ - field: fmt.Sprintf("Data[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetSettingResponseMultiError(errors) - } - - return nil -} - -// GetSettingResponseMultiError is an error wrapping multiple validation errors -// returned by GetSettingResponse.ValidateAll() if the designated constraints -// aren't met. -type GetSettingResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetSettingResponseMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetSettingResponseMultiError) AllErrors() []error { return m } - -// GetSettingResponseValidationError is the validation error returned by -// GetSettingResponse.Validate if the designated constraints aren't met. -type GetSettingResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetSettingResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetSettingResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetSettingResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetSettingResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetSettingResponseValidationError) ErrorName() string { - return "GetSettingResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetSettingResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetSettingResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetSettingResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetSettingResponseValidationError{} diff --git a/pb/organize.proto b/pb/organize.proto index 3b4b5b8..05de8e1 100644 --- a/pb/organize.proto +++ b/pb/organize.proto @@ -115,34 +115,6 @@ message Login { string user_agent = 10 [(aeus.field)={gorm:"size:1024",scenarios:"list;view;export",comment: "用户代理"}]; } -// Setting 参数设置表 -message Setting { - option (aeus.rest) = { - table: "settings" - }; - int64 id = 1 [(aeus.field) = {gorm:"primaryKey",comment:"ID"}]; - int64 created_at = 2 [(aeus.field)={scenarios:"search;view;export",comment:"创建时间"}]; - int64 updated_at = 3 [(aeus.field)={scenarios:"search;view;export",comment:"更新时间"}]; - string name = 4 [(aeus.field)={gorm:"size:60",rule:"required",props:"readonly:update",comment: "配置项"},(validate.rules).string = {max_len: 20}]; - string value = 5 [(aeus.field)={gorm:"size:512",rule:"required",format:"textarea",comment: "配置值"},(validate.rules).string = {max_len: 512}]; - string description = 6 [(aeus.field)={gorm:"size:1024",format:"textarea",scenarios:"create;update;view;export",comment: "备注说明"},(validate.rules).string = {max_len: 1024}]; -} - - -// Activity 活动记录 -message Activity { - option (aeus.rest) = { - table: "activities" - }; - int64 id = 1 [(aeus.field) = {gorm:"primaryKey",comment:"ID"}]; - int64 created_at = 2 [(aeus.field)={scenarios:"search;search;view;export",comment:"创建时间"}]; - string uid = 3 [(aeus.field)={gorm:"index;size:20",rule:"required",props:"readonly:update",format:"user",comment: "用户"},(validate.rules).string = {min_len: 5, max_len: 20}]; - string action = 4 [(aeus.field)={props:"match:exactly",gorm:"index;size:20;not null;default:''",comment:"行为",enum:"create:新建#198754;update:更新#f09d00;delete:删除#e63757",scenarios:"search;list;create;update;view;export"}]; - string module = 5 [(aeus.field)={gorm:"size:60;not null;default:''",comment:"模块",scenarios:"search;list;create;update;view;export"}]; - string table = 6 [(aeus.field)={gorm:"size:60;not null;default:''",comment:"数据",scenarios:"list;create;update;view;export"}]; - string data = 7 [(aeus.field)={gorm:"size:10240;not null;default:''",comment:"内容",scenarios:"list;create;update;view;export"}]; -} - message LabelValue { string label = 1; string value = 2; @@ -450,22 +422,3 @@ service AuthService { }; } } - -message SettingItem { - string name = 1; - string value = 2; -} - -message GetSettingRequest{} - -message GetSettingResponse{ - repeated SettingItem data = 1; -} - -service SettingService { - rpc GetSetting(GetSettingRequest) returns (GetSettingResponse) { - option (google.api.http) = { - get: "/system/setting" - }; - } -} \ No newline at end of file diff --git a/pb/organize_grpc.pb.go b/pb/organize_grpc.pb.go index 90171b7..e7c2531 100644 --- a/pb/organize_grpc.pb.go +++ b/pb/organize_grpc.pb.go @@ -973,105 +973,3 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "organize.proto", } - -const ( - SettingService_GetSetting_FullMethodName = "/organize.SettingService/GetSetting" -) - -// SettingServiceClient is the client API for SettingService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type SettingServiceClient interface { - GetSetting(ctx context.Context, in *GetSettingRequest, opts ...grpc.CallOption) (*GetSettingResponse, error) -} - -type settingServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSettingServiceClient(cc grpc.ClientConnInterface) SettingServiceClient { - return &settingServiceClient{cc} -} - -func (c *settingServiceClient) GetSetting(ctx context.Context, in *GetSettingRequest, opts ...grpc.CallOption) (*GetSettingResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetSettingResponse) - err := c.cc.Invoke(ctx, SettingService_GetSetting_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SettingServiceServer is the server API for SettingService service. -// All implementations must embed UnimplementedSettingServiceServer -// for forward compatibility. -type SettingServiceServer interface { - GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) - mustEmbedUnimplementedSettingServiceServer() -} - -// UnimplementedSettingServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedSettingServiceServer struct{} - -func (UnimplementedSettingServiceServer) GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSetting not implemented") -} -func (UnimplementedSettingServiceServer) mustEmbedUnimplementedSettingServiceServer() {} -func (UnimplementedSettingServiceServer) testEmbeddedByValue() {} - -// UnsafeSettingServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SettingServiceServer will -// result in compilation errors. -type UnsafeSettingServiceServer interface { - mustEmbedUnimplementedSettingServiceServer() -} - -func RegisterSettingServiceServer(s grpc.ServiceRegistrar, srv SettingServiceServer) { - // If the following call pancis, it indicates UnimplementedSettingServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&SettingService_ServiceDesc, srv) -} - -func _SettingService_GetSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSettingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SettingServiceServer).GetSetting(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: SettingService_GetSetting_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SettingServiceServer).GetSetting(ctx, req.(*GetSettingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// SettingService_ServiceDesc is the grpc.ServiceDesc for SettingService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var SettingService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "organize.SettingService", - HandlerType: (*SettingServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetSetting", - Handler: _SettingService_GetSetting_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "organize.proto", -} diff --git a/pb/organize_http.pb.go b/pb/organize_http.pb.go index 06bfc9f..d198fd6 100644 --- a/pb/organize_http.pb.go +++ b/pb/organize_http.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: organize.proto -// date: 2025-06-18 14:37:24 +// date: 2025-06-18 15:37:30 package pb @@ -52,10 +52,6 @@ type AuthServiceHttpServer interface { Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) } -type SettingServiceHttpServer interface { - GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) -} - // 获取用户菜单 func handleUserServiceGetMenus(s UserServiceHttpServer) http.HandleFunc { @@ -368,22 +364,6 @@ func handleAuthServiceLogout(s AuthServiceHttpServer) http.HandleFunc { } } -func handleSettingServiceGetSetting(s SettingServiceHttpServer) http.HandleFunc { - return func(ctx *http.Context) (err error) { - req := &GetSettingRequest{} - - if res, err := s.GetSetting(ctx.Context(), req); err != nil { - if er, ok := err.(*errors.Error); ok { - return ctx.Error(er.Code, er.Message) - } else { - return ctx.Error(errors.Unavailable, err.Error()) - } - } else { - return ctx.Success(res) - } - } -} - func RegisterUserServiceRouter(hs *http.Server, s UserServiceHttpServer) { // Register handle GetMenus route @@ -451,10 +431,3 @@ func RegisterAuthServiceRouter(hs *http.Server, s AuthServiceHttpServer) { hs.POST("/passport/logout", handleAuthServiceLogout(s)) } - -func RegisterSettingServiceRouter(hs *http.Server, s SettingServiceHttpServer) { - - // Register handle GetSetting route - hs.GET("/system/setting", handleSettingServiceGetSetting(s)) - -} diff --git a/pb/organize_model.pb.go b/pb/organize_model.pb.go index 6eb24ad..4a3be75 100644 --- a/pb/organize_model.pb.go +++ b/pb/organize_model.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-aeus. DO NOT EDIT. // source: organize.proto -// date: 2025-06-18 14:37:24 +// date: 2025-06-18 15:37:30 package pb @@ -9,19 +9,19 @@ import ( ) type MenuModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"菜单ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index" comment:"更新时间" scenarios:"view;export"` - Parent string `json:"parent" yaml:"parent" xml:"parent" gorm:"index;size:60" comment:"父级菜单" format:"menu" props:"readonly:update" live:"type:dropdown;url:/menu/level-labels"` - Name string `json:"name" yaml:"name" xml:"name" gorm:"index;size:60" comment:"组件名称" props:"readonly:update" rule:"unique;required"` - Label string `json:"label" yaml:"label" xml:"label" gorm:"size:120" comment:"菜单标题" rule:"required"` - Uri string `json:"uri" yaml:"uri" xml:"uri" gorm:"size:512" comment:"菜单链接" scenarios:"create;update;view;export" rule:"required"` - ViewPath string `json:"view_path" yaml:"viewPath" xml:"viewPath" gorm:"size:512" comment:"视图路径" scenarios:"create;update;view;export"` - Icon string `json:"icon" yaml:"icon" xml:"icon" gorm:"size:60" comment:"菜单图标" scenarios:"create;update;view;export"` - Hidden bool `json:"hidden" yaml:"hidden" xml:"hidden" comment:"是否隐藏" scenarios:"create;update;view;export"` - Public bool `json:"public" yaml:"public" xml:"public" comment:"是否公开" scenarios:"create;update;view;export"` - Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024" comment:"备注说明" scenarios:"create;update;view;export;list" format:"textarea"` - Position int64 `json:"position" yaml:"position" xml:"position" comment:"排序" scenarios:"create;update"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"菜单ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index;column:updated_at" comment:"更新时间" scenarios:"view;export"` + Parent string `json:"parent" yaml:"parent" xml:"parent" gorm:"index;size:60;column:parent" comment:"父级菜单" format:"menu" props:"readonly:update" live:"type:dropdown;url:/menu/level-labels"` + Name string `json:"name" yaml:"name" xml:"name" gorm:"index;size:60;column:name" comment:"组件名称" props:"readonly:update" rule:"unique;required"` + Label string `json:"label" yaml:"label" xml:"label" gorm:"size:120;column:label" comment:"菜单标题" rule:"required"` + Uri string `json:"uri" yaml:"uri" xml:"uri" gorm:"size:512;column:uri" comment:"菜单链接" scenarios:"create;update;view;export" rule:"required"` + ViewPath string `json:"view_path" yaml:"viewPath" xml:"viewPath" gorm:"size:512;column:view_path" comment:"视图路径" scenarios:"create;update;view;export"` + Icon string `json:"icon" yaml:"icon" xml:"icon" gorm:"size:60;column:icon" comment:"菜单图标" scenarios:"create;update;view;export"` + Hidden bool `json:"hidden" yaml:"hidden" xml:"hidden" gorm:"column:hidden" comment:"是否隐藏" scenarios:"create;update;view;export"` + Public bool `json:"public" yaml:"public" xml:"public" gorm:"column:public" comment:"是否公开" scenarios:"create;update;view;export"` + Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"create;update;view;export;list" format:"textarea"` + Position int64 `json:"position" yaml:"position" xml:"position" gorm:"column:position" comment:"排序" scenarios:"create;update"` } func (m *MenuModel) TableName() string { @@ -79,14 +79,14 @@ func (m *MenuModel) Delete(db *gorm.DB) (err error) { } func (m *MenuModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("position=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *MenuModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *MenuModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *MenuModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *MenuModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -95,12 +95,12 @@ func NewMenuModel() *MenuModel { } type RoleModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"角色ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index" comment:"更新时间" scenarios:"view;export"` - Name string `json:"name" yaml:"name" xml:"name" gorm:"index;size:60" comment:"角色名称" props:"readonly:update"` - Label string `json:"label" yaml:"label" xml:"label" gorm:"size:60" comment:"角色标题"` - Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024" comment:"备注说明" scenarios:"list;create;update;export" format:"textarea"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"角色ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index;column:updated_at" comment:"更新时间" scenarios:"view;export"` + Name string `json:"name" yaml:"name" xml:"name" gorm:"index;size:60;column:name" comment:"角色名称" props:"readonly:update"` + Label string `json:"label" yaml:"label" xml:"label" gorm:"size:60;column:label" comment:"角色标题"` + Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"list;create;update;export" format:"textarea"` } func (m *RoleModel) TableName() string { @@ -144,14 +144,14 @@ func (m *RoleModel) Delete(db *gorm.DB) (err error) { } func (m *RoleModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("description=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *RoleModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *RoleModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *RoleModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *RoleModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -160,12 +160,12 @@ func NewRoleModel() *RoleModel { } type PermissionModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"权限ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index" comment:"更新时间" scenarios:"view;export"` - Menu string `json:"menu" yaml:"menu" xml:"menu" gorm:"index;size:60" comment:"所属菜单" format:"menu" rule:"required"` - Permission string `json:"permission" yaml:"permission" xml:"permission" gorm:"index;size:60" comment:"权限名称" rule:"required"` - Label string `json:"label" yaml:"label" xml:"label" gorm:"size:60" comment:"权限标题" rule:"required"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"权限ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index;column:updated_at" comment:"更新时间" scenarios:"view;export"` + Menu string `json:"menu" yaml:"menu" xml:"menu" gorm:"index;size:60;column:menu" comment:"所属菜单" format:"menu" rule:"required"` + Permission string `json:"permission" yaml:"permission" xml:"permission" gorm:"index;size:60;column:permission" comment:"权限名称" rule:"required"` + Label string `json:"label" yaml:"label" xml:"label" gorm:"size:60;column:label" comment:"权限标题" rule:"required"` } func (m *PermissionModel) TableName() string { @@ -209,14 +209,14 @@ func (m *PermissionModel) Delete(db *gorm.DB) (err error) { } func (m *PermissionModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("label=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *PermissionModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *PermissionModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *PermissionModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *PermissionModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -225,9 +225,9 @@ func NewPermissionModel() *PermissionModel { } type RolePermissionModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - Role string `json:"role" yaml:"role" xml:"role" gorm:"index;size:60" comment:"角色" rule:"required"` - Permission string `json:"permission" yaml:"permission" xml:"permission" gorm:"size:60" comment:"权限" rule:"required"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + Role string `json:"role" yaml:"role" xml:"role" gorm:"index;size:60;column:role" comment:"角色" rule:"required"` + Permission string `json:"permission" yaml:"permission" xml:"permission" gorm:"size:60;column:permission" comment:"权限" rule:"required"` } func (m *RolePermissionModel) TableName() string { @@ -265,14 +265,14 @@ func (m *RolePermissionModel) Delete(db *gorm.DB) (err error) { } func (m *RolePermissionModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("permission=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *RolePermissionModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *RolePermissionModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *RolePermissionModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *RolePermissionModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -281,21 +281,21 @@ func NewRolePermissionModel() *RolePermissionModel { } type UserModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index" comment:"更新时间" scenarios:"view;export"` - Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20" comment:"用户工号" props:"readonly:update" rule:"required;unique;regexp:^[a-zA-Z0-9]{3,8}$"` - Username string `json:"username" yaml:"username" xml:"username" gorm:"size:20" comment:"用户名称" rule:"required"` - Role string `json:"role" yaml:"role" xml:"role" gorm:"size:60;not null;default:''" comment:"所属角色" format:"role" rule:"required" live:"type:dropdown;url:/role/labels"` - Admin bool `json:"admin" yaml:"admin" xml:"admin" comment:"管理员" scenarios:"create"` - Status string `json:"status" yaml:"status" xml:"status" gorm:"size:20;default:normal" comment:"状态" scenarios:"create,update,list,search" enum:"normal:正常;disable:禁用"` - DeptId int64 `json:"dept_id" yaml:"deptId" xml:"deptId" gorm:"not null;default:0" comment:"所属部门" format:"department" rule:"required" live:"type:dropdown;url:/department/labels"` - Tag string `json:"tag" yaml:"tag" xml:"tag" gorm:"size:60" comment:"用户标签" scenarios:"list;create;update" live:"type:dropdown;url:/user/tags" dropdown:"created;filterable;default_first"` - Password string `json:"password" yaml:"password" xml:"password" gorm:"size:60" comment:"用户密码" scenarios:"create" rule:"required"` - Email string `json:"email" yaml:"email" xml:"email" gorm:"size:60" comment:"用户邮箱" scenarios:"create;update;view;list;export"` - Avatar string `json:"avatar" yaml:"avatar" xml:"avatar" gorm:"size:1024" comment:"用户头像" scenarios:"view"` - Gender string `json:"gender" yaml:"gender" xml:"gender" gorm:"size:20;default:man" comment:"用户性别" scenarios:"list;create;update;view;export" rule:"required" enum:"man:男;woman:女;other:其他"` - Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024" comment:"备注说明" scenarios:"create;update;view;export" format:"textarea"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index;column:updated_at" comment:"更新时间" scenarios:"view;export"` + Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20;column:uid" comment:"用户工号" props:"readonly:update" rule:"required;unique;regexp:^[a-zA-Z0-9]{3,8}$"` + Username string `json:"username" yaml:"username" xml:"username" gorm:"size:20;column:username" comment:"用户名称" rule:"required"` + Role string `json:"role" yaml:"role" xml:"role" gorm:"size:60;not null;default:'';column:role" comment:"所属角色" format:"role" rule:"required" live:"type:dropdown;url:/role/labels"` + Admin bool `json:"admin" yaml:"admin" xml:"admin" gorm:"column:admin" comment:"管理员" scenarios:"create"` + Status string `json:"status" yaml:"status" xml:"status" gorm:"size:20;default:normal;column:status" comment:"状态" scenarios:"create,update,list,search" enum:"normal:正常;disable:禁用"` + DeptId int64 `json:"dept_id" yaml:"deptId" xml:"deptId" gorm:"not null;default:0;column:dept_id" comment:"所属部门" format:"department" rule:"required" live:"type:dropdown;url:/department/labels"` + Tag string `json:"tag" yaml:"tag" xml:"tag" gorm:"size:60;column:tag" comment:"用户标签" scenarios:"list;create;update" live:"type:dropdown;url:/user/tags" dropdown:"created;filterable;default_first"` + Password string `json:"password" yaml:"password" xml:"password" gorm:"size:60;column:password" comment:"用户密码" scenarios:"create" rule:"required"` + Email string `json:"email" yaml:"email" xml:"email" gorm:"size:60;column:email" comment:"用户邮箱" scenarios:"create;update;view;list;export"` + Avatar string `json:"avatar" yaml:"avatar" xml:"avatar" gorm:"size:1024;column:avatar" comment:"用户头像" scenarios:"view"` + Gender string `json:"gender" yaml:"gender" xml:"gender" gorm:"size:20;default:man;column:gender" comment:"用户性别" scenarios:"list;create;update;view;export" rule:"required" enum:"man:男;woman:女;other:其他"` + Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"create;update;view;export" format:"textarea"` } func (m *UserModel) TableName() string { @@ -357,14 +357,14 @@ func (m *UserModel) Delete(db *gorm.DB) (err error) { } func (m *UserModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("description=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *UserModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *UserModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *UserModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *UserModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -373,12 +373,12 @@ func NewUserModel() *UserModel { } type DepartmentModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index" comment:"更新时间" scenarios:"view;export"` - ParentId int64 `json:"parent_id" yaml:"parentId" xml:"parentId" comment:"父级部门" format:"department" live:"type:dropdown;url:/department/level-labels"` - Name string `json:"name" yaml:"name" xml:"name" gorm:"size:20" comment:"部门名称" rule:"required"` - Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024" comment:"备注说明" scenarios:"create;update;view;export;list" format:"textarea"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"index;column:updated_at" comment:"更新时间" scenarios:"view;export"` + ParentId int64 `json:"parent_id" yaml:"parentId" xml:"parentId" gorm:"column:parent_id" comment:"父级部门" format:"department" live:"type:dropdown;url:/department/level-labels"` + Name string `json:"name" yaml:"name" xml:"name" gorm:"size:20;column:name" comment:"部门名称" rule:"required"` + Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"create;update;view;export;list" format:"textarea"` } func (m *DepartmentModel) TableName() string { @@ -422,14 +422,14 @@ func (m *DepartmentModel) Delete(db *gorm.DB) (err error) { } func (m *DepartmentModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("description=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *DepartmentModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *DepartmentModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *DepartmentModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *DepartmentModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } @@ -438,15 +438,15 @@ func NewDepartmentModel() *DepartmentModel { } type LoginModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"登录时间" scenarios:"list;search;view;export"` - Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20" comment:"用户" format:"user" props:"readonly:update" rule:"required"` - Ip string `json:"ip" yaml:"ip" xml:"ip" gorm:"size:128" comment:"登录地址" scenarios:"list;search;view;export"` - Browser string `json:"browser" yaml:"browser" xml:"browser" gorm:"size:128" comment:"浏览器" scenarios:"list;view;export"` - Os string `json:"os" yaml:"os" xml:"os" gorm:"size:128" comment:"操作系统" scenarios:"list;view;export"` - Platform string `json:"platform" yaml:"platform" xml:"platform" gorm:"size:128" comment:"系统平台" scenarios:"list;view;export"` - AccessToken string `json:"access_token" yaml:"accessToken" xml:"accessToken" gorm:"size:1024" comment:"访问令牌" scenarios:"list;view;export"` - UserAgent string `json:"user_agent" yaml:"userAgent" xml:"userAgent" gorm:"size:1024" comment:"用户代理" scenarios:"list;view;export"` + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"登录时间" scenarios:"list;search;view;export"` + Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20;column:uid" comment:"用户" format:"user" props:"readonly:update" rule:"required"` + Ip string `json:"ip" yaml:"ip" xml:"ip" gorm:"size:128;column:ip" comment:"登录地址" scenarios:"list;search;view;export"` + Browser string `json:"browser" yaml:"browser" xml:"browser" gorm:"size:128;column:browser" comment:"浏览器" scenarios:"list;view;export"` + Os string `json:"os" yaml:"os" xml:"os" gorm:"size:128;column:os" comment:"操作系统" scenarios:"list;view;export"` + Platform string `json:"platform" yaml:"platform" xml:"platform" gorm:"size:128;column:platform" comment:"系统平台" scenarios:"list;view;export"` + AccessToken string `json:"access_token" yaml:"accessToken" xml:"accessToken" gorm:"size:1024;column:access_token" comment:"访问令牌" scenarios:"list;view;export"` + UserAgent string `json:"user_agent" yaml:"userAgent" xml:"userAgent" gorm:"size:1024;column:user_agent" comment:"用户代理" scenarios:"list;view;export"` } func (m *LoginModel) TableName() string { @@ -496,150 +496,17 @@ func (m *LoginModel) Delete(db *gorm.DB) (err error) { } func (m *LoginModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("user_agent=?", pk).First(m).Error + return db.Where("id=?", pk).First(m).Error } -func (m *LoginModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { +func (m *LoginModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).First(m).Error } -func (m *LoginModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { +func (m *LoginModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { return db.Where(query, args...).Find(m).Error } func NewLoginModel() *LoginModel { return &LoginModel{} } - -type SettingModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"search;view;export"` - UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" comment:"更新时间" scenarios:"search;view;export"` - Name string `json:"name" yaml:"name" xml:"name" gorm:"size:60" comment:"配置项" props:"readonly:update" rule:"required"` - Value string `json:"value" yaml:"value" xml:"value" gorm:"size:512" comment:"配置值" format:"textarea" rule:"required"` - Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024" comment:"备注说明" scenarios:"create;update;view;export" format:"textarea"` -} - -func (m *SettingModel) TableName() string { - return "settings" -} - -func (m *SettingModel) FromValue(x *Setting) { - m.Id = x.Id - m.CreatedAt = x.CreatedAt - m.UpdatedAt = x.UpdatedAt - m.Name = x.Name - m.Value = x.Value - m.Description = x.Description -} - -func (m *SettingModel) ToValue() (x *Setting) { - x = &Setting{} - x.Id = m.Id - x.CreatedAt = m.CreatedAt - x.UpdatedAt = m.UpdatedAt - x.Name = m.Name - x.Value = m.Value - x.Description = m.Description - return x -} - -func (m *SettingModel) Create(db *gorm.DB) (err error) { - return db.Create(m).Error -} - -func (m *SettingModel) UpdateColumn(db *gorm.DB, column string, value any) (err error) { - return db.Model(m).UpdateColumn(column, value).Error -} - -func (m *SettingModel) Save(db *gorm.DB) (err error) { - return db.Save(m).Error -} - -func (m *SettingModel) Delete(db *gorm.DB) (err error) { - return db.Delete(m).Error -} - -func (m *SettingModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("description=?", pk).First(m).Error -} - -func (m *SettingModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { - return db.Where(query, args...).First(m).Error -} - -func (m *SettingModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { - return db.Where(query, args...).Find(m).Error -} - -func NewSettingModel() *SettingModel { - return &SettingModel{} -} - -type ActivityModel struct { - Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey" comment:"ID"` - CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" comment:"创建时间" scenarios:"search;search;view;export"` - Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20" comment:"用户" format:"user" props:"readonly:update" rule:"required"` - Action string `json:"action" yaml:"action" xml:"action" gorm:"index;size:20;not null;default:''" comment:"行为" scenarios:"search;list;create;update;view;export" props:"match:exactly" enum:"create:新建#198754;update:更新#f09d00;delete:删除#e63757"` - Module string `json:"module" yaml:"module" xml:"module" gorm:"size:60;not null;default:''" comment:"模块" scenarios:"search;list;create;update;view;export"` - Table string `json:"table" yaml:"table" xml:"table" gorm:"size:60;not null;default:''" comment:"数据" scenarios:"list;create;update;view;export"` - Data string `json:"data" yaml:"data" xml:"data" gorm:"size:10240;not null;default:''" comment:"内容" scenarios:"list;create;update;view;export"` -} - -func (m *ActivityModel) TableName() string { - return "activities" -} - -func (m *ActivityModel) FromValue(x *Activity) { - m.Id = x.Id - m.CreatedAt = x.CreatedAt - m.Uid = x.Uid - m.Action = x.Action - m.Module = x.Module - m.Table = x.Table - m.Data = x.Data -} - -func (m *ActivityModel) ToValue() (x *Activity) { - x = &Activity{} - x.Id = m.Id - x.CreatedAt = m.CreatedAt - x.Uid = m.Uid - x.Action = m.Action - x.Module = m.Module - x.Table = m.Table - x.Data = m.Data - return x -} - -func (m *ActivityModel) Create(db *gorm.DB) (err error) { - return db.Create(m).Error -} - -func (m *ActivityModel) UpdateColumn(db *gorm.DB, column string, value any) (err error) { - return db.Model(m).UpdateColumn(column, value).Error -} - -func (m *ActivityModel) Save(db *gorm.DB) (err error) { - return db.Save(m).Error -} - -func (m *ActivityModel) Delete(db *gorm.DB) (err error) { - return db.Delete(m).Error -} - -func (m *ActivityModel) Find(db *gorm.DB, pk any) (err error) { - return db.Where("data=?", pk).First(m).Error -} - -func (m *ActivityModel) FindOne(db *gorm.DB, query any, args ...any) (err error) { - return db.Where(query, args...).First(m).Error -} - -func (m *ActivityModel) FindAll(db *gorm.DB, query any, args ...any) (err error) { - return db.Where(query, args...).Find(m).Error -} - -func NewActivityModel() *ActivityModel { - return &ActivityModel{} -} diff --git a/pb/system.pb.go b/pb/system.pb.go new file mode 100644 index 0000000..fd75cac --- /dev/null +++ b/pb/system.pb.go @@ -0,0 +1,440 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v5.29.3 +// source: system.proto + +package pb + +import ( + _ "git.nobla.cn/golang/aeus/pkg/proto/rest" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Setting 参数设置表 +type Setting struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Setting) Reset() { + *x = Setting{} + mi := &file_system_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Setting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Setting) ProtoMessage() {} + +func (x *Setting) ProtoReflect() protoreflect.Message { + mi := &file_system_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Setting.ProtoReflect.Descriptor instead. +func (*Setting) Descriptor() ([]byte, []int) { + return file_system_proto_rawDescGZIP(), []int{0} +} + +func (x *Setting) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Setting) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Setting) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *Setting) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Setting) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Setting) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +// Activity 活动记录 +type Activity struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` + Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + Module string `protobuf:"bytes,5,opt,name=module,proto3" json:"module,omitempty"` + Table string `protobuf:"bytes,6,opt,name=table,proto3" json:"table,omitempty"` + Data string `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Activity) Reset() { + *x = Activity{} + mi := &file_system_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Activity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Activity) ProtoMessage() {} + +func (x *Activity) ProtoReflect() protoreflect.Message { + mi := &file_system_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Activity.ProtoReflect.Descriptor instead. +func (*Activity) Descriptor() ([]byte, []int) { + return file_system_proto_rawDescGZIP(), []int{1} +} + +func (x *Activity) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Activity) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Activity) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *Activity) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *Activity) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *Activity) GetTable() string { + if x != nil { + return x.Table + } + return "" +} + +func (x *Activity) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +type SettingItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SettingItem) Reset() { + *x = SettingItem{} + mi := &file_system_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SettingItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SettingItem) ProtoMessage() {} + +func (x *SettingItem) ProtoReflect() protoreflect.Message { + mi := &file_system_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SettingItem.ProtoReflect.Descriptor instead. +func (*SettingItem) Descriptor() ([]byte, []int) { + return file_system_proto_rawDescGZIP(), []int{2} +} + +func (x *SettingItem) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SettingItem) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GetSettingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSettingRequest) Reset() { + *x = GetSettingRequest{} + mi := &file_system_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSettingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSettingRequest) ProtoMessage() {} + +func (x *GetSettingRequest) ProtoReflect() protoreflect.Message { + mi := &file_system_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSettingRequest.ProtoReflect.Descriptor instead. +func (*GetSettingRequest) Descriptor() ([]byte, []int) { + return file_system_proto_rawDescGZIP(), []int{3} +} + +type GetSettingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []*SettingItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSettingResponse) Reset() { + *x = GetSettingResponse{} + mi := &file_system_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSettingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSettingResponse) ProtoMessage() {} + +func (x *GetSettingResponse) ProtoReflect() protoreflect.Message { + mi := &file_system_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSettingResponse.ProtoReflect.Descriptor instead. +func (*GetSettingResponse) Descriptor() ([]byte, []int) { + return file_system_proto_rawDescGZIP(), []int{4} +} + +func (x *GetSettingResponse) GetData() []*SettingItem { + if x != nil { + return x.Data + } + return nil +} + +var File_system_proto protoreflect.FileDescriptor + +const file_system_proto_rawDesc = "" + + "\n" + + "\fsystem.proto\x12\x06system\x1a\x0faeus/rest.proto\x1a\x17validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1cgoogle/api/annotations.proto\"\xd8\x03\n" + + "\aSetting\x12$\n" + + "\x02id\x18\x01 \x01(\x03B\x14\xb2\xb9\x19\x10\n" + + "\n" + + "primaryKey\x12\x02IDR\x02id\x12E\n" + + "\n" + + "created_at\x18\x02 \x01(\x03B&\xb2\xb9\x19\"\x12\f创建时间\x1a\x12search;view;exportR\tcreatedAt\x12E\n" + + "\n" + + "updated_at\x18\x03 \x01(\x03B&\xb2\xb9\x19\"\x12\f更新时间\x1a\x12search;view;exportR\tupdatedAt\x12N\n" + + "\x04name\x18\x04 \x01(\tB:\xfaB\x04r\x02\x18\x14\xb2\xb9\x19/\n" + + "\asize:60\x12\t配置项2\x0freadonly:update:\brequiredR\x04name\x12K\n" + + "\x05value\x18\x05 \x01(\tB5\xfaB\x05r\x03\x18\x80\x04\xb2\xb9\x19)\n" + + "\bsize:512\x12\t配置值*\btextarea:\brequiredR\x05value\x12l\n" + + "\vdescription\x18\x06 \x01(\tBJ\xfaB\x05r\x03\x18\x80\b\xb2\xb9\x19>\n" + + "\tsize:1024\x12\f备注说明\x1a\x19create;update;view;export*\btextareaR\vdescription:\x0e\xba\xb9\x19\n" + + "\n" + + "\bsettings\"\xd8\x05\n" + + "\bActivity\x12$\n" + + "\x02id\x18\x01 \x01(\x03B\x14\xb2\xb9\x19\x10\n" + + "\n" + + "primaryKey\x12\x02IDR\x02id\x12L\n" + + "\n" + + "created_at\x18\x02 \x01(\x03B-\xb2\xb9\x19)\x12\f创建时间\x1a\x19search;search;view;exportR\tcreatedAt\x12W\n" + + "\x03uid\x18\x03 \x01(\tBE\xfaB\x06r\x04\x10\x05\x18\x14\xb2\xb9\x198\n" + + "\rindex;size:20\x12\x06用户*\x04user2\x0freadonly:update:\brequiredR\x03uid\x12\xbf\x01\n" + + "\x06action\x18\x04 \x01(\tB\xa6\x01\xb2\xb9\x19\xa1\x01\n" + + "!index;size:20;not null;default:''\x12\x06行为\x1a%search;list;create;update;view;export2\rmatch:exactlyR>create:新建#198754;update:更新#f09d00;delete:删除#e63757R\x06action\x12h\n" + + "\x06module\x18\x05 \x01(\tBP\xb2\xb9\x19L\n" + + "\x1bsize:60;not null;default:''\x12\x06模块\x1a%search;list;create;update;view;exportR\x06module\x12_\n" + + "\x05table\x18\x06 \x01(\tBI\xb2\xb9\x19E\n" + + "\x1bsize:60;not null;default:''\x12\x06数据\x1a\x1elist;create;update;view;exportR\x05table\x12`\n" + + "\x04data\x18\a \x01(\tBL\xb2\xb9\x19H\n" + + "\x1esize:10240;not null;default:''\x12\x06内容\x1a\x1elist;create;update;view;exportR\x04data:\x10\xba\xb9\x19\f\n" + + "\n" + + "activities\"7\n" + + "\vSettingItem\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"\x13\n" + + "\x11GetSettingRequest\"=\n" + + "\x12GetSettingResponse\x12'\n" + + "\x04data\x18\x01 \x03(\v2\x13.system.SettingItemR\x04data2n\n" + + "\x0eSettingService\x12\\\n" + + "\n" + + "GetSetting\x12\x19.system.GetSettingRequest\x1a\x1a.system.GetSettingResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/system/settingB&Z$git.nobla.cn/golang/aeis-admin/pb;pbb\x06proto3" + +var ( + file_system_proto_rawDescOnce sync.Once + file_system_proto_rawDescData []byte +) + +func file_system_proto_rawDescGZIP() []byte { + file_system_proto_rawDescOnce.Do(func() { + file_system_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_system_proto_rawDesc), len(file_system_proto_rawDesc))) + }) + return file_system_proto_rawDescData +} + +var file_system_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_system_proto_goTypes = []any{ + (*Setting)(nil), // 0: system.Setting + (*Activity)(nil), // 1: system.Activity + (*SettingItem)(nil), // 2: system.SettingItem + (*GetSettingRequest)(nil), // 3: system.GetSettingRequest + (*GetSettingResponse)(nil), // 4: system.GetSettingResponse +} +var file_system_proto_depIdxs = []int32{ + 2, // 0: system.GetSettingResponse.data:type_name -> system.SettingItem + 3, // 1: system.SettingService.GetSetting:input_type -> system.GetSettingRequest + 4, // 2: system.SettingService.GetSetting:output_type -> system.GetSettingResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_system_proto_init() } +func file_system_proto_init() { + if File_system_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_system_proto_rawDesc), len(file_system_proto_rawDesc)), + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_system_proto_goTypes, + DependencyIndexes: file_system_proto_depIdxs, + MessageInfos: file_system_proto_msgTypes, + }.Build() + File_system_proto = out.File + file_system_proto_goTypes = nil + file_system_proto_depIdxs = nil +} diff --git a/pb/system.pb.validate.go b/pb/system.pb.validate.go new file mode 100644 index 0000000..fd84a1f --- /dev/null +++ b/pb/system.pb.validate.go @@ -0,0 +1,636 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: system.proto + +package pb + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Setting with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Setting) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Setting with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in SettingMultiError, or nil if none found. +func (m *Setting) ValidateAll() error { + return m.validate(true) +} + +func (m *Setting) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for CreatedAt + + // no validation rules for UpdatedAt + + if utf8.RuneCountInString(m.GetName()) > 20 { + err := SettingValidationError{ + field: "Name", + reason: "value length must be at most 20 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if utf8.RuneCountInString(m.GetValue()) > 512 { + err := SettingValidationError{ + field: "Value", + reason: "value length must be at most 512 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if utf8.RuneCountInString(m.GetDescription()) > 1024 { + err := SettingValidationError{ + field: "Description", + reason: "value length must be at most 1024 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return SettingMultiError(errors) + } + + return nil +} + +// SettingMultiError is an error wrapping multiple validation errors returned +// by Setting.ValidateAll() if the designated constraints aren't met. +type SettingMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SettingMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SettingMultiError) AllErrors() []error { return m } + +// SettingValidationError is the validation error returned by Setting.Validate +// if the designated constraints aren't met. +type SettingValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SettingValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SettingValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SettingValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SettingValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SettingValidationError) ErrorName() string { return "SettingValidationError" } + +// Error satisfies the builtin error interface +func (e SettingValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSetting.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SettingValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SettingValidationError{} + +// Validate checks the field values on Activity with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Activity) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Activity with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in ActivityMultiError, or nil +// if none found. +func (m *Activity) ValidateAll() error { + return m.validate(true) +} + +func (m *Activity) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for CreatedAt + + if l := utf8.RuneCountInString(m.GetUid()); l < 5 || l > 20 { + err := ActivityValidationError{ + field: "Uid", + reason: "value length must be between 5 and 20 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for Action + + // no validation rules for Module + + // no validation rules for Table + + // no validation rules for Data + + if len(errors) > 0 { + return ActivityMultiError(errors) + } + + return nil +} + +// ActivityMultiError is an error wrapping multiple validation errors returned +// by Activity.ValidateAll() if the designated constraints aren't met. +type ActivityMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ActivityMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ActivityMultiError) AllErrors() []error { return m } + +// ActivityValidationError is the validation error returned by +// Activity.Validate if the designated constraints aren't met. +type ActivityValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ActivityValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ActivityValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ActivityValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ActivityValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ActivityValidationError) ErrorName() string { return "ActivityValidationError" } + +// Error satisfies the builtin error interface +func (e ActivityValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sActivity.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ActivityValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ActivityValidationError{} + +// Validate checks the field values on SettingItem with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *SettingItem) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SettingItem with the rules defined in +// the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in SettingItemMultiError, or +// nil if none found. +func (m *SettingItem) ValidateAll() error { + return m.validate(true) +} + +func (m *SettingItem) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Name + + // no validation rules for Value + + if len(errors) > 0 { + return SettingItemMultiError(errors) + } + + return nil +} + +// SettingItemMultiError is an error wrapping multiple validation errors +// returned by SettingItem.ValidateAll() if the designated constraints aren't met. +type SettingItemMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SettingItemMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SettingItemMultiError) AllErrors() []error { return m } + +// SettingItemValidationError is the validation error returned by +// SettingItem.Validate if the designated constraints aren't met. +type SettingItemValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SettingItemValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SettingItemValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SettingItemValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SettingItemValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SettingItemValidationError) ErrorName() string { return "SettingItemValidationError" } + +// Error satisfies the builtin error interface +func (e SettingItemValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSettingItem.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SettingItemValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SettingItemValidationError{} + +// Validate checks the field values on GetSettingRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *GetSettingRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetSettingRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetSettingRequestMultiError, or nil if none found. +func (m *GetSettingRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetSettingRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return GetSettingRequestMultiError(errors) + } + + return nil +} + +// GetSettingRequestMultiError is an error wrapping multiple validation errors +// returned by GetSettingRequest.ValidateAll() if the designated constraints +// aren't met. +type GetSettingRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetSettingRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetSettingRequestMultiError) AllErrors() []error { return m } + +// GetSettingRequestValidationError is the validation error returned by +// GetSettingRequest.Validate if the designated constraints aren't met. +type GetSettingRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetSettingRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetSettingRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetSettingRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetSettingRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetSettingRequestValidationError) ErrorName() string { + return "GetSettingRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetSettingRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetSettingRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetSettingRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetSettingRequestValidationError{} + +// Validate checks the field values on GetSettingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetSettingResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetSettingResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetSettingResponseMultiError, or nil if none found. +func (m *GetSettingResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetSettingResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetData() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetSettingResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetSettingResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetSettingResponseValidationError{ + field: fmt.Sprintf("Data[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetSettingResponseMultiError(errors) + } + + return nil +} + +// GetSettingResponseMultiError is an error wrapping multiple validation errors +// returned by GetSettingResponse.ValidateAll() if the designated constraints +// aren't met. +type GetSettingResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetSettingResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetSettingResponseMultiError) AllErrors() []error { return m } + +// GetSettingResponseValidationError is the validation error returned by +// GetSettingResponse.Validate if the designated constraints aren't met. +type GetSettingResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetSettingResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetSettingResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetSettingResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetSettingResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetSettingResponseValidationError) ErrorName() string { + return "GetSettingResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetSettingResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetSettingResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetSettingResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetSettingResponseValidationError{} diff --git a/pb/system.proto b/pb/system.proto new file mode 100644 index 0000000..1036db0 --- /dev/null +++ b/pb/system.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package system; + +import "aeus/rest.proto"; +import "validate/validate.proto"; +import "google/protobuf/descriptor.proto"; +import "google/api/annotations.proto"; + +option go_package = "git.nobla.cn/golang/aeis-admin/pb;pb"; + + +// Setting 参数设置表 +message Setting { + option (aeus.rest) = { + table: "settings" + }; + int64 id = 1 [(aeus.field) = {gorm:"primaryKey",comment:"ID"}]; + int64 created_at = 2 [(aeus.field)={scenarios:"search;view;export",comment:"创建时间"}]; + int64 updated_at = 3 [(aeus.field)={scenarios:"search;view;export",comment:"更新时间"}]; + string name = 4 [(aeus.field)={gorm:"size:60",rule:"required",props:"readonly:update",comment: "配置项"},(validate.rules).string = {max_len: 20}]; + string value = 5 [(aeus.field)={gorm:"size:512",rule:"required",format:"textarea",comment: "配置值"},(validate.rules).string = {max_len: 512}]; + string description = 6 [(aeus.field)={gorm:"size:1024",format:"textarea",scenarios:"create;update;view;export",comment: "备注说明"},(validate.rules).string = {max_len: 1024}]; +} + + +// Activity 活动记录 +message Activity { + option (aeus.rest) = { + table: "activities" + }; + int64 id = 1 [(aeus.field) = {gorm:"primaryKey",comment:"ID"}]; + int64 created_at = 2 [(aeus.field)={scenarios:"search;search;view;export",comment:"创建时间"}]; + string uid = 3 [(aeus.field)={gorm:"index;size:20",rule:"required",props:"readonly:update",format:"user",comment: "用户"},(validate.rules).string = {min_len: 5, max_len: 20}]; + string action = 4 [(aeus.field)={props:"match:exactly",gorm:"index;size:20;not null;default:''",comment:"行为",enum:"create:新建#198754;update:更新#f09d00;delete:删除#e63757",scenarios:"search;list;create;update;view;export"}]; + string module = 5 [(aeus.field)={gorm:"size:60;not null;default:''",comment:"模块",scenarios:"search;list;create;update;view;export"}]; + string table = 6 [(aeus.field)={gorm:"size:60;not null;default:''",comment:"数据",scenarios:"list;create;update;view;export"}]; + string data = 7 [(aeus.field)={gorm:"size:10240;not null;default:''",comment:"内容",scenarios:"list;create;update;view;export"}]; +} + + +message SettingItem { + string name = 1; + string value = 2; +} + +message GetSettingRequest{} + +message GetSettingResponse{ + repeated SettingItem data = 1; +} + +service SettingService { + rpc GetSetting(GetSettingRequest) returns (GetSettingResponse) { + option (google.api.http) = { + get: "/system/setting" + }; + } +} \ No newline at end of file diff --git a/pb/system_grpc.pb.go b/pb/system_grpc.pb.go new file mode 100644 index 0000000..d6a5a4f --- /dev/null +++ b/pb/system_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: system.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + SettingService_GetSetting_FullMethodName = "/system.SettingService/GetSetting" +) + +// SettingServiceClient is the client API for SettingService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SettingServiceClient interface { + GetSetting(ctx context.Context, in *GetSettingRequest, opts ...grpc.CallOption) (*GetSettingResponse, error) +} + +type settingServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSettingServiceClient(cc grpc.ClientConnInterface) SettingServiceClient { + return &settingServiceClient{cc} +} + +func (c *settingServiceClient) GetSetting(ctx context.Context, in *GetSettingRequest, opts ...grpc.CallOption) (*GetSettingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSettingResponse) + err := c.cc.Invoke(ctx, SettingService_GetSetting_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SettingServiceServer is the server API for SettingService service. +// All implementations must embed UnimplementedSettingServiceServer +// for forward compatibility. +type SettingServiceServer interface { + GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) + mustEmbedUnimplementedSettingServiceServer() +} + +// UnimplementedSettingServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedSettingServiceServer struct{} + +func (UnimplementedSettingServiceServer) GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSetting not implemented") +} +func (UnimplementedSettingServiceServer) mustEmbedUnimplementedSettingServiceServer() {} +func (UnimplementedSettingServiceServer) testEmbeddedByValue() {} + +// UnsafeSettingServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SettingServiceServer will +// result in compilation errors. +type UnsafeSettingServiceServer interface { + mustEmbedUnimplementedSettingServiceServer() +} + +func RegisterSettingServiceServer(s grpc.ServiceRegistrar, srv SettingServiceServer) { + // If the following call pancis, it indicates UnimplementedSettingServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&SettingService_ServiceDesc, srv) +} + +func _SettingService_GetSetting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSettingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SettingServiceServer).GetSetting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SettingService_GetSetting_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SettingServiceServer).GetSetting(ctx, req.(*GetSettingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SettingService_ServiceDesc is the grpc.ServiceDesc for SettingService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SettingService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "system.SettingService", + HandlerType: (*SettingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSetting", + Handler: _SettingService_GetSetting_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "system.proto", +} diff --git a/pb/system_http.pb.go b/pb/system_http.pb.go new file mode 100644 index 0000000..f21648a --- /dev/null +++ b/pb/system_http.pb.go @@ -0,0 +1,38 @@ +// Code generated by protoc-gen-go-aeus. DO NOT EDIT. +// source: system.proto +// date: 2025-06-18 15:37:30 + +package pb + +import ( + "git.nobla.cn/golang/aeus/transport/http" + "context" + "git.nobla.cn/golang/aeus/pkg/errors" +) + +type SettingServiceHttpServer interface { + GetSetting(context.Context, *GetSettingRequest) (*GetSettingResponse, error) +} + +func handleSettingServiceGetSetting(s SettingServiceHttpServer) http.HandleFunc { + return func(ctx *http.Context) (err error) { + req := &GetSettingRequest{} + + if res, err := s.GetSetting(ctx.Context(), req); err != nil { + if er, ok := err.(*errors.Error); ok { + return ctx.Error(er.Code, er.Message) + } else { + return ctx.Error(errors.Unavailable, err.Error()) + } + } else { + return ctx.Success(res) + } + } +} + +func RegisterSettingServiceRouter(hs *http.Server, s SettingServiceHttpServer) { + + // Register handle GetSetting route + hs.GET("/system/setting", handleSettingServiceGetSetting(s)) + +} diff --git a/pb/system_model.pb.go b/pb/system_model.pb.go new file mode 100644 index 0000000..f7daf4a --- /dev/null +++ b/pb/system_model.pb.go @@ -0,0 +1,142 @@ +// Code generated by protoc-gen-go-aeus. DO NOT EDIT. +// source: system.proto +// date: 2025-06-18 15:37:30 + +package pb + +import ( + "gorm.io/gorm" +) + +type SettingModel struct { + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"search;view;export"` + UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"column:updated_at" comment:"更新时间" scenarios:"search;view;export"` + Name string `json:"name" yaml:"name" xml:"name" gorm:"size:60;column:name" comment:"配置项" props:"readonly:update" rule:"required"` + Value string `json:"value" yaml:"value" xml:"value" gorm:"size:512;column:value" comment:"配置值" format:"textarea" rule:"required"` + Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"create;update;view;export" format:"textarea"` +} + +func (m *SettingModel) TableName() string { + return "settings" +} + +func (m *SettingModel) FromValue(x *Setting) { + m.Id = x.Id + m.CreatedAt = x.CreatedAt + m.UpdatedAt = x.UpdatedAt + m.Name = x.Name + m.Value = x.Value + m.Description = x.Description +} + +func (m *SettingModel) ToValue() (x *Setting) { + x = &Setting{} + x.Id = m.Id + x.CreatedAt = m.CreatedAt + x.UpdatedAt = m.UpdatedAt + x.Name = m.Name + x.Value = m.Value + x.Description = m.Description + return x +} + +func (m *SettingModel) Create(db *gorm.DB) (err error) { + return db.Create(m).Error +} + +func (m *SettingModel) UpdateColumn(db *gorm.DB, column string, value any) (err error) { + return db.Model(m).UpdateColumn(column, value).Error +} + +func (m *SettingModel) Save(db *gorm.DB) (err error) { + return db.Save(m).Error +} + +func (m *SettingModel) Delete(db *gorm.DB) (err error) { + return db.Delete(m).Error +} + +func (m *SettingModel) Find(db *gorm.DB, pk any) (err error) { + return db.Where("id=?", pk).First(m).Error +} + +func (m *SettingModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { + return db.Where(query, args...).First(m).Error +} + +func (m *SettingModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { + return db.Where(query, args...).Find(m).Error +} + +func NewSettingModel() *SettingModel { + return &SettingModel{} +} + +type ActivityModel struct { + Id int64 `json:"id" yaml:"id" xml:"id" gorm:"primaryKey;column:id" comment:"ID"` + CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"search;search;view;export"` + Uid string `json:"uid" yaml:"uid" xml:"uid" gorm:"index;size:20;column:uid" comment:"用户" format:"user" props:"readonly:update" rule:"required"` + Action string `json:"action" yaml:"action" xml:"action" gorm:"index;size:20;not null;default:'';column:action" comment:"行为" scenarios:"search;list;create;update;view;export" props:"match:exactly" enum:"create:新建#198754;update:更新#f09d00;delete:删除#e63757"` + Module string `json:"module" yaml:"module" xml:"module" gorm:"size:60;not null;default:'';column:module" comment:"模块" scenarios:"search;list;create;update;view;export"` + Table string `json:"table" yaml:"table" xml:"table" gorm:"size:60;not null;default:'';column:table" comment:"数据" scenarios:"list;create;update;view;export"` + Data string `json:"data" yaml:"data" xml:"data" gorm:"size:10240;not null;default:'';column:data" comment:"内容" scenarios:"list;create;update;view;export"` +} + +func (m *ActivityModel) TableName() string { + return "activities" +} + +func (m *ActivityModel) FromValue(x *Activity) { + m.Id = x.Id + m.CreatedAt = x.CreatedAt + m.Uid = x.Uid + m.Action = x.Action + m.Module = x.Module + m.Table = x.Table + m.Data = x.Data +} + +func (m *ActivityModel) ToValue() (x *Activity) { + x = &Activity{} + x.Id = m.Id + x.CreatedAt = m.CreatedAt + x.Uid = m.Uid + x.Action = m.Action + x.Module = m.Module + x.Table = m.Table + x.Data = m.Data + return x +} + +func (m *ActivityModel) Create(db *gorm.DB) (err error) { + return db.Create(m).Error +} + +func (m *ActivityModel) UpdateColumn(db *gorm.DB, column string, value any) (err error) { + return db.Model(m).UpdateColumn(column, value).Error +} + +func (m *ActivityModel) Save(db *gorm.DB) (err error) { + return db.Save(m).Error +} + +func (m *ActivityModel) Delete(db *gorm.DB) (err error) { + return db.Delete(m).Error +} + +func (m *ActivityModel) Find(db *gorm.DB, pk any) (err error) { + return db.Where("id=?", pk).First(m).Error +} + +func (m *ActivityModel) QueryOne(db *gorm.DB, query any, args ...any) (err error) { + return db.Where(query, args...).First(m).Error +} + +func (m *ActivityModel) QueryAll(db *gorm.DB, query any, args ...any) (err error) { + return db.Where(query, args...).Find(m).Error +} + +func NewActivityModel() *ActivityModel { + return &ActivityModel{} +} diff --git a/service/auth.go b/service/auth.go index 49352c2..ebe64e5 100644 --- a/service/auth.go +++ b/service/auth.go @@ -129,7 +129,7 @@ func (s *AuthService) Login(ctx context.Context, req *pb.LoginRequest) (res *pb. if err = s.turnstileValidate(ctx, req.Token); err != nil { return nil, errors.Format(errors.Invalid, err.Error()) } - if err = model.FindOne(tx, "uid=?", req.Username); err != nil { + if err = model.QueryOne(tx, "uid=?", req.Username); err != nil { return nil, errors.ErrAccessDenied } if model.Status != types.UserStatusNormal {