diff --git a/admin/admin/admin.pb.go b/admin/admin/admin.pb.go index 4dea461..a6a7b2c 100644 --- a/admin/admin/admin.pb.go +++ b/admin/admin/admin.pb.go @@ -9,6 +9,7 @@ package admin import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -21,28 +22,33 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type AddRequest struct { +type AdminEditRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Pwd string `protobuf:"bytes,2,opt,name=pwd,proto3" json:"pwd,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` + Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` + Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` + Roles []int64 `protobuf:"varint,7,rep,packed,name=roles,proto3" json:"roles,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *AddRequest) Reset() { - *x = AddRequest{} +func (x *AdminEditRequest) Reset() { + *x = AdminEditRequest{} mi := &file_proto_admin_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *AddRequest) String() string { +func (x *AdminEditRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddRequest) ProtoMessage() {} +func (*AdminEditRequest) ProtoMessage() {} -func (x *AddRequest) ProtoReflect() protoreflect.Message { +func (x *AdminEditRequest) ProtoReflect() protoreflect.Message { mi := &file_proto_admin_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -54,88 +60,72 @@ func (x *AddRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddRequest.ProtoReflect.Descriptor instead. -func (*AddRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use AdminEditRequest.ProtoReflect.Descriptor instead. +func (*AdminEditRequest) Descriptor() ([]byte, []int) { return file_proto_admin_proto_rawDescGZIP(), []int{0} } -func (x *AddRequest) GetName() string { +func (x *AdminEditRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdminEditRequest) GetName() string { if x != nil { return x.Name } return "" } -func (x *AddRequest) GetPwd() string { +func (x *AdminEditRequest) GetPassword() string { if x != nil { - return x.Pwd + return x.Password } return "" } -type EditRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Pwd string `protobuf:"bytes,2,opt,name=pwd,proto3" json:"pwd,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EditRequest) Reset() { - *x = EditRequest{} - mi := &file_proto_admin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EditRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EditRequest) ProtoMessage() {} - -func (x *EditRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_admin_proto_msgTypes[1] +func (x *AdminEditRequest) GetAvatar() string { 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 EditRequest.ProtoReflect.Descriptor instead. -func (*EditRequest) Descriptor() ([]byte, []int) { - return file_proto_admin_proto_rawDescGZIP(), []int{1} -} - -func (x *EditRequest) GetName() string { - if x != nil { - return x.Name + return x.Avatar } return "" } -func (x *EditRequest) GetPwd() string { +func (x *AdminEditRequest) GetPhone() string { if x != nil { - return x.Pwd + return x.Phone } return "" } +func (x *AdminEditRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *AdminEditRequest) GetRoles() []int64 { + if x != nil { + return x.Roles + } + return nil +} + type StatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Pwd string `protobuf:"bytes,2,opt,name=pwd,proto3" json:"pwd,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_proto_admin_proto_msgTypes[2] + mi := &file_proto_admin_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -147,7 +137,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_admin_proto_msgTypes[2] + mi := &file_proto_admin_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -160,19 +150,26 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_proto_admin_proto_rawDescGZIP(), []int{2} + return file_proto_admin_proto_rawDescGZIP(), []int{1} } -func (x *StatusRequest) GetName() string { +func (x *StatusRequest) GetId() int64 { if x != nil { - return x.Name + return x.Id } - return "" + return 0 } -func (x *StatusRequest) GetPwd() string { +func (x *StatusRequest) GetStatus() int32 { if x != nil { - return x.Pwd + return x.Status + } + return 0 +} + +func (x *StatusRequest) GetReason() string { + if x != nil { + return x.Reason } return "" } @@ -181,14 +178,14 @@ type Response struct { state protoimpl.MessageState `protogen:"open.v1"` Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Data *anypb.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Response) Reset() { *x = Response{} - mi := &file_proto_admin_proto_msgTypes[3] + mi := &file_proto_admin_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -200,7 +197,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_proto_admin_proto_msgTypes[3] + mi := &file_proto_admin_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -213,7 +210,7 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_proto_admin_proto_rawDescGZIP(), []int{3} + return file_proto_admin_proto_rawDescGZIP(), []int{2} } func (x *Response) GetCode() int32 { @@ -230,36 +227,338 @@ func (x *Response) GetMsg() string { return "" } -func (x *Response) GetData() string { +func (x *Response) GetData() *anypb.Any { if x != nil { return x.Data } + return nil +} + +type PasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PasswordRequest) Reset() { + *x = PasswordRequest{} + mi := &file_proto_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PasswordRequest) ProtoMessage() {} + +func (x *PasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_admin_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 PasswordRequest.ProtoReflect.Descriptor instead. +func (*PasswordRequest) Descriptor() ([]byte, []int) { + return file_proto_admin_proto_rawDescGZIP(), []int{3} +} + +func (x *PasswordRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } return "" } +type OwnPasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OwnPasswordRequest) Reset() { + *x = OwnPasswordRequest{} + mi := &file_proto_admin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OwnPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OwnPasswordRequest) ProtoMessage() {} + +func (x *OwnPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_admin_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 OwnPasswordRequest.ProtoReflect.Descriptor instead. +func (*OwnPasswordRequest) Descriptor() ([]byte, []int) { + return file_proto_admin_proto_rawDescGZIP(), []int{4} +} + +func (x *OwnPasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type AdminInfoRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminInfoRequest) Reset() { + *x = AdminInfoRequest{} + mi := &file_proto_admin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminInfoRequest) ProtoMessage() {} + +func (x *AdminInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_admin_proto_msgTypes[5] + 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 AdminInfoRequest.ProtoReflect.Descriptor instead. +func (*AdminInfoRequest) Descriptor() ([]byte, []int) { + return file_proto_admin_proto_rawDescGZIP(), []int{5} +} + +func (x *AdminInfoRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type AdminItemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminItemsRequest) Reset() { + *x = AdminItemsRequest{} + mi := &file_proto_admin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminItemsRequest) ProtoMessage() {} + +func (x *AdminItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_admin_proto_msgTypes[6] + 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 AdminItemsRequest.ProtoReflect.Descriptor instead. +func (*AdminItemsRequest) Descriptor() ([]byte, []int) { + return file_proto_admin_proto_rawDescGZIP(), []int{6} +} + +func (x *AdminItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *AdminItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *AdminItemsRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *AdminItemsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AdminItemsRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *AdminItemsRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type AdminLoginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username int32 `protobuf:"varint,1,opt,name=username,proto3" json:"username,omitempty"` + Password int32 `protobuf:"varint,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminLoginRequest) Reset() { + *x = AdminLoginRequest{} + mi := &file_proto_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminLoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminLoginRequest) ProtoMessage() {} + +func (x *AdminLoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_admin_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 AdminLoginRequest.ProtoReflect.Descriptor instead. +func (*AdminLoginRequest) Descriptor() ([]byte, []int) { + return file_proto_admin_proto_rawDescGZIP(), []int{7} +} + +func (x *AdminLoginRequest) GetUsername() int32 { + if x != nil { + return x.Username + } + return 0 +} + +func (x *AdminLoginRequest) GetPassword() int32 { + if x != nil { + return x.Password + } + return 0 +} + var File_proto_admin_proto protoreflect.FileDescriptor const file_proto_admin_proto_rawDesc = "" + "\n" + - "\x11proto/admin.proto\x12\x05admin\"2\n" + - "\n" + - "AddRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + - "\x03pwd\x18\x02 \x01(\tR\x03pwd\"3\n" + - "\vEditRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + - "\x03pwd\x18\x02 \x01(\tR\x03pwd\"5\n" + - "\rStatusRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + - "\x03pwd\x18\x02 \x01(\tR\x03pwd\"D\n" + + "\x11proto/admin.proto\x12\x05admin\x1a\x19google/protobuf/any.proto\"\xac\x01\n" + + "\x10AdminEditRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x16\n" + + "\x06avatar\x18\x04 \x01(\tR\x06avatar\x12\x14\n" + + "\x05phone\x18\x05 \x01(\tR\x05phone\x12\x14\n" + + "\x05email\x18\x06 \x01(\tR\x05email\x12\x14\n" + + "\x05roles\x18\a \x03(\x03R\x05roles\"O\n" + + "\rStatusRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"Z\n" + "\bResponse\x12\x12\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" + - "\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" + - "\x04data\x18\x03 \x01(\tR\x04data2\x90\x01\n" + - "\x05Admin\x12)\n" + - "\x03Add\x12\x11.admin.AddRequest\x1a\x0f.admin.Response\x12+\n" + - "\x04Edit\x12\x12.admin.EditRequest\x1a\x0f.admin.Response\x12/\n" + - "\x06Status\x12\x14.admin.StatusRequest\x1a\x0f.admin.ResponseB\tZ\a./adminb\x06proto3" + "\x03msg\x18\x02 \x01(\tR\x03msg\x12(\n" + + "\x04data\x18\x03 \x01(\v2\x14.google.protobuf.AnyR\x04data\"=\n" + + "\x0fPasswordRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"0\n" + + "\x12OwnPasswordRequest\x12\x1a\n" + + "\bpassword\x18\x01 \x01(\tR\bpassword\"\"\n" + + "\x10AdminInfoRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x93\x01\n" + + "\x11AdminItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x14\n" + + "\x05phone\x18\x03 \x01(\tR\x05phone\x12\x12\n" + + "\x04name\x18\x05 \x01(\tR\x04name\x12\x14\n" + + "\x05email\x18\x06 \x01(\tR\x05email\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\"K\n" + + "\x11AdminLoginRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\x05R\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\x05R\bpassword2\xc3\x03\n" + + "\x05Admin\x124\n" + + "\bAdminAdd\x12\x17.admin.AdminEditRequest\x1a\x0f.admin.Response\x125\n" + + "\tAdminEdit\x12\x17.admin.AdminEditRequest\x1a\x0f.admin.Response\x124\n" + + "\vAdminStatus\x12\x14.admin.StatusRequest\x1a\x0f.admin.Response\x123\n" + + "\bPassword\x12\x16.admin.PasswordRequest\x1a\x0f.admin.Response\x129\n" + + "\vOwnPassword\x12\x19.admin.OwnPasswordRequest\x1a\x0f.admin.Response\x125\n" + + "\tAdminInfo\x12\x17.admin.AdminInfoRequest\x1a\x0f.admin.Response\x127\n" + + "\n" + + "AdminItems\x12\x18.admin.AdminItemsRequest\x1a\x0f.admin.Response\x127\n" + + "\n" + + "AdminLogin\x12\x18.admin.AdminLoginRequest\x1a\x0f.admin.ResponseB\tZ\a./adminb\x06proto3" var ( file_proto_admin_proto_rawDescOnce sync.Once @@ -273,25 +572,41 @@ func file_proto_admin_proto_rawDescGZIP() []byte { return file_proto_admin_proto_rawDescData } -var file_proto_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_proto_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_proto_admin_proto_goTypes = []any{ - (*AddRequest)(nil), // 0: admin.AddRequest - (*EditRequest)(nil), // 1: admin.EditRequest - (*StatusRequest)(nil), // 2: admin.StatusRequest - (*Response)(nil), // 3: admin.Response + (*AdminEditRequest)(nil), // 0: admin.AdminEditRequest + (*StatusRequest)(nil), // 1: admin.StatusRequest + (*Response)(nil), // 2: admin.Response + (*PasswordRequest)(nil), // 3: admin.PasswordRequest + (*OwnPasswordRequest)(nil), // 4: admin.OwnPasswordRequest + (*AdminInfoRequest)(nil), // 5: admin.AdminInfoRequest + (*AdminItemsRequest)(nil), // 6: admin.AdminItemsRequest + (*AdminLoginRequest)(nil), // 7: admin.AdminLoginRequest + (*anypb.Any)(nil), // 8: google.protobuf.Any } var file_proto_admin_proto_depIdxs = []int32{ - 0, // 0: admin.Admin.Add:input_type -> admin.AddRequest - 1, // 1: admin.Admin.Edit:input_type -> admin.EditRequest - 2, // 2: admin.Admin.Status:input_type -> admin.StatusRequest - 3, // 3: admin.Admin.Add:output_type -> admin.Response - 3, // 4: admin.Admin.Edit:output_type -> admin.Response - 3, // 5: admin.Admin.Status:output_type -> admin.Response - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 8, // 0: admin.Response.data:type_name -> google.protobuf.Any + 0, // 1: admin.Admin.AdminAdd:input_type -> admin.AdminEditRequest + 0, // 2: admin.Admin.AdminEdit:input_type -> admin.AdminEditRequest + 1, // 3: admin.Admin.AdminStatus:input_type -> admin.StatusRequest + 3, // 4: admin.Admin.Password:input_type -> admin.PasswordRequest + 4, // 5: admin.Admin.OwnPassword:input_type -> admin.OwnPasswordRequest + 5, // 6: admin.Admin.AdminInfo:input_type -> admin.AdminInfoRequest + 6, // 7: admin.Admin.AdminItems:input_type -> admin.AdminItemsRequest + 7, // 8: admin.Admin.AdminLogin:input_type -> admin.AdminLoginRequest + 2, // 9: admin.Admin.AdminAdd:output_type -> admin.Response + 2, // 10: admin.Admin.AdminEdit:output_type -> admin.Response + 2, // 11: admin.Admin.AdminStatus:output_type -> admin.Response + 2, // 12: admin.Admin.Password:output_type -> admin.Response + 2, // 13: admin.Admin.OwnPassword:output_type -> admin.Response + 2, // 14: admin.Admin.AdminInfo:output_type -> admin.Response + 2, // 15: admin.Admin.AdminItems:output_type -> admin.Response + 2, // 16: admin.Admin.AdminLogin:output_type -> admin.Response + 9, // [9:17] is the sub-list for method output_type + 1, // [1:9] 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_proto_admin_proto_init() } @@ -305,7 +620,7 @@ func file_proto_admin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_admin_proto_rawDesc), len(file_proto_admin_proto_rawDesc)), NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/admin/admin/admin_grpc.pb.go b/admin/admin/admin_grpc.pb.go index 6aa18ed..cf5a636 100644 --- a/admin/admin/admin_grpc.pb.go +++ b/admin/admin/admin_grpc.pb.go @@ -19,18 +19,28 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Admin_Add_FullMethodName = "/admin.Admin/Add" - Admin_Edit_FullMethodName = "/admin.Admin/Edit" - Admin_Status_FullMethodName = "/admin.Admin/Status" + Admin_AdminAdd_FullMethodName = "/admin.Admin/AdminAdd" + Admin_AdminEdit_FullMethodName = "/admin.Admin/AdminEdit" + Admin_AdminStatus_FullMethodName = "/admin.Admin/AdminStatus" + Admin_Password_FullMethodName = "/admin.Admin/Password" + Admin_OwnPassword_FullMethodName = "/admin.Admin/OwnPassword" + Admin_AdminInfo_FullMethodName = "/admin.Admin/AdminInfo" + Admin_AdminItems_FullMethodName = "/admin.Admin/AdminItems" + Admin_AdminLogin_FullMethodName = "/admin.Admin/AdminLogin" ) // AdminClient is the client API for Admin 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 AdminClient interface { - Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*Response, error) - Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) + AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) + AdminStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + Password(ctx context.Context, in *PasswordRequest, opts ...grpc.CallOption) (*Response, error) + OwnPassword(ctx context.Context, in *OwnPasswordRequest, opts ...grpc.CallOption) (*Response, error) + AdminInfo(ctx context.Context, in *AdminInfoRequest, opts ...grpc.CallOption) (*Response, error) + AdminItems(ctx context.Context, in *AdminItemsRequest, opts ...grpc.CallOption) (*Response, error) + AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*Response, error) } type adminClient struct { @@ -41,30 +51,80 @@ func NewAdminClient(cc grpc.ClientConnInterface) AdminClient { return &adminClient{cc} } -func (c *adminClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *adminClient) AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) - err := c.cc.Invoke(ctx, Admin_Add_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Admin_AdminAdd_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *adminClient) Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *adminClient) AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) - err := c.cc.Invoke(ctx, Admin_Edit_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Admin_AdminEdit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *adminClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *adminClient) AdminStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) - err := c.cc.Invoke(ctx, Admin_Status_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Admin_AdminStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) Password(ctx context.Context, in *PasswordRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Admin_Password_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) OwnPassword(ctx context.Context, in *OwnPasswordRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Admin_OwnPassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) AdminInfo(ctx context.Context, in *AdminInfoRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Admin_AdminInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) AdminItems(ctx context.Context, in *AdminItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Admin_AdminItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Admin_AdminLogin_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -75,9 +135,14 @@ func (c *adminClient) Status(ctx context.Context, in *StatusRequest, opts ...grp // All implementations must embed UnimplementedAdminServer // for forward compatibility. type AdminServer interface { - Add(context.Context, *AddRequest) (*Response, error) - Edit(context.Context, *EditRequest) (*Response, error) - Status(context.Context, *StatusRequest) (*Response, error) + AdminAdd(context.Context, *AdminEditRequest) (*Response, error) + AdminEdit(context.Context, *AdminEditRequest) (*Response, error) + AdminStatus(context.Context, *StatusRequest) (*Response, error) + Password(context.Context, *PasswordRequest) (*Response, error) + OwnPassword(context.Context, *OwnPasswordRequest) (*Response, error) + AdminInfo(context.Context, *AdminInfoRequest) (*Response, error) + AdminItems(context.Context, *AdminItemsRequest) (*Response, error) + AdminLogin(context.Context, *AdminLoginRequest) (*Response, error) mustEmbedUnimplementedAdminServer() } @@ -88,14 +153,29 @@ type AdminServer interface { // pointer dereference when methods are called. type UnimplementedAdminServer struct{} -func (UnimplementedAdminServer) Add(context.Context, *AddRequest) (*Response, error) { - return nil, status.Error(codes.Unimplemented, "method Add not implemented") +func (UnimplementedAdminServer) AdminAdd(context.Context, *AdminEditRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminAdd not implemented") } -func (UnimplementedAdminServer) Edit(context.Context, *EditRequest) (*Response, error) { - return nil, status.Error(codes.Unimplemented, "method Edit not implemented") +func (UnimplementedAdminServer) AdminEdit(context.Context, *AdminEditRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminEdit not implemented") } -func (UnimplementedAdminServer) Status(context.Context, *StatusRequest) (*Response, error) { - return nil, status.Error(codes.Unimplemented, "method Status not implemented") +func (UnimplementedAdminServer) AdminStatus(context.Context, *StatusRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminStatus not implemented") +} +func (UnimplementedAdminServer) Password(context.Context, *PasswordRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method Password not implemented") +} +func (UnimplementedAdminServer) OwnPassword(context.Context, *OwnPasswordRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method OwnPassword not implemented") +} +func (UnimplementedAdminServer) AdminInfo(context.Context, *AdminInfoRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminInfo not implemented") +} +func (UnimplementedAdminServer) AdminItems(context.Context, *AdminItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminItems not implemented") +} +func (UnimplementedAdminServer) AdminLogin(context.Context, *AdminLoginRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AdminLogin not implemented") } func (UnimplementedAdminServer) mustEmbedUnimplementedAdminServer() {} func (UnimplementedAdminServer) testEmbeddedByValue() {} @@ -118,56 +198,146 @@ func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) { s.RegisterService(&Admin_ServiceDesc, srv) } -func _Admin_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddRequest) +func _Admin_AdminAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminEditRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AdminServer).Add(ctx, in) + return srv.(AdminServer).AdminAdd(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Admin_Add_FullMethodName, + FullMethod: Admin_AdminAdd_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServer).Add(ctx, req.(*AddRequest)) + return srv.(AdminServer).AdminAdd(ctx, req.(*AdminEditRequest)) } return interceptor(ctx, in, info, handler) } -func _Admin_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EditRequest) +func _Admin_AdminEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminEditRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AdminServer).Edit(ctx, in) + return srv.(AdminServer).AdminEdit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Admin_Edit_FullMethodName, + FullMethod: Admin_AdminEdit_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServer).Edit(ctx, req.(*EditRequest)) + return srv.(AdminServer).AdminEdit(ctx, req.(*AdminEditRequest)) } return interceptor(ctx, in, info, handler) } -func _Admin_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Admin_AdminStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AdminServer).Status(ctx, in) + return srv.(AdminServer).AdminStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Admin_Status_FullMethodName, + FullMethod: Admin_AdminStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServer).Status(ctx, req.(*StatusRequest)) + return srv.(AdminServer).AdminStatus(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_Password_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).Password(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Admin_Password_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).Password(ctx, req.(*PasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_OwnPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OwnPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).OwnPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Admin_OwnPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).OwnPassword(ctx, req.(*OwnPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_AdminInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).AdminInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Admin_AdminInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).AdminInfo(ctx, req.(*AdminInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_AdminItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).AdminItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Admin_AdminItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).AdminItems(ctx, req.(*AdminItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_AdminLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).AdminLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Admin_AdminLogin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).AdminLogin(ctx, req.(*AdminLoginRequest)) } return interceptor(ctx, in, info, handler) } @@ -180,16 +350,36 @@ var Admin_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Add", - Handler: _Admin_Add_Handler, + MethodName: "AdminAdd", + Handler: _Admin_AdminAdd_Handler, }, { - MethodName: "Edit", - Handler: _Admin_Edit_Handler, + MethodName: "AdminEdit", + Handler: _Admin_AdminEdit_Handler, }, { - MethodName: "Status", - Handler: _Admin_Status_Handler, + MethodName: "AdminStatus", + Handler: _Admin_AdminStatus_Handler, + }, + { + MethodName: "Password", + Handler: _Admin_Password_Handler, + }, + { + MethodName: "OwnPassword", + Handler: _Admin_OwnPassword_Handler, + }, + { + MethodName: "AdminInfo", + Handler: _Admin_AdminInfo_Handler, + }, + { + MethodName: "AdminItems", + Handler: _Admin_AdminItems_Handler, + }, + { + MethodName: "AdminLogin", + Handler: _Admin_AdminLogin_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/admin/adminclient/admin.go b/admin/adminclient/admin.go index efe84ec..a9dc69b 100644 --- a/admin/adminclient/admin.go +++ b/admin/adminclient/admin.go @@ -14,15 +14,24 @@ import ( ) type ( - AddRequest = admin.AddRequest - EditRequest = admin.EditRequest - Response = admin.Response - StatusRequest = admin.StatusRequest + AdminEditRequest = admin.AdminEditRequest + AdminInfoRequest = admin.AdminInfoRequest + AdminItemsRequest = admin.AdminItemsRequest + AdminLoginRequest = admin.AdminLoginRequest + OwnPasswordRequest = admin.OwnPasswordRequest + PasswordRequest = admin.PasswordRequest + Response = admin.Response + StatusRequest = admin.StatusRequest Admin interface { - Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*Response, error) - Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) + AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) + AdminStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) + Password(ctx context.Context, in *PasswordRequest, opts ...grpc.CallOption) (*Response, error) + OwnPassword(ctx context.Context, in *OwnPasswordRequest, opts ...grpc.CallOption) (*Response, error) + AdminInfo(ctx context.Context, in *AdminInfoRequest, opts ...grpc.CallOption) (*Response, error) + AdminItems(ctx context.Context, in *AdminItemsRequest, opts ...grpc.CallOption) (*Response, error) + AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*Response, error) } defaultAdmin struct { @@ -36,17 +45,42 @@ func NewAdmin(cli zrpc.Client) Admin { } } -func (m *defaultAdmin) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultAdmin) AdminAdd(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) { client := admin.NewAdminClient(m.cli.Conn()) - return client.Add(ctx, in, opts...) + return client.AdminAdd(ctx, in, opts...) } -func (m *defaultAdmin) Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultAdmin) AdminEdit(ctx context.Context, in *AdminEditRequest, opts ...grpc.CallOption) (*Response, error) { client := admin.NewAdminClient(m.cli.Conn()) - return client.Edit(ctx, in, opts...) + return client.AdminEdit(ctx, in, opts...) } -func (m *defaultAdmin) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultAdmin) AdminStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) { client := admin.NewAdminClient(m.cli.Conn()) - return client.Status(ctx, in, opts...) + return client.AdminStatus(ctx, in, opts...) +} + +func (m *defaultAdmin) Password(ctx context.Context, in *PasswordRequest, opts ...grpc.CallOption) (*Response, error) { + client := admin.NewAdminClient(m.cli.Conn()) + return client.Password(ctx, in, opts...) +} + +func (m *defaultAdmin) OwnPassword(ctx context.Context, in *OwnPasswordRequest, opts ...grpc.CallOption) (*Response, error) { + client := admin.NewAdminClient(m.cli.Conn()) + return client.OwnPassword(ctx, in, opts...) +} + +func (m *defaultAdmin) AdminInfo(ctx context.Context, in *AdminInfoRequest, opts ...grpc.CallOption) (*Response, error) { + client := admin.NewAdminClient(m.cli.Conn()) + return client.AdminInfo(ctx, in, opts...) +} + +func (m *defaultAdmin) AdminItems(ctx context.Context, in *AdminItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := admin.NewAdminClient(m.cli.Conn()) + return client.AdminItems(ctx, in, opts...) +} + +func (m *defaultAdmin) AdminLogin(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*Response, error) { + client := admin.NewAdminClient(m.cli.Conn()) + return client.AdminLogin(ctx, in, opts...) } diff --git a/admin/go.mod b/admin/go.mod index 5a78118..537023b 100644 --- a/admin/go.mod +++ b/admin/go.mod @@ -17,17 +17,35 @@ require ( buf.build/go/protovalidate v0.14.0 // indirect cel.dev/expr v0.25.2 // indirect filippo.io/edwards25519 v1.2.0 // indirect + github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect + github.com/alibabacloud-go/darabonba-openapi/v2 v2.2.4 // indirect + github.com/alibabacloud-go/debug v1.0.1 // indirect + github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6 // indirect + github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect + github.com/alibabacloud-go/openapi-util v0.1.0 // indirect + github.com/alibabacloud-go/tea v1.5.3 // indirect + github.com/alibabacloud-go/tea-utils v1.3.1 // indirect + github.com/alibabacloud-go/tea-utils/v2 v2.0.9 // indirect + github.com/aliyun/credentials-go v1.4.5 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bytedance/gopkg v0.1.3 // indirect + github.com/bytedance/sonic v1.15.0 // indirect + github.com/bytedance/sonic/loader v0.5.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/clbanning/mxj/v2 v2.7.0 // indirect + github.com/cloudwego/base64x v0.1.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.12.2 // indirect github.com/fatih/color v1.18.0 // indirect + github.com/fsnotify/fsnotify v1.10.1 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/gabriel-vasile/mimetype v1.4.13 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/gin-gonic/gin v1.12.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -37,20 +55,27 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.30.3 // indirect github.com/go-sql-driver/mysql v1.10.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect + github.com/goccy/go-json v0.10.5 // indirect + github.com/goccy/go-yaml v1.19.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/cel-go v0.25.0 // indirect github.com/google/gnostic-models v0.7.0 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/grafana/pyroscope-go v1.3.0 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.10 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.18.6 // indirect + github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -66,14 +91,33 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 // indirect github.com/prometheus/procfs v0.16.1 // indirect + github.com/quic-go/qpack v0.6.0 // indirect + github.com/quic-go/quic-go v0.59.0 // indirect github.com/redis/go-redis/v9 v9.21.0 // indirect + github.com/richardlehane/mscfb v1.0.7 // indirect + github.com/richardlehane/msoleps v1.0.6 // indirect + github.com/sagikazarmark/locafero v0.11.0 // indirect + github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.15.0 // indirect + github.com/spf13/cast v1.10.0 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/spf13/viper v1.21.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/tiendc/go-deepcopy v1.7.2 // indirect github.com/titanous/json5 v1.0.0 // indirect + github.com/tjfoc/gmsm v1.4.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.3.1 // indirect github.com/x448/float16 v0.8.4 // indirect + github.com/xuri/efp v0.0.1 // indirect + github.com/xuri/excelize/v2 v2.11.0 // indirect + github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 // indirect go.etcd.io/etcd/api/v3 v3.5.21 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect go.etcd.io/etcd/client/v3 v3.5.21 // indirect + go.mongodb.org/mongo-driver/v2 v2.8.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/otel v1.44.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect @@ -92,18 +136,20 @@ require ( go.uber.org/zap v1.24.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.52.0 // indirect + golang.org/x/arch v0.22.0 // indirect + golang.org/x/crypto v0.53.0 // indirect golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect - golang.org/x/net v0.55.0 // indirect + golang.org/x/net v0.56.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.38.0 // indirect golang.org/x/time v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/admin/go.sum b/admin/go.sum index 89637dc..5ad2533 100644 --- a/admin/go.sum +++ b/admin/go.sum @@ -4,10 +4,65 @@ buf.build/go/protovalidate v0.14.0 h1:kr/rC/no+DtRyYX+8KXLDxNnI1rINz0imk5K44ZpZ3 buf.build/go/protovalidate v0.14.0/go.mod h1:+F/oISho9MO7gJQNYC2VWLzcO1fTPmaTA08SDYJZncA= cel.dev/expr v0.25.2 h1:K6j46C81hXtZQfuX60cVWQFBJahKSE2gfRbNuvr5bFs= cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6 h1:eIf+iGJxdU4U9ypaUfbtOWCsZSbTb8AUHvyPrxu6mAA= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6/go.mod h1:4EUIoxs/do24zMOGGqYVWgw0s9NtiylnJglOeEB5UJo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 h1:zE8vH9C7JiZLNJJQ5OwjU9mSi4T9ef9u3BURT6LCLC8= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5/go.mod h1:tWnyE9AjF8J8qqLk645oUmVUnFybApTQWklQmi5tY6g= +github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY= +github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2/go.mod h1:JiW9higWHYXm7F4PKuMgEUETNZasrDM6vqVr/Can7H8= +github.com/alibabacloud-go/darabonba-map v0.0.2 h1:qvPnGB4+dJbJIxOOfawxzF3hzMnIpjmafa0qOTp6udc= +github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+MtEzBunJwQGceGQlvaPGPc= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.2.4 h1:o6veen0IZ/Fe1JawwhwQMZcbw67CVDY1pQwXcNWPyQo= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.2.4/go.mod h1:eHjVxrT9g8uVYN/nyAwOFQEfkVA154ChiqRc2XnNKYU= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= +github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo= +github.com/alibabacloud-go/darabonba-string v1.0.2/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/debug v1.0.1 h1:MsW9SmUtbb1Fnt3ieC6NNZi6aEwrXfDksD4QA6GSbPg= +github.com/alibabacloud-go/debug v1.0.1/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6 h1:UTl97mt2qfavxveqCkaVg4tKaZUPzA9RKbFIRaIdtdg= +github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6/go.mod h1:UWpcGrWwTbES9QW7OQ7xDffukMJ/l7lzioixIz8+lgY= +github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.0.11/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY= +github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.19/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk= +github.com/alibabacloud-go/tea v1.5.2/go.mod h1:hgSs82CkOiehSQMoiFN79dL6zsGX7pVGvnn9SIEs8/0= +github.com/alibabacloud-go/tea v1.5.3 h1:UMJTBcO48w7Zz1nlFe9bmRsHwgB7AjF8DBQzcvHhIp8= +github.com/alibabacloud-go/tea v1.5.3/go.mod h1:hgSs82CkOiehSQMoiFN79dL6zsGX7pVGvnn9SIEs8/0= +github.com/alibabacloud-go/tea-utils v1.3.1 h1:iWQeRzRheqCMuiF3+XkfybB3kTgUXkXX+JMrqfLeB2I= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.3/go.mod h1:sj1PbjPodAVTqGTA3olprfeeqqmwD0A5OQz94o9EuXQ= +github.com/alibabacloud-go/tea-utils/v2 v2.0.5/go.mod h1:dL6vbUT35E4F4bFTHL845eUloqaerYBYPsdWR2/jhe4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.9 h1:y6pUIlhjxbZl9ObDAcmA1H3c21eaAxADHTDQmBnAIgA= +github.com/alibabacloud-go/tea-utils/v2 v2.0.9/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= +github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= +github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM= +github.com/aliyun/credentials-go v1.4.5 h1:O76WYKgdy1oQYYiJkERjlA2dxGuvLRrzuO2ScrtGWSk= +github.com/aliyun/credentials-go v1.4.5/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= @@ -18,10 +73,24 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= +github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= +github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE= +github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k= +github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE= +github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= +github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -32,12 +101,23 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= +github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM= github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= +github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w= +github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM= +github.com/gin-gonic/gin v1.12.0 h1:b3YAbrZtnf8N//yjKeU2+MQsh2mY5htkZidOM7O0wG8= +github.com/gin-gonic/gin v1.12.0/go.mod h1:VxccKfsSllpKshkBWgVgRniFFAzFb9csfngsqANjnLc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -64,15 +144,39 @@ github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= +github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/cel-go v0.25.0 h1:jsFw9Fhn+3y2kBbltZR4VEz5xKkcIFRPDnuEzAGv5GY= github.com/google/cel-go v0.25.0/go.mod h1:hjEb6r5SuOSlhCHmFoLzu8HGCERvIsDAbxDAyNU/MmI= github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -80,6 +184,11 @@ github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgY github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= github.com/grafana/pyroscope-go v1.3.0 h1:t3Jehad8vvqN4oRAB0LdmfQ5ZSUXQw3asoft+K4GAT8= github.com/grafana/pyroscope-go v1.3.0/go.mod h1:XA7I3usNx+UdjOZfQnl1WV8y924vsJo9KIVrKB+9jx4= github.com/grafana/pyroscope-go/godeltaprof v0.1.10 h1:dvhndEbyavTb59vFCd6PsrAG5qi69/qZZtegh/TJKSY= @@ -92,16 +201,20 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= -github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= -github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -125,11 +238,14 @@ github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxU github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= @@ -146,41 +262,86 @@ github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4 github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8= +github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII= +github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw= +github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU= github.com/redis/go-redis/v9 v9.21.0 h1:FPBE4hhbAke+TLmcY3WkpbDffJEomdqPn3HYiqAtL9E= github.com/redis/go-redis/v9 v9.21.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= +github.com/richardlehane/mscfb v1.0.7 h1:oeoiM0WE79vHwE8RpIYYvIAc8ajTH2mb6UZm55/+EB0= +github.com/richardlehane/mscfb v1.0.7/go.mod h1:pe0+IUIc0AHh0+teNzBlJCtSyZdFOGgV4ZK9bsoV+Jo= +github.com/richardlehane/msoleps v1.0.6 h1:9BvkpjvD+iUBalUY4esMwv6uBkfOip/Lzvd93jvR9gg= +github.com/richardlehane/msoleps v1.0.6/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= github.com/robertkrimen/otto v0.2.1 h1:FVP0PJ0AHIjC+N4pKCG9yCDz6LHNPCwi/GKID5pGGF0= github.com/robertkrimen/otto v0.2.1/go.mod h1:UPwtJ1Xu7JrLcZjNWN8orJaM5n5YEtqL//farB5FlRY= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= +github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= +github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= +github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= +github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= +github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/tiendc/go-deepcopy v1.7.2 h1:Ut2yYR7W9tWjTQitganoIue4UGxZwCcJy3orjrrIj44= +github.com/tiendc/go-deepcopy v1.7.2/go.mod h1:4bKjNC2r7boYOkD2IOuZpYjmlDdzjbpTRyCx+goBCJQ= github.com/titanous/json5 v1.0.0 h1:hJf8Su1d9NuI/ffpxgxQfxh/UiBFZX7bMPid0rIL/7s= github.com/titanous/json5 v1.0.0/go.mod h1:7JH1M8/LHKc6cyP5o5g3CSaRj+mBrIimTxzpvmckH8c= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= +github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY= +github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8= +github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.11.0 h1:HxaEFl6sRN2+8J5a8HaKq+0M4FsjBGMnWWtjOCPSG88= +github.com/xuri/excelize/v2 v2.11.0/go.mod h1:jxFLbzaIwGQ5ufFNvYfUOHqXhfPaNmP14KWfmNz2Uak= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 h1:+C0TIdyyYmzadGaL/HBLbf3WdLgC29pgyhTjAT/0nuE= +github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= @@ -193,6 +354,8 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoB go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs= go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY= go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU= +go.mongodb.org/mongo-driver/v2 v2.8.0 h1:CxWDGQYY8QQwNjAl/aq2sfWakdnWZynnqJ9F4DhHbP8= +go.mongodb.org/mongo-driver/v2 v2.8.0/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= @@ -233,62 +396,174 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI= +golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/image v0.38.0 h1:5l+q+Y9JDC7mBOMjo4/aPhMDcxEptsX+Tt3GgRQRPuE= +golang.org/x/image v0.38.0/go.mod h1:/3f6vaXC+6CEanU4KJxbcUZyEePbyKbaLoDOe4ehFYY= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= +golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ= google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= @@ -297,10 +572,15 @@ gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -314,6 +594,8 @@ gorm.io/gorm v1.31.2 h1:3o8FXNo9v9S858gil+3LlZA1LkCOzgb4g5BL64FgaCo= gorm.io/gorm v1.31.2/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs= gorm.io/plugin/dbresolver v1.6.2 h1:F4b85TenghUeITqe3+epPSUtHH7RIk3fXr5l83DF8Pc= gorm.io/plugin/dbresolver v1.6.2/go.mod h1:tctw63jdrOezFR9HmrKnPkmig3m5Edem9fdxk9bQSzM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.34.3 h1:D12sTP257/jSH2vHV2EDYrb16bS7ULlHpdNdNhEw2S4= k8s.io/api v0.34.3/go.mod h1:PyVQBF886Q5RSQZOim7DybQjAbVs8g7gwJNhGtY5MBk= k8s.io/apimachinery v0.34.3 h1:/TB+SFEiQvN9HPldtlWOTp0hWbJ+fjU+wkxysf/aQnE= diff --git a/admin/internal/dao/admin.go b/admin/internal/dao/admin.go new file mode 100644 index 0000000..f2f600f --- /dev/null +++ b/admin/internal/dao/admin.go @@ -0,0 +1,92 @@ +package dao + +import "pkg.local/utils" + +// Admin 公司内部人员表 +type Admin struct { + Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"` + Name string `gorm:"column:name;type:varchar(30);comment:真实姓名;NOT NULL" json:"name"` + Phone string `gorm:"column:phone;type:char(12);comment:电话" json:"phone"` + Email string `gorm:"column:email;type:varchar(255);comment:邮箱" json:"email"` + Password string `gorm:"column:password;type:char(61);comment:密码;NOT NULL" json:"password"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + Salt string `gorm:"column:salt;type:char(5);comment:与密码混合搭配加密;NOT NULL" json:"salt"` + Roles string `gorm:"column:roles;type:varchar(255);comment:角色" json:"roles"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + LastTime utils.CustomTime `gorm:"column:last_time;type:datetime;default:NULL;comment:最后一次登录时间" json:"last_time"` + FailNumber int `gorm:"column:fail_number;type:tinyint(2);default:0;comment:连续登录失败次数" json:"fail_number"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `gorm:"column:admin_id;type:int(11);default:0;comment:操作人;NOT NULL" json:"admin_id"` + CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:NULL;comment:添加时间" json:"create_time"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +// AdminPassword 修改管理员密码 +type AdminPassword struct { + Id int `json:"id"` + Password string `json:"password"` + Salt string `json:"salt"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +// AdminStatus 修改管理员状态 +type AdminStatus struct { + Id int `json:"id"` + Status uint8 `json:"status"` + Reason string `json:"reason"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +// AdminInfo 管理员详情 +type AdminInfo struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"` + Name string `gorm:"column:name;type:varchar(30);comment:真实姓名;NOT NULL" json:"name"` + Phone string `gorm:"column:phone;type:char(12);comment:电话" json:"phone"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + DepartmentId string `gorm:"column:department_id;type:varchar(255);default:0;comment:部门ID" json:"department_id"` + Email string `gorm:"column:email;type:varchar(255);comment:邮箱" json:"email"` + Roles string `gorm:"column:roles;type:varchar(255);comment:角色" json:"roles"` + LastTime utils.CustomTime `gorm:"column:last_time;type:datetime;comment:最后一次登录时间" json:"last_time"` + FailNumber int `gorm:"column:fail_number;type:tinyint(2);default:0;comment:连续登录失败次数" json:"fail_number"` +} + +type AdminInfoRet struct { + AdminInfo + Roles []int `json:"roles"` + DepartmentId []int `json:"department_id"` +} + +type AdminItemsRet struct { + AdminInfo + RoleInfo []RoleNameItems `json:"role_info"` +} + +type AdminItems struct { + Items []AdminItemsRet `json:"items"` + Count int64 `json:"count"` +} + +type AdminLastTime struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + LastTime utils.CustomTime `gorm:"column:last_time;type:datetime;default:NULL;comment:最后一次登录时间" json:"last_time"` + FailNumber int `gorm:"column:fail_number;type:tinyint(2);default:0;comment:连续登录失败次数" json:"fail_number"` +} +type AdminFail struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + FailNumber int `gorm:"column:fail_number;type:tinyint(2);default:0;comment:连续登录失败次数" json:"fail_number"` +} + +type AdminOutInfo struct { + Id int `json:"id"` + Avatar string `json:"avatar"` + Name string `json:"name"` + Phone string `json:"phone"` + Email string `json:"email"` + Roles []string `json:"roles"` +} diff --git a/admin/internal/dao/authority.go b/admin/internal/dao/authority.go new file mode 100644 index 0000000..0d91ca5 --- /dev/null +++ b/admin/internal/dao/authority.go @@ -0,0 +1,160 @@ +package dao + +import "pkg.local/utils" + +const ( + TypeDir = 1 + TypeWeb = 2 + TypeButton = 3 + TypeUrl = 4 + TypeData = 5 + NoData = "#" + + SortTypeUp = 1 + SortTypeDown = 2 + QuerySortLIstWeb = 1 + QuerySortListAll = 2 + QuerySortListNotButton = 3 +) + +// Authority 权限表 +type Authority struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:菜单;NOT NULL" json:"name"` + ParentId int `gorm:"column:parent_id;type:int(11);default:0;comment:父级菜单;NOT NULL" json:"parent_id"` + ParentIds string `gorm:"column:parent_ids;type:varchar(255);comment:多级父级菜单;NOT NULL" json:"parent_ids"` + Level uint8 `gorm:"column:level;type:tinyint(2);default:0;comment:级别;NOT NULL" json:"level"` + Type uint8 `gorm:"column:type;type:tinyint(2);comment:类型,1目录,2页面,3按钮;NOT NULL" json:"type"` + ProjectId int `gorm:"column:project_id;type:int(11);comment:项目ID;NOT NULL" json:"project_id"` + Path string `gorm:"column:path;type:varchar(255);comment:页面请求地址;NOT NULL" json:"path"` + Api string `gorm:"column:api;type:varchar(255);comment:接口地址" json:"api"` + ViewPath string `gorm:"column:view_path;type:varchar(255);comment:页面文件路径" json:"view_path"` + Identification string `gorm:"column:identification;type:varchar(255);comment:权限标识" json:"identification"` + Icon string `gorm:"column:icon;type:varchar(255);comment:图标" json:"icon"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + Sort uint8 `gorm:"column:sort;type:smallint(3);default:1;comment:排序" json:"sort"` + JsonDataBase string `gorm:"column:json_data_base;type:text;comment:原始数据" json:"json_data_base"` + JsonTreeData string `gorm:"column:json_tree_data;type:text;comment:数据的树型结构" json:"json_tree_data"` + JsonData string `gorm:"column:json_data;type:text;comment:所有的数据" json:"json_data"` + DataIds string `gorm:"column:data_ids;type:varchar(32);comment:三个数据的IDs" json:"data_ids"` + IsShow uint8 `gorm:"column:is_show;type:tinyint(1);default:1;comment:菜单中是否显示,1为显示,2为不显示;NOT NULL" json:"is_show"` + Remarks string `gorm:"column:remarks;type:varchar(255);comment:备注;NOT NULL" json:"remarks"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `gorm:"column:admin_id;type:int(11);comment:操作人ID" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"` + CreateTime utils.CustomTime `gorm:"column:create_time;default:NULL;type:datetime" json:"create_time"` + UpdateTime utils.CustomTime `gorm:"column:update_time;default:NULL;type:datetime" json:"update_time"` +} + +// AuthorityStatus 修改状态 +type AuthorityStatus struct { + Id int `json:"id"` + Status uint8 `json:"status"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + ProjectId int `gorm:"column:project_id;type:int(11);comment:项目ID;NOT NULL" json:"project_id"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +type AuthorityCheck struct { + Id int `json:"id"` + Api string `json:"api"` + Type uint8 `json:"type"` +} + +type AuthorityItems struct { + Id int `json:"id"` + Name string `json:"name"` + ParentId int `json:"parent_id"` + ParentIds string `json:"parent_ids"` + Level uint8 `json:"level"` + Type uint8 `json:"type"` + ProjectId int `json:"project_id"` + Path string `json:"path"` + Api string `json:"api"` + ViewPath string `json:"view_path"` + Identification string `json:"identification"` + Icon string `json:"icon"` + Status uint8 `json:"status"` + Sort uint8 `json:"sort"` + JsonDataBase string `gorm:"column:json_data_base;type:text;comment:原始数据" json:"json_data_base"` + JsonData string `gorm:"column:json_data;type:text;comment:所有的数据" json:"json_data"` + JsonTreeData string `gorm:"column:json_tree_data;type:text;comment:数据的树型结构" json:"json_tree_data"` + DataIds string `json:"data_ids"` + IsShow uint8 `json:"is_show"` + Remarks string `json:"remarks"` + Reason string `json:"reason"` + AdminId int `json:"admin_id"` + AdminName string `json:"admin_name"` + CreateTime utils.CustomTime `json:"create_time"` + UpdateTime utils.CustomTime `json:"update_time"` + IsFirst bool `json:"is_first"` // 是否是同级第一个节点 + IsLast bool `json:"is_last"` // 是否是同级最后一个节点 + Children []*AuthorityItems `json:"children"` +} + +type AuthorityNames struct { + Id int `json:"id"` + Name string `json:"name"` + Level uint8 `json:"level"` + Type uint8 `json:"type"` + ParentId int `json:"parent_id"db:"parent_id"` +} + +type AuthorityNamesItems struct { + Id int `json:"value"` + Name string `json:"label"` + Level uint8 `json:"level"` + Type uint8 `json:"type"` + ParentId int `json:"pid"` + Children []AuthorityNamesItems `json:"children"` +} + +type AuthorityInfo struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:菜单;NOT NULL" json:"name"` + ParentId int `gorm:"column:parent_id;type:int(11);default:0;comment:父级菜单;NOT NULL" json:"parent_id"` + Type uint8 `gorm:"column:type;type:tinyint(2);comment:类型,1目录,2页面,3按钮;NOT NULL" json:"type"` + Path string `gorm:"column:path;type:varchar(100);comment:页面请求地址;NOT NULL" json:"path"` + Api string `gorm:"column:api;type:varchar(100);comment:接口地址" json:"api"` + ViewPath string `gorm:"column:view_path;type:varchar(255);comment:页面文件路径" json:"view_path"` + Identification string `gorm:"column:identification;type:varchar(255);comment:权限标识" json:"identification"` + Icon string `gorm:"column:icon;type:varchar(30);comment:图标" json:"icon"` + IsShow uint8 `gorm:"column:is_show;type:tinyint(1);default:1;comment:菜单中是否显示,1为显示,2为不显示;NOT NULL" json:"is_show"` + JsonDataBase string `gorm:"column:json_data_base;type:text;comment:原始数据" json:"json_data_base"` + JsonTreeData string `gorm:"column:json_tree_data;type:text;comment:数据的树型结构" json:"json_tree_data"` + JsonData string `gorm:"column:json_data;type:text;comment:所有的数据" json:"json_data"` + DataIds string `gorm:"column:data_ids;type:varchar(32);comment:三个数据的IDs" json:"data_ids"` + Remarks string `gorm:"column:remarks;type:varchar(255);comment:备注;NOT NULL" json:"remarks"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` +} + +type AuthorityInfoNew struct { + AuthorityInfo + JsonDataDepartment string `json:"json_data_department"` + JsonDataAll string `json:"json_data_all"` + JsonDataOneself string `json:"json_data_oneself"` +} + +type AuthoritySort struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + ParentId int `gorm:"column:parent_id;type:int(11);default:0;comment:父级菜单;NOT NULL" json:"parent_id"` + ProjectId int `gorm:"column:project_id;type:int(11);comment:项目ID;NOT NULL" json:"project_id"` + Sort uint8 `gorm:"column:sort;type:smallint(3);default:1;comment:排序" json:"sort"` + AdminId int `gorm:"column:admin_id;type:int(11);comment:操作人ID" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;default:NULL;type:datetime" json:"update_time"` +} + +type AuthorityUpJsonIds struct { + DataIds string `gorm:"column:data_ids;type:varchar(32);comment:三个数据的IDs" json:"data_ids"` +} + +type AuthorityGetJsonIds struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + JsonDataBase string `gorm:"column:json_data_base;type:text;comment:原始数据" json:"json_data_base"` + JsonData string `gorm:"column:json_data;type:text;comment:所有的数据" json:"json_data"` + JsonTreeData string `gorm:"column:json_tree_data;type:text;comment:数据的树型结构" json:"json_tree_data"` + DataIds string `gorm:"column:data_ids;type:varchar(32);comment:三个数据的IDs" json:"data_ids"` +} diff --git a/admin/internal/dao/role.go b/admin/internal/dao/role.go new file mode 100644 index 0000000..129a64c --- /dev/null +++ b/admin/internal/dao/role.go @@ -0,0 +1,68 @@ +package dao + +import "pkg.local/utils" + +// Role 岗位表 +type Role struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"` + ProjectId int `gorm:"column:project_id;type:int(11);comment:项目ID;NOT NULL" json:"project_id"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + Rules string `gorm:"column:rules;type:text;comment:权限内容" json:"rules"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `gorm:"column:admin_id;type:int(11)" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"` + CreateTime utils.CustomTime `gorm:"column:create_time;default:NULL;type:datetime" json:"create_time"` + UpdateTime utils.CustomTime `gorm:"column:update_time;default:NULL;type:datetime" json:"update_time"` +} + +// RoleStatus 修改状态 +type RoleStatus struct { + Id int `json:"id"` + Status uint8 `json:"status"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +// RoleRule 修改状态 +type RoleRule struct { + Id int `json:"id"` + Rules string `json:"rules"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime;default:NULL;comment:更新时间" json:"update_time"` +} + +type RoleItems struct { + Role + RuleItems []string `json:"rule_items"` +} + +type RoleNameItems struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"` + ProjectId int `json:"project_id"` +} + +type RoleProjectNameItems struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"` + Items []RoleNameItems `json:"items"` +} + +type RoleRulesItems struct { + Id int `json:"id"` + Name string `json:"name"` + Rules string `json:"rules"` +} + +type RoleInfo struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"` + ProjectId int `gorm:"column:project_id;type:int(11);comment:项目ID;NOT NULL" json:"project_id"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + Rules []int `gorm:"column:rules;type:text;comment:权限内容" json:"rules"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` +} diff --git a/admin/internal/dao/routes.go b/admin/internal/dao/routes.go new file mode 100644 index 0000000..8f894ff --- /dev/null +++ b/admin/internal/dao/routes.go @@ -0,0 +1,29 @@ +package dao + +type RoutesMenu struct { + Id int `json:"id"` + Name string `json:"name"` + ParentId int `json:"parent_id"` + Level uint8 `json:"level"` + Type uint8 `json:"type"` + Path string `json:"path"` + Api string `json:"api"` + ViewPath string `json:"view_path"` + Identification string `json:"identification"` + Icon string `json:"icon"` + Sort uint8 `json:"sort"` + IsShow uint8 `json:"is_show"` + Remarks string `json:"remarks"` + Children []RoutesMenu `json:"children"` +} + +type RoutesAuth struct { + Id int `json:"id"` + Type uint8 `json:"type"` + Identification string `json:"identification"` +} + +type Routes struct { + Menu []RoutesMenu `json:"menu"` + Auth []RoutesAuth `json:"auth"` +} diff --git a/admin/internal/dao/servers.go b/admin/internal/dao/servers.go new file mode 100644 index 0000000..20286f7 --- /dev/null +++ b/admin/internal/dao/servers.go @@ -0,0 +1,38 @@ +package dao + +import "pkg.local/utils" + +// Project 项目表 +type Project struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用;NOT NULL" json:"status"` + Remarks string `gorm:"column:remarks;type:varchar(255);default:'';comment:描述;NOT NULL" json:"remarks"` + Logo string `gorm:"column:logo;type:varchar(255);default:'';comment:logo;NOT NULL" json:"logo"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `gorm:"column:admin_id;type:int(11);comment:操作人员ID" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255);comment:操作人员姓名" json:"admin_name"` + CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime" json:"create_time"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime" json:"update_time"` +} + +type ProjectItems struct { + Items []Project `json:"items"` + Count int64 `json:"count"` +} + +// ProjectStatus 修改状态 +type ProjectStatus struct { + Id int `json:"id"` + Status uint8 `json:"status"` + Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` + AdminId int `json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(100);comment:操作人姓名" json:"admin_name"` + UpdateTime utils.CustomTime `gorm:"column:update_time;type:datetime" json:"update_time"` +} + +type ProjectNameItems struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + Name string `gorm:"column:name;type:varchar(255);comment:项目描述;NOT NULL" json:"name"` + Logo string `gorm:"column:logo;type:varchar(255);default:'';comment:logo;NOT NULL" json:"logo"` +} diff --git a/admin/internal/logic/addlogic.go b/admin/internal/logic/addlogic.go deleted file mode 100644 index c0abf3d..0000000 --- a/admin/internal/logic/addlogic.go +++ /dev/null @@ -1,36 +0,0 @@ -package logic - -import ( - "admin/validator" - "context" - - "admin/admin" - "admin/internal/svc" - - "github.com/zeromicro/go-zero/core/logx" - "pkg.local/utils" - validateService "pkg.local/validate" -) - -type AddLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddLogic { - return &AddLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -func (l *AddLogic) Add(in *admin.AddRequest) (*admin.Response, error) { - var req validator.AdminAddValidator - if resp := validateService.ValidateFromProto(in, &req); resp != utils.StringEmpty { - return &admin.Response{Code: utils.Ok.Code, Msg: resp}, nil - } - - return &admin.Response{}, nil -} diff --git a/admin/internal/logic/adminaddlogic.go b/admin/internal/logic/adminaddlogic.go new file mode 100644 index 0000000..0d55e4d --- /dev/null +++ b/admin/internal/logic/adminaddlogic.go @@ -0,0 +1,125 @@ +package logic + +import ( + "admin/admin" + "admin/internal/dao" + "admin/internal/model" + "admin/internal/svc" + "admin/validator" + "context" + "fmt" + "strconv" + "strings" + + "github.com/zeromicro/go-zero/core/logx" + "pkg.local/modelbase" + "pkg.local/utils" +) + +type AdminAddLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewAdminAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminAddLogic { + return &AdminAddLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AdminAddLogic) AdminAdd(in *admin.AdminEditRequest) (*admin.Response, error) { + var v validator.AdminEditValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + + encryPhone, cErr := utils.EncryptPhone(in.Phone) + if cErr != nil { + l.Logger.Error(cErr) + return l.fail(utils.ErrorEncryptAesError), nil + } + + info, check := l.checkPhone(encryPhone) + if !check { + return l.fail(utils.ErrorEncryptAesError), nil + } + modelObj := model.AdminModel{}.Init() + if in.Id > utils.NumberZero && info.Id < utils.NumberOne { + w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}} + info = dao.Admin{} + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(cErr) + return l.fail(utils.Fail), nil + + } + if info.Id < utils.NumberZero { + return l.fail(utils.ErrorNotFund), nil + } + } + //编辑 + if in.Id > utils.NumberZero { + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund), nil + } + if info.Id != in.Id { + return l.fail(utils.ErrorExistUser), nil + } + } else { + if len(in.Password) < utils.NumberOne { + return l.out(utils.ErrorParams, "密码不能为空"), nil + + } + if info.Id > utils.NumberZero { + return l.fail(utils.ErrorExistUser), nil + } + } + //adminId, _ := c.Get(utils.USERID) + //adminName, _ := c.Get(utils.USERNAME) + var roles []string + if len(in.Roles) > utils.NumberZero { + for _, role := range in.Roles { + roles = append(roles, strconv.Itoa(int(role))) + } + } + + info.Name = in.Name + info.Phone = encryPhone + info.Roles = strings.Join(roles, ",") + info.Email = in.Email + info.Avatar = in.Avatar + var err error + if info.Id > utils.NumberZero { + w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(info.Id))}} + _, err = modelObj.Edit(w, info) + } else { + salt := utils.GetRandstring(utils.NumberFive) + pwd := fmt.Sprintf("%s%s", salt, in.Password) + pwd, _ = utils.EncryptPassword(pwd) + info.Password = pwd + info.Salt = salt + err = modelObj.Init().Create(&info) + } + + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail), nil + } + return l.ok(info.Id), nil +} + +func (l *AdminAddLogic) checkPhone(phone string) (dao.Admin, bool) { + w := modelbase.Params{Eq: map[string]string{"phone": phone}} + info := dao.Admin{} + err := model.AdminModel{}.Init().GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return info, false + } + + return info, true +} diff --git a/admin/internal/logic/editlogic.go b/admin/internal/logic/admineditlogic.go similarity index 54% rename from admin/internal/logic/editlogic.go rename to admin/internal/logic/admineditlogic.go index 7ed9009..b52cf63 100644 --- a/admin/internal/logic/editlogic.go +++ b/admin/internal/logic/admineditlogic.go @@ -9,24 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type EditLogic struct { +type AdminEditLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EditLogic { - return &EditLogic{ +func NewAdminEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminEditLogic { + return &AdminEditLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *EditLogic) Edit(in *admin.EditRequest) (*admin.Response, error) { +func (l *AdminEditLogic) AdminEdit(in *admin.AdminEditRequest) (*admin.Response, error) { // todo: add your logic here and delete this line - return &admin.Response{ - Msg: in.Name + " " + in.Pwd, - }, nil + return &admin.Response{}, nil } diff --git a/admin/internal/logic/admininfologic.go b/admin/internal/logic/admininfologic.go new file mode 100644 index 0000000..674437c --- /dev/null +++ b/admin/internal/logic/admininfologic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "admin/admin" + "admin/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AdminInfoLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewAdminInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminInfoLogic { + return &AdminInfoLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AdminInfoLogic) AdminInfo(in *admin.AdminInfoRequest) (*admin.Response, error) { + // todo: add your logic here and delete this line + + return &admin.Response{}, nil +} diff --git a/admin/internal/logic/adminitemslogic.go b/admin/internal/logic/adminitemslogic.go new file mode 100644 index 0000000..77a69bc --- /dev/null +++ b/admin/internal/logic/adminitemslogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "admin/admin" + "admin/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AdminItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewAdminItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminItemsLogic { + return &AdminItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AdminItemsLogic) AdminItems(in *admin.AdminItemsRequest) (*admin.Response, error) { + // todo: add your logic here and delete this line + + return &admin.Response{}, nil +} diff --git a/admin/internal/logic/adminloginlogic.go b/admin/internal/logic/adminloginlogic.go new file mode 100644 index 0000000..1ce4fa7 --- /dev/null +++ b/admin/internal/logic/adminloginlogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "admin/admin" + "admin/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AdminLoginLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewAdminLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminLoginLogic { + return &AdminLoginLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AdminLoginLogic) AdminLogin(in *admin.AdminLoginRequest) (*admin.Response, error) { + // todo: add your logic here and delete this line + + return &admin.Response{}, nil +} diff --git a/admin/internal/logic/adminstatuslogic.go b/admin/internal/logic/adminstatuslogic.go new file mode 100644 index 0000000..15be1a1 --- /dev/null +++ b/admin/internal/logic/adminstatuslogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "admin/admin" + "admin/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AdminStatusLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewAdminStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminStatusLogic { + return &AdminStatusLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AdminStatusLogic) AdminStatus(in *admin.StatusRequest) (*admin.Response, error) { + // todo: add your logic here and delete this line + + return &admin.Response{}, nil +} diff --git a/admin/internal/logic/base.go b/admin/internal/logic/base.go new file mode 100644 index 0000000..9ea58aa --- /dev/null +++ b/admin/internal/logic/base.go @@ -0,0 +1,31 @@ +package logic + +import ( + "admin/admin" + + "pkg.local/utils" + validateService "pkg.local/validate" +) + +type BaseLogic struct { +} + +func (l *BaseLogic) checkParams(in *admin.AdminEditRequest, v validateService.IValidator) *admin.Response { + + if resp := validateService.ValidateFromProto(in, v); resp != utils.StringEmpty { + return &admin.Response{Code: utils.ErrorParams.Code, Msg: resp} + } + return nil +} + +func (l *AdminAddLogic) fail(status utils.Status) *admin.Response { + return &admin.Response{Code: status.Code, Msg: status.Msg} +} + +func (l *AdminAddLogic) out(status utils.Status, msg string) *admin.Response { + return &admin.Response{Code: status.Code, Msg: msg} +} + +func (l *AdminAddLogic) ok(data any) *admin.Response { + return &admin.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg} +} diff --git a/admin/internal/logic/ownpasswordlogic.go b/admin/internal/logic/ownpasswordlogic.go new file mode 100644 index 0000000..9e22bf8 --- /dev/null +++ b/admin/internal/logic/ownpasswordlogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "admin/admin" + "admin/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type OwnPasswordLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewOwnPasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OwnPasswordLogic { + return &OwnPasswordLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *OwnPasswordLogic) OwnPassword(in *admin.OwnPasswordRequest) (*admin.Response, error) { + // todo: add your logic here and delete this line + + return &admin.Response{}, nil +} diff --git a/admin/internal/logic/statuslogic.go b/admin/internal/logic/passwordlogic.go similarity index 60% rename from admin/internal/logic/statuslogic.go rename to admin/internal/logic/passwordlogic.go index fb367ba..ae98967 100644 --- a/admin/internal/logic/statuslogic.go +++ b/admin/internal/logic/passwordlogic.go @@ -9,21 +9,21 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type StatusLogic struct { +type PasswordLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatusLogic { - return &StatusLogic{ +func NewPasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PasswordLogic { + return &PasswordLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *StatusLogic) Status(in *admin.StatusRequest) (*admin.Response, error) { +func (l *PasswordLogic) Password(in *admin.PasswordRequest) (*admin.Response, error) { // todo: add your logic here and delete this line return &admin.Response{}, nil diff --git a/admin/internal/model/admin.go b/admin/internal/model/admin.go new file mode 100644 index 0000000..0a854be --- /dev/null +++ b/admin/internal/model/admin.go @@ -0,0 +1,24 @@ +package model + +import ( + "admin/internal/dao" + + "pkg.local/modelbase" +) + +type AdminModel struct { + modelbase.Base +} + +func (m AdminModel) TableName() string { + return modelbase.Prefix() + "admin" +} + +func (m AdminModel) Init() AdminModel { + m.Table = m.TableName() + return m +} + +func (m AdminModel) Create(data *dao.Admin) error { + return m.Base.Create(data) +} diff --git a/admin/internal/server/adminserver.go b/admin/internal/server/adminserver.go index d86b025..b16ddfb 100644 --- a/admin/internal/server/adminserver.go +++ b/admin/internal/server/adminserver.go @@ -23,17 +23,42 @@ func NewAdminServer(svcCtx *svc.ServiceContext) *AdminServer { } } -func (s *AdminServer) Add(ctx context.Context, in *admin.AddRequest) (*admin.Response, error) { - l := logic.NewAddLogic(ctx, s.svcCtx) - return l.Add(in) +func (s *AdminServer) AdminAdd(ctx context.Context, in *admin.AdminEditRequest) (*admin.Response, error) { + l := logic.NewAdminAddLogic(ctx, s.svcCtx) + return l.AdminAdd(in) } -func (s *AdminServer) Edit(ctx context.Context, in *admin.EditRequest) (*admin.Response, error) { - l := logic.NewEditLogic(ctx, s.svcCtx) - return l.Edit(in) +func (s *AdminServer) AdminEdit(ctx context.Context, in *admin.AdminEditRequest) (*admin.Response, error) { + l := logic.NewAdminEditLogic(ctx, s.svcCtx) + return l.AdminEdit(in) } -func (s *AdminServer) Status(ctx context.Context, in *admin.StatusRequest) (*admin.Response, error) { - l := logic.NewStatusLogic(ctx, s.svcCtx) - return l.Status(in) +func (s *AdminServer) AdminStatus(ctx context.Context, in *admin.StatusRequest) (*admin.Response, error) { + l := logic.NewAdminStatusLogic(ctx, s.svcCtx) + return l.AdminStatus(in) +} + +func (s *AdminServer) Password(ctx context.Context, in *admin.PasswordRequest) (*admin.Response, error) { + l := logic.NewPasswordLogic(ctx, s.svcCtx) + return l.Password(in) +} + +func (s *AdminServer) OwnPassword(ctx context.Context, in *admin.OwnPasswordRequest) (*admin.Response, error) { + l := logic.NewOwnPasswordLogic(ctx, s.svcCtx) + return l.OwnPassword(in) +} + +func (s *AdminServer) AdminInfo(ctx context.Context, in *admin.AdminInfoRequest) (*admin.Response, error) { + l := logic.NewAdminInfoLogic(ctx, s.svcCtx) + return l.AdminInfo(in) +} + +func (s *AdminServer) AdminItems(ctx context.Context, in *admin.AdminItemsRequest) (*admin.Response, error) { + l := logic.NewAdminItemsLogic(ctx, s.svcCtx) + return l.AdminItems(in) +} + +func (s *AdminServer) AdminLogin(ctx context.Context, in *admin.AdminLoginRequest) (*admin.Response, error) { + l := logic.NewAdminLoginLogic(ctx, s.svcCtx) + return l.AdminLogin(in) } diff --git a/admin/proto/admin.proto b/admin/proto/admin.proto index c947ca7..73646cc 100644 --- a/admin/proto/admin.proto +++ b/admin/proto/admin.proto @@ -3,29 +3,64 @@ syntax = "proto3"; package admin; option go_package="./admin"; -message AddRequest { - string name = 1; - string pwd = 2; -} +import "google/protobuf/any.proto"; -message EditRequest { - string name = 1; - string pwd = 2; +message AdminEditRequest { + int64 id = 1; + string name = 2; + string password = 3; + string avatar = 4; + string phone = 5; + string email = 6; + repeated int64 roles = 7; } message StatusRequest { - string name = 1 ; - string pwd = 2 ; + int64 id = 1 ; + int32 status = 2 ; + string reason = 3; } message Response { int32 code = 1; string msg = 2; - string data = 3; + google.protobuf.Any data = 3; +} + +message PasswordRequest { + int64 id = 1; + string password = 2; +} + +message OwnPasswordRequest { + string password = 1; +} + +message AdminInfoRequest { + int64 id = 1; +} + +message AdminItemsRequest { + int32 page = 1; + int32 size = 2; + string phone = 3; + string name = 5; + string email = 6; + int32 status = 7; +} + +message AdminLoginRequest { + int32 username = 1; + int32 password = 2; } service Admin { - rpc Add(AddRequest) returns(Response); - rpc Edit(EditRequest) returns(Response); - rpc Status(StatusRequest) returns(Response); + rpc AdminAdd(AdminEditRequest) returns(Response); + rpc AdminEdit(AdminEditRequest) returns(Response); + rpc AdminStatus(StatusRequest) returns(Response); + rpc Password(PasswordRequest) returns(Response); + rpc OwnPassword(OwnPasswordRequest) returns(Response); + rpc AdminInfo(AdminInfoRequest) returns(Response); + rpc AdminItems(AdminItemsRequest) returns(Response); + rpc AdminLogin(AdminLoginRequest) returns(Response); } \ No newline at end of file diff --git a/admin/validator/validator.go b/admin/validator/validator.go index 038b143..553d84c 100644 --- a/admin/validator/validator.go +++ b/admin/validator/validator.go @@ -4,14 +4,95 @@ import ( "pkg.local/validate" ) -type AdminAddValidator struct { - Name string `validate:"required"` - Pwd string `validate:"required"` +// AdminEditValidator 创建/编辑 +type AdminEditValidator struct { + Id int + Name string `validate:"required"` + Password string + Avatar string + Phone string `validate:"required"` + Email string `validate:"required,email"` + Roles []int } -func (p AdminAddValidator) GetMessage() validate.ValidatorMessages { +// GetMessage 创建/编辑 - 提示消息 +func (p AdminEditValidator) GetMessage() validate.ValidatorMessages { return validate.ValidatorMessages{ - "Pwd.required": "密码不能为空", - "Name.required": "姓名不能为空", + "Phone.required": "手机号不能为空", + "Email.email": "邮箱格式不对", + "Email.required": "邮箱不能为空", + "Username.required": "账号不能为空", + "Name.required": "姓名不能为空", + } +} + +// AdminPasswordValidator 修改所有管理员密码 +type AdminPasswordValidator struct { + Id int `validate:"required"` + Password string `validate:"required"` +} + +// GetMessage 修改所有管理员密码 - 提示消息 +func (p AdminPasswordValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Id.required": "ID不能为空", + "Password.required": "密码不能为空", + } +} + +// AdminOwnPasswordValidator 修改所有管理员密码 +type AdminOwnPasswordValidator struct { + Password string `validate:"required"` +} + +// GetMessage 修改所有管理员密码 - 提示消息 +func (p AdminOwnPasswordValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Password.required": "密码不能为空", + } +} + +// AdminInfoValidator 查看信息 +type AdminInfoValidator struct { + Id int `validate:"required"` +} + +// GetMessage 查看信息 - 提示消息 +func (p AdminInfoValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Id.required": "ID不能为空", + } +} + +// AdminItemsValidator 查看列表 +type AdminItemsValidator struct { + Page int + Size int + Phone string + Username string + Name string + Email string + Status uint8 +} + +// GetMessage 查看列表 - 提示消息 +func (p AdminItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} + +// AdminStatusValidator 修改状态 +type AdminStatusValidator struct { + Id int `validate:"required"` + Status uint8 `validate:"required,oneof=1 2"` + Reason string `validate:"required_if=Status 1"` +} + +// GetMessage 修改状态 - 提示消息 +func (p AdminStatusValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Id.required": "ID不能为空", + "Status.required": "状态不能为空", + "Status.oneof": "状态传值不对", + "Reason.required_if": "理由不能为空", } } diff --git a/pkg/utils/config.go b/pkg/utils/config.go index 4c394bd..fb2a43f 100644 --- a/pkg/utils/config.go +++ b/pkg/utils/config.go @@ -25,11 +25,16 @@ var ( currentMd5 string ) -func GetConfig(key string) interface{} { return runViper.Get(key) } -func GetConfigString(key string) string { return runViper.GetString(key) } -func GetConfigInt(key string) int { return runViper.GetInt(key) } -func GetConfigInt64(key string) int64 { return runViper.GetInt64(key) } -func GetConfigBool(key string) bool { return runViper.GetBool(key) } +func GetConfig(key string) interface{} { return runViper.Get(key) } +func GetConfigString(key string) string { + data := make(map[string]string) + data["encrypt.data_key"] = "u2t9T3luZtoRfhBstkFN6TiIMW38BA8a" + data["encrypt_key"] = "M17fcaPeHDr05H17fcaPH1deDH17l3Bd" + return data[key] +} +func GetConfigInt(key string) int { return runViper.GetInt(key) } +func GetConfigInt64(key string) int64 { return runViper.GetInt64(key) } +func GetConfigBool(key string) bool { return runViper.GetBool(key) } func InitConfig() { loadOnce.Do(func() { diff --git a/pkg/utils/encrypt.go b/pkg/utils/encrypt.go index 0b678c6..e4e3852 100644 --- a/pkg/utils/encrypt.go +++ b/pkg/utils/encrypt.go @@ -75,3 +75,106 @@ func HmacSha256ToHex(key string, data string) string { func HmacSha256ToBase64(key string, data string) string { return base64.URLEncoding.EncodeToString(HmacSha256(key, data)) } + +func EncryptPhone(phone string) (string, Error) { + // 提取各部分 + prefix := phone[NumberZero:NumberThree] // 前三位 + middle := phone[NumberThree:NumberSeven] // 中四位 + suffix := phone[NumberSeven:NumberEleven] // 尾四位 + newPhone := StringEmpty + username, cErr := Crypto{}.AESEncryptECB(prefix) + if cErr != nil { + return StringEmpty, cErr + } + newPhone = username + username, cErr = Crypto{}.AESEncryptECB(middle) + if cErr != nil { + return StringEmpty, cErr + } + newPhone += username + username, cErr = Crypto{}.AESEncryptECB(suffix) + if cErr != nil { + return StringEmpty, cErr + } + newPhone += username + return newPhone, nil +} + +func DecryptPhone(phone string) (string, Error) { + // 提取各部分 + prefix := phone[NumberZero:24] // 前三位 + middle := phone[24:48] // 中四位 + suffix := phone[48:72] // 尾四位 + newPhone := StringEmpty + username, cErr := Crypto{}.AESDecryptECB(prefix) + if cErr != nil { + return StringEmpty, cErr + } + newPhone = username + username, cErr = Crypto{}.AESDecryptECB(middle) + if cErr != nil { + return StringEmpty, cErr + } + newPhone += username + username, cErr = Crypto{}.AESDecryptECB(suffix) + if cErr != nil { + return StringEmpty, cErr + } + newPhone += username + return newPhone, nil +} + +func getSearchPhone(mobile string) string { + phone := StringEmpty + if len(mobile) == 11 { + prefix := mobile[NumberZero:3] // 前三位 + username, cErr := Crypto{}.AESEncryptECB(prefix) + if cErr == nil { + phone = username + } + prefix = mobile[NumberThree:NumberSeven] // 中四位 + username, cErr = Crypto{}.AESEncryptECB(prefix) + if cErr == nil { + phone += username + } + prefix = mobile[NumberSeven:NumberEleven] // 尾四位 + username, cErr = Crypto{}.AESEncryptECB(prefix) + if cErr == nil { + phone += username + } + } else if len(mobile) > NumberTwo { + prefix := mobile[NumberZero:NumberThree] //前三位 + if len(mobile) == NumberFour { + prefix = mobile[NumberZero:NumberFour] // 前四位 + } + username, cErr := Crypto{}.AESEncryptECB(prefix) + if cErr == nil { + phone = username + } + if len(mobile) > NumberFour { + prefix = mobile[NumberThree:] // 中四位 + username, cErr = Crypto{}.AESEncryptECB(prefix) + if cErr == nil { + phone += username + } + } + } + return phone +} + +// GetRandstring 取得随机字符串:使用字符串拼接 +func GetRandstring(length int) string { + if length < 1 { + return StringEmpty + } + char := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + charArr := strings.Split(char, StringEmpty) + charlen := len(charArr) + ran := rand.New(rand.NewSource(time.Now().Unix())) + + var rchar string = StringEmpty + for i := 1; i <= length; i++ { + rchar = rchar + charArr[ran.Intn(charlen)] + } + return rchar +} diff --git a/pkg/utils/sms.go b/pkg/utils/sms.go deleted file mode 100644 index 5d5842f..0000000 --- a/pkg/utils/sms.go +++ /dev/null @@ -1,305 +0,0 @@ -package utils - -import ( - "crypto/tls" - "encoding/json" - "fmt" - "net/smtp" - - openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" - dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v3/client" - "github.com/alibabacloud-go/tea/tea" - "github.com/joho/godotenv" -) - -// 短信签名常量 -const ( - //SignLone = "爱萝湾" - SignLone = "爱萝湾上海科技有限公司" -) - -// 短信模板CODE常量 -const ( - SmsCode = "SMS_506160477" - SmsPwd = "SMS_506200455" -) - -// 状态码常量(模拟PHP中的Code类) -const ( - CodeOK = 0 // 成功状态码 - CodeError = -1 // 错误状态码 -) - -// ResponseData 短信发送返回结构体 -type ResponseData struct { - Code int `json:"code"` - Msg interface{} `json:"msg"` -} - -type EmailMsg struct { - To []string // 收件人 - Cc []string // 抄送 - Bcc []string // 密送 - Subject string // 标题 - Body string // 正文,支持html - IsHTML bool // 是否HTML格式 -} - -// CreateClient 创建阿里云短信客户端 -func CreateClient() (*dysmsapi20170525.Client, error) { - // 加载.env文件(如果需要) - _ = godotenv.Load() - - key := GetConfigString("sms.sms_ali_api_key") - secret := GetConfigString("sms.sms_ali_api_secret") - // 初始化配置 - config := &openapi.Config{ - // 从环境变量获取AccessKey ID - AccessKeyId: &key, - // 从环境变量获取AccessKey Secret - AccessKeySecret: &secret, - } - // 设置短信服务接入点 - config.Endpoint = tea.String("dysmsapi.aliyuncs.com") - - // 创建客户端 - client, err := dysmsapi20170525.NewClient(config) - if err != nil { - return nil, err - } - return client, nil -} - -// SendSMS 发送短信主方法 -// mobile: 手机号 -// code: 短信模板CODE -// data: 模板参数(map格式) -// sign: 短信签名(可选,默认使用SignLone) -func SendSMS(mobile, code string, data map[string]interface{}, sign ...string) ResponseData { - test := GetConfigBool("sms.sms_test") - retData := ResponseData{ - Code: CodeOK, - Msg: "", - } - if test { - return retData - } - // 设置默认签名 - signName := SignLone - name := GetConfigString("sms.sms_sign") - if name != "" { - signName = name - } - - if len(sign) > 0 && sign[0] != "" { - signName = sign[0] - } - - // 创建客户端 - client, err := CreateClient() - if err != nil { - return ResponseData{ - Code: CodeError, - Msg: fmt.Sprintf("创建客户端失败: %s", err.Error()), - } - } - - // 转换模板参数为JSON字符串 - templateParam, err := json.Marshal(data) - if err != nil { - return ResponseData{ - Code: CodeError, - Msg: fmt.Sprintf("参数JSON编码失败: %s", err.Error()), - } - } - - // 构建发送短信请求 - sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ - PhoneNumbers: tea.String(mobile), - SignName: tea.String(signName), - TemplateCode: tea.String(code), - TemplateParam: tea.String(string(templateParam)), - } - - Logger.Error(signName, "m=", mobile, ":", sendSmsRequest, "2=", code, "tmpo:", string(templateParam)) - - // 发送短信 - response, err := client.SendSms(sendSmsRequest) - if err != nil { - // 处理错误 - retData.Code = CodeError - retData.Msg = fmt.Sprintf("发送短信失败: %s", err.Error()) - return retData - } - - statusCode := *response.StatusCode - - // 检查响应状态 - if statusCode != 200 { - retData.Code = CodeError - } - - // 将响应转换为map返回 - retData.Msg = map[string]interface{}{ - "StatusCode": response.StatusCode, - "Body": response.Body, - } - - return retData -} - -// 简化调用示例(可选) -// SendCodeSMS 发送验证码短信 -func SendCodeSMS(mobile string, code string) ResponseData { - data := map[string]interface{}{ - "code": code, - } - code = getConfig("sms.sms_code_sign") - if code == "" { - code = SmsCode - } - return SendSMS(mobile, code, data) -} - -func SendCodeMail(msg EmailMsg) ResponseData { - user := GetConfigString("sms.sms_mail_user") - pwd := GetConfigString("sms.sms_mail_pwd") - host := GetConfigString("sms.sms_mail_host") - port := GetConfigInt("sms.sms_mail_port") - name := GetConfigString("sms.sms_mail_show_name") - auth := smtp.PlainAuth("", user, pwd, host) - from := fmt.Sprintf("%s <%s>", name, user) - // 构建邮件头部 - var header string - header += fmt.Sprintf("From: %s\r\n", from) - header += fmt.Sprintf("To: %s\r\n", joinStrings(msg.To, ",")) - if len(msg.Cc) > 0 { - header += fmt.Sprintf("Cc: %s\r\n", joinStrings(msg.Cc, ",")) - } - if len(msg.Bcc) > 0 { - header += fmt.Sprintf("Bcc: %s\r\n", joinStrings(msg.Bcc, ",")) - } - header += fmt.Sprintf("Subject: %s\r\n", msg.Subject) - - contentType := "text/plain; charset=utf-8" - if msg.IsHTML { - contentType = "text/html; charset=utf-8" - } - header += fmt.Sprintf("Content-Type: %s\r\n\r\n", contentType) - fullMsg := []byte(header + msg.Body) - - tlsConfig := &tls.Config{ - ServerName: host, - } - addr := fmt.Sprintf("%s:%d", host, port) - - // 1. 先建立SSL连接(465端口) - conn, err := tls.Dial("tcp", addr, tlsConfig) - if err != nil { - Logger.Error("tls dial err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - // 2. 关键:用加密连接创建smtp client - client, err := smtp.NewClient(conn, host) - if err != nil { - _ = conn.Close() - Logger.Error("smtp.NewClient err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - // 由client统一管理连接关闭 - defer client.Close() - - if err = client.Auth(auth); err != nil { - Logger.Error("client.Auth err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - - if err = client.Mail(user); err != nil { - Logger.Error("client.Mail err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - - receivers := append(append(msg.To, msg.Cc...), msg.Bcc...) - for _, r := range receivers { - if err = client.Rcpt(r); err != nil { - Logger.Error("client.Rcpt err:", err, "rcpt:", r) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - } - - w, err := client.Data() - if err != nil { - Logger.Error("client.Data err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - _, err = w.Write(fullMsg) - if err != nil { - Logger.Error("write mail body err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - err = w.Close() - if err != nil { - Logger.Error("w.Close err:", err) - return ResponseData{ - Code: CodeError, - Msg: err.Error(), - } - } - - err = client.Quit() - if err != nil { - Logger.Error("client.Quit err:", err) - return ResponseData{ - Code: CodeError, - Msg: "smtp quit failed: " + err.Error(), - } - } - return ResponseData{ - Code: CodeOK, - Msg: "", - } -} - -func joinStrings(arr []string, sep string) string { - if len(arr) == 0 { - return "" - } - res := arr[0] - for i := 1; i < len(arr); i++ { - res += sep + arr[i] - } - return res -} - -// SendPwdSMS 发送密码相关短信 -func SendPwdSMS(mobile string, pwd string) ResponseData { - data := map[string]interface{}{ - "code": pwd, - } - code := getConfig("sms.sms_pwd_sign") - if code == "" { - code = SmsPwd - } - return SendSMS(mobile, code, data) -} diff --git a/pkg/utils/status.go b/pkg/utils/status.go index fffbaa8..693af50 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -17,6 +17,9 @@ const ( NumberSeven = 7 NumberEight = 8 NumberNine = 9 + NumberTen = 10 + NumberEleven = 11 + NumberTwelve = 12 NumberSixteen = 16 NumberThirtyTwo = 32 @@ -31,6 +34,9 @@ const ( CentralHorizontalLine = " - " DecollatorEqual = "=" StringEmpty = "" + StringDot = "." + StringStatusOk = "1" + StringStatusNo = "2" ) const ( @@ -52,10 +58,14 @@ const ( var ( //新使用方法 - Ok = Status{Code: 10000, Msg: "OK"} + Ok = Status{Code: 10000, Msg: "OK"} + Fail = Status{Code: 999, Msg: "fail"} + ErrorParams = Status{Code: 10001, Msg: "缺少参数或传值不对"} + ErrorEncryptAesError = Status{Code: 10001, Msg: "加密失败"} + ErrorNotFund = Status{Code: 11001, Msg: "not fund"} + ErrorExistUser = Status{Code: 10009, Msg: "账号或手机号已存在"} // 基础类 - Fail = NewError(999, "fail") ErrorExist = NewError(998, "已存在") ErrorOvertime = NewError(997, "请求已超时") ErrorDataTransform = NewError(996, "数据转换失败") @@ -63,7 +73,6 @@ var ( ErrorWecomHttpError = NewError(994, "企业微信请求失败") // 参数类 - ErrorMissingParams = NewError(10001, "缺少参数") ErrorReasonParams = NewError(10001, "原因不能为空") ErrorPwdError = NewError(10002, "密码错误") ErrorNoLogin = NewError(10003, "没有登录") @@ -74,14 +83,12 @@ var ( ErrorAuthority = NewError(10008, "没有权限") ErrorMobileError = NewError(10009, "手机号不对") ErrorEncryptMissingKey = NewError(10010, "加密密钥错误") - ErrorEncryptAesError = NewError(10011, "加密失败") ErrorDecryptAesError = NewError(10012, "解密失败") ErrorEncryptAesKeyError = NewError(10013, "AESKey失败") ErrorEncryptBase64Error = NewError(10014, "解码失败") ErrorNameInexistence = NewError(10015, "账号不存在") // ErrorNotFund 数据类 - ErrorNotFund = NewError(11001, "not fund") ErrorNoChange = NewError(11002, "没有改变") ErrorDataIsExist = NewError(11004, "数据已存在") ErrorRepeatPayment = NewError(11005, "不能重复支付")