diff --git a/.gitea/workflows/cd-test.yml b/.gitea/workflows/cd-test.yml index bd84a13..9bc68c2 100644 --- a/.gitea/workflows/cd-test.yml +++ b/.gitea/workflows/cd-test.yml @@ -41,6 +41,7 @@ jobs: docker pull ${{ vars.REGISTRY }}/lone/user:latest docker pull ${{ vars.REGISTRY }}/lone/ad:latest docker pull ${{ vars.REGISTRY }}/lone/chore:latest + docker pull ${{ vars.REGISTRY }}/lone/order:latest docker pull ${{ vars.REGISTRY }}/lone/express:latest docker pull ${{ vars.REGISTRY }}/lone/sale:latest docker pull ${{ vars.REGISTRY }}/lone/equipment:latest diff --git a/pkg/redis/redis.go b/pkg/redis/redis.go index 461623c..087a676 100644 --- a/pkg/redis/redis.go +++ b/pkg/redis/redis.go @@ -9,6 +9,7 @@ import ( ) const Nil = goredis.Nil +const RedisNil = "redis: nil" var Client *goredis.Client diff --git a/pkg/utils/status.go b/pkg/utils/status.go index 4e28d6e..b61eacc 100644 --- a/pkg/utils/status.go +++ b/pkg/utils/status.go @@ -73,6 +73,20 @@ const ( StatusWaitPass = 9 //待审核 RpcTimeOut = 5000 //服务连接超时时间 毫秒 + + StoreApplyReview = 1 // 提交审核(按钮消息) + StoreNeedReview = 2 // 通知申请人 + StoreSubmitReview = 3 // 通知一审人员 + StoreFirstReview = 4 // 一审审核结果 + StoreSecondReview = 5 // 二审审核结果 + + SaleType = 1 + AdminType = 2 + + EditLogTypeProduct = 1 // 产品 + EditLogTypeStore = 2 // 门店 + EditLogTypeAddress = 3 // 地址 + EditLogTypeSales = 4 // 销售 ) const ( @@ -108,7 +122,9 @@ var ( ErrorVerifyReview = Status{Code: 10011, Msg: "不能重复审核"} ErrorOrderOver = Status{Code: 11012, Msg: "订单已完结"} // 数据类 - ErrorDataIsExist = Status{Code: 11004, Msg: "数据已存在"} + ErrorDataIsExist = Status{Code: 11004, Msg: "数据已存在"} + ErrorBindError = Status{Code: 11016, Msg: "设备已绑定,请不要重复绑定"} + ErrorBindOtherError = Status{Code: 110167, Msg: "该设备已绑定其它用户,请不要重复绑定"} // 参数类 ErrorReasonParams = Status{Code: 10012, Msg: "原因不能为空"} @@ -145,8 +161,6 @@ var ( ErrorFirstTryErr = NewError(11008, "已购买过首次试用品") ErrorTryError = NewError(11009, "不满足购买条件") ErrorDataNotExist = NewError(11011, "数据不存在") - ErrorBindError = NewError(11012, "设备已绑定,请不要重复绑定") - ErrorBindOtherError = NewError(11013, "该设备已绑定其它用户,请不要重复绑定") ) func SetError(error Status, msg string) Status { diff --git a/rpc/chore/chore.pb b/rpc/chore/chore.pb index e46ac06..4657ddb 100644 Binary files a/rpc/chore/chore.pb and b/rpc/chore/chore.pb differ diff --git a/rpc/chore/chore.proto b/rpc/chore/chore.proto index 505af53..131e684 100644 --- a/rpc/chore/chore.proto +++ b/rpc/chore/chore.proto @@ -81,6 +81,7 @@ service Chore { } rpc RegionsByIds(RegionsByIdsReq) returns (RegionsByIdsData); rpc InternalActionApplyLogCreate(InternalActionApplyLogCreateReq) returns (InternalActionApplyLogCreateData); + rpc SendPassword(SendPasswordReq) returns (SendPasswordResp); } message Response { @@ -162,4 +163,16 @@ message InternalActionApplyLogCreateReq { message InternalActionApplyLogCreateData { int64 id = 1; +} + +message SendPasswordReq { + string mobile = 1; + string password = 2; + string browser_info = 3; + string ip = 4; + string browser_name = 5; +} + +message SendPasswordResp { + int32 code = 1; } \ No newline at end of file diff --git a/rpc/chore/pb/chore.pb.go b/rpc/chore/pb/chore.pb.go index 52f04a0..5425d6b 100644 --- a/rpc/chore/pb/chore.pb.go +++ b/rpc/chore/pb/chore.pb.go @@ -7,13 +7,12 @@ package chore import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -747,7 +746,7 @@ type InternalActionApplyLogCreateReq struct { state protoimpl.MessageState `protogen:"open.v1"` AdminId int64 `protobuf:"varint,1,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` ObjId int64 `protobuf:"varint,2,opt,name=obj_id,json=objId,proto3" json:"obj_id,omitempty"` - Type uint32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` // 1产品 2门店 + Type uint32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` // 1产品 2门店 3地址 4销售 Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"` Status uint32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` // 1通过 2驳回 9待审核 unknownFields protoimpl.UnknownFields @@ -779,6 +778,7 @@ func (x *InternalActionApplyLogCreateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use InternalActionApplyLogCreateReq.ProtoReflect.Descriptor instead. func (*InternalActionApplyLogCreateReq) Descriptor() ([]byte, []int) { return file_chore_chore_proto_rawDescGZIP(), []int{14} } @@ -850,6 +850,7 @@ func (x *InternalActionApplyLogCreateData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use InternalActionApplyLogCreateData.ProtoReflect.Descriptor instead. func (*InternalActionApplyLogCreateData) Descriptor() ([]byte, []int) { return file_chore_chore_proto_rawDescGZIP(), []int{15} } @@ -861,6 +862,126 @@ func (x *InternalActionApplyLogCreateData) GetId() int64 { return 0 } +type SendPasswordReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + BrowserInfo string `protobuf:"bytes,3,opt,name=browser_info,json=browserInfo,proto3" json:"browser_info,omitempty"` + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` + BrowserName string `protobuf:"bytes,5,opt,name=browser_name,json=browserName,proto3" json:"browser_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SendPasswordReq) Reset() { + *x = SendPasswordReq{} + mi := &file_chore_chore_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SendPasswordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendPasswordReq) ProtoMessage() {} + +func (x *SendPasswordReq) ProtoReflect() protoreflect.Message { + mi := &file_chore_chore_proto_msgTypes[16] + 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 SendPasswordReq.ProtoReflect.Descriptor instead. +func (*SendPasswordReq) Descriptor() ([]byte, []int) { + return file_chore_chore_proto_rawDescGZIP(), []int{16} +} + +func (x *SendPasswordReq) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *SendPasswordReq) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *SendPasswordReq) GetBrowserInfo() string { + if x != nil { + return x.BrowserInfo + } + return "" +} + +func (x *SendPasswordReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *SendPasswordReq) GetBrowserName() string { + if x != nil { + return x.BrowserName + } + return "" +} + +type SendPasswordResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SendPasswordResp) Reset() { + *x = SendPasswordResp{} + mi := &file_chore_chore_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SendPasswordResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendPasswordResp) ProtoMessage() {} + +func (x *SendPasswordResp) ProtoReflect() protoreflect.Message { + mi := &file_chore_chore_proto_msgTypes[17] + 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 SendPasswordResp.ProtoReflect.Descriptor instead. +func (*SendPasswordResp) Descriptor() ([]byte, []int) { + return file_chore_chore_proto_rawDescGZIP(), []int{17} +} + +func (x *SendPasswordResp) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + var File_chore_chore_proto protoreflect.FileDescriptor const file_chore_chore_proto_rawDesc = "" + @@ -918,8 +1039,15 @@ const file_chore_chore_proto_rawDesc = "" + "\x06reason\x18\x04 \x01(\tR\x06reason\x12\x16\n" + "\x06status\x18\x05 \x01(\rR\x06status\"2\n" + " InternalActionApplyLogCreateData\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id2\xda\n" + - "\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x9b\x01\n" + + "\x0fSendPasswordReq\x12\x16\n" + + "\x06mobile\x18\x01 \x01(\tR\x06mobile\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12!\n" + + "\fbrowser_info\x18\x03 \x01(\tR\vbrowserInfo\x12\x0e\n" + + "\x02ip\x18\x04 \x01(\tR\x02ip\x12!\n" + + "\fbrowser_name\x18\x05 \x01(\tR\vbrowserName\"&\n" + + "\x10SendPasswordResp\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code2\x9b\v\n" + "\x05Chore\x12P\n" + "\x06Policy\x12\x10.chore.PolicyReq\x1a\x0f.chore.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\x12\x18/api/v3/chore/oss/policy\x12F\n" + "\x04Test\x12\x0e.chore.TestReq\x1a\x0f.chore.Response\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/api/v3/chore/test\x12_\n" + @@ -940,7 +1068,8 @@ const file_chore_chore_proto_rawDesc = "" + "SystemInfo\x12\f.chore.IdReq\x1a\x0f.chore.Response\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/admin/v3/chore/system/info\x12U\n" + "\vSystemItems\x12\x0f.chore.EmptyReq\x1a\x0f.chore.Response\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/admin/v3/chore/system/items\x12?\n" + "\fRegionsByIds\x12\x16.chore.RegionsByIdsReq\x1a\x17.chore.RegionsByIdsData\x12o\n" + - "\x1cInternalActionApplyLogCreate\x12&.chore.InternalActionApplyLogCreateReq\x1a'.chore.InternalActionApplyLogCreateDataB\x19Z\x17lone-services/rpc/choreb\x06proto3" + "\x1cInternalActionApplyLogCreate\x12&.chore.InternalActionApplyLogCreateReq\x1a'.chore.InternalActionApplyLogCreateData\x12?\n" + + "\fSendPassword\x12\x16.chore.SendPasswordReq\x1a\x17.chore.SendPasswordRespB\x19Z\x17lone-services/rpc/choreb\x06proto3" var ( file_chore_chore_proto_rawDescOnce sync.Once @@ -954,7 +1083,7 @@ func file_chore_chore_proto_rawDescGZIP() []byte { return file_chore_chore_proto_rawDescData } -var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_chore_chore_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_chore_chore_proto_goTypes = []any{ (*Response)(nil), // 0: chore.Response (*EmptyReq)(nil), // 1: chore.EmptyReq @@ -972,6 +1101,8 @@ var file_chore_chore_proto_goTypes = []any{ (*SendSmsReq)(nil), // 13: chore.SendSmsReq (*InternalActionApplyLogCreateReq)(nil), // 14: chore.InternalActionApplyLogCreateReq (*InternalActionApplyLogCreateData)(nil), // 15: chore.InternalActionApplyLogCreateData + (*SendPasswordReq)(nil), // 16: chore.SendPasswordReq + (*SendPasswordResp)(nil), // 17: chore.SendPasswordResp } var file_chore_chore_proto_depIdxs = []int32{ 11, // 0: chore.RegionsByIdsData.items:type_name -> chore.RegionItem @@ -991,24 +1122,26 @@ var file_chore_chore_proto_depIdxs = []int32{ 1, // 14: chore.Chore.SystemItems:input_type -> chore.EmptyReq 10, // 15: chore.Chore.RegionsByIds:input_type -> chore.RegionsByIdsReq 14, // 16: chore.Chore.InternalActionApplyLogCreate:input_type -> chore.InternalActionApplyLogCreateReq - 0, // 17: chore.Chore.Policy:output_type -> chore.Response - 0, // 18: chore.Chore.Test:output_type -> chore.Response - 0, // 19: chore.Chore.DecryptMobile:output_type -> chore.Response - 0, // 20: chore.Chore.Regions:output_type -> chore.Response - 0, // 21: chore.Chore.SendSms:output_type -> chore.Response - 0, // 22: chore.Chore.AnswerItems:output_type -> chore.Response - 0, // 23: chore.Chore.AnswerStatus:output_type -> chore.Response - 0, // 24: chore.Chore.AnswerInfo:output_type -> chore.Response - 0, // 25: chore.Chore.AnswerCreate:output_type -> chore.Response - 0, // 26: chore.Chore.AnswerEdit:output_type -> chore.Response - 0, // 27: chore.Chore.SystemEdit:output_type -> chore.Response - 0, // 28: chore.Chore.SystemStatus:output_type -> chore.Response - 0, // 29: chore.Chore.SystemInfo:output_type -> chore.Response - 0, // 30: chore.Chore.SystemItems:output_type -> chore.Response - 12, // 31: chore.Chore.RegionsByIds:output_type -> chore.RegionsByIdsData - 15, // 32: chore.Chore.InternalActionApplyLogCreate:output_type -> chore.InternalActionApplyLogCreateData - 17, // [17:33] is the sub-list for method output_type - 1, // [1:17] is the sub-list for method input_type + 16, // 17: chore.Chore.SendPassword:input_type -> chore.SendPasswordReq + 0, // 18: chore.Chore.Policy:output_type -> chore.Response + 0, // 19: chore.Chore.Test:output_type -> chore.Response + 0, // 20: chore.Chore.DecryptMobile:output_type -> chore.Response + 0, // 21: chore.Chore.Regions:output_type -> chore.Response + 0, // 22: chore.Chore.SendSms:output_type -> chore.Response + 0, // 23: chore.Chore.AnswerItems:output_type -> chore.Response + 0, // 24: chore.Chore.AnswerStatus:output_type -> chore.Response + 0, // 25: chore.Chore.AnswerInfo:output_type -> chore.Response + 0, // 26: chore.Chore.AnswerCreate:output_type -> chore.Response + 0, // 27: chore.Chore.AnswerEdit:output_type -> chore.Response + 0, // 28: chore.Chore.SystemEdit:output_type -> chore.Response + 0, // 29: chore.Chore.SystemStatus:output_type -> chore.Response + 0, // 30: chore.Chore.SystemInfo:output_type -> chore.Response + 0, // 31: chore.Chore.SystemItems:output_type -> chore.Response + 12, // 32: chore.Chore.RegionsByIds:output_type -> chore.RegionsByIdsData + 15, // 33: chore.Chore.InternalActionApplyLogCreate:output_type -> chore.InternalActionApplyLogCreateData + 17, // 34: chore.Chore.SendPassword:output_type -> chore.SendPasswordResp + 18, // [18:35] is the sub-list for method output_type + 1, // [1:18] 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 @@ -1025,7 +1158,7 @@ func file_chore_chore_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_chore_chore_proto_rawDesc), len(file_chore_chore_proto_rawDesc)), NumEnums: 0, - NumMessages: 16, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/chore/pb/chore_grpc.pb.go b/rpc/chore/pb/chore_grpc.pb.go index dac0429..cad2e6b 100644 --- a/rpc/chore/pb/chore_grpc.pb.go +++ b/rpc/chore/pb/chore_grpc.pb.go @@ -35,6 +35,7 @@ const ( Chore_SystemItems_FullMethodName = "/chore.Chore/SystemItems" Chore_RegionsByIds_FullMethodName = "/chore.Chore/RegionsByIds" Chore_InternalActionApplyLogCreate_FullMethodName = "/chore.Chore/InternalActionApplyLogCreate" + Chore_SendPassword_FullMethodName = "/chore.Chore/SendPassword" ) // ChoreClient is the client API for Chore service. @@ -55,10 +56,9 @@ type ChoreClient interface { SystemStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error) SystemInfo(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*Response, error) SystemItems(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) - // 按 id 批量查地区名称 RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) - // 服务间:写入编辑申请日志 InternalActionApplyLogCreate(ctx context.Context, in *InternalActionApplyLogCreateReq, opts ...grpc.CallOption) (*InternalActionApplyLogCreateData, error) + SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) } type choreClient struct { @@ -229,6 +229,16 @@ func (c *choreClient) InternalActionApplyLogCreate(ctx context.Context, in *Inte return out, nil } +func (c *choreClient) SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SendPasswordResp) + err := c.cc.Invoke(ctx, Chore_SendPassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ChoreServer is the server API for Chore service. // All implementations must embed UnimplementedChoreServer // for forward compatibility. @@ -247,10 +257,9 @@ type ChoreServer interface { SystemStatus(context.Context, *StatusReq) (*Response, error) SystemInfo(context.Context, *IdReq) (*Response, error) SystemItems(context.Context, *EmptyReq) (*Response, error) - // 按 id 批量查地区名称 RegionsByIds(context.Context, *RegionsByIdsReq) (*RegionsByIdsData, error) - // 服务间:写入编辑申请日志 InternalActionApplyLogCreate(context.Context, *InternalActionApplyLogCreateReq) (*InternalActionApplyLogCreateData, error) + SendPassword(context.Context, *SendPasswordReq) (*SendPasswordResp, error) mustEmbedUnimplementedChoreServer() } @@ -309,6 +318,9 @@ func (UnimplementedChoreServer) RegionsByIds(context.Context, *RegionsByIdsReq) func (UnimplementedChoreServer) InternalActionApplyLogCreate(context.Context, *InternalActionApplyLogCreateReq) (*InternalActionApplyLogCreateData, error) { return nil, status.Error(codes.Unimplemented, "method InternalActionApplyLogCreate not implemented") } +func (UnimplementedChoreServer) SendPassword(context.Context, *SendPasswordReq) (*SendPasswordResp, error) { + return nil, status.Error(codes.Unimplemented, "method SendPassword not implemented") +} func (UnimplementedChoreServer) mustEmbedUnimplementedChoreServer() {} func (UnimplementedChoreServer) testEmbeddedByValue() {} @@ -618,6 +630,24 @@ func _Chore_InternalActionApplyLogCreate_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _Chore_SendPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendPasswordReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChoreServer).SendPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Chore_SendPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChoreServer).SendPassword(ctx, req.(*SendPasswordReq)) + } + return interceptor(ctx, in, info, handler) +} + // Chore_ServiceDesc is the grpc.ServiceDesc for Chore service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -689,6 +719,10 @@ var Chore_ServiceDesc = grpc.ServiceDesc{ MethodName: "InternalActionApplyLogCreate", Handler: _Chore_InternalActionApplyLogCreate_Handler, }, + { + MethodName: "SendPassword", + Handler: _Chore_SendPassword_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "chore/chore.proto", diff --git a/rpc/equipment/equipment.pb b/rpc/equipment/equipment.pb index cc08249..23e1c8d 100644 Binary files a/rpc/equipment/equipment.pb and b/rpc/equipment/equipment.pb differ diff --git a/rpc/equipment/equipment.proto b/rpc/equipment/equipment.proto index b49f5ce..448254c 100644 --- a/rpc/equipment/equipment.proto +++ b/rpc/equipment/equipment.proto @@ -50,6 +50,96 @@ message StatusRequest { string reason = 3; } +message MaskItemsRequest { + int32 page = 1; + int32 size =2; + int32 type =3; + string facial_mask_id = 4; + int32 is_on_trial = 5; + int32 model = 6; + int32 worker_group_id = 7; + string batch = 8; + int32 is_store = 9; + int32 use_scenario = 10; + int32 effect = 11; + repeated string time = 12; + int32 is_use = 13; +} + +message BeansItemsRequest { + int32 page = 1; + int32 size =2; + string name = 3; + repeated string time = 4; +} + +message ApiBindAddRequest { + string host_nickname = 1; + string host_code = 2; +} + +message ApiUnBindRequest { + string host_code = 1; +} + +message EmptyRequest { + +} + +message ApiBindExpiryRequest { + string host_code = 1; + int32 type = 2; +} +message ApiBindExpiryGetRequest { + string host_code = 1; +} +message ApiBeansItemsRequest { + int32 page = 1; + int32 size = 2; +} +message ApiBeansAddRequest { + string image = 1; + int64 id = 2; +} +message ApiMaskAddRequest { + string face_mask_id = 1; + string produce_time = 2; + int64 quality_guarantee_period= 3; + int32 is_on_trial = 4; + string model = 5; + string batch = 6; + int32 is_store = 7; + int32 is_online = 8; + int64 model_id = 9; + int32 use_scenario = 10; + int64 effect = 11; + int64 worker_group_id = 12; +} + +message ApiMaskUseRequest { + string facial_mask_id = 1; + string use_time = 2; + string host_code = 3; + string gear_position = 4; + string voltage = 5; + string electric_current = 6; + string efficiency = 7; + string resistance = 8; + string score = 9; + int32 store_id = 10; +} +message ApiMaskUsedItemsRequest { + string facial_mask_id = 1; + string use_time = 2; + string host_code = 3; +} + +message BindExpiryRequest { + int64 id =1; + string expiry =2; + string reason = 3; +} + service Equipment { rpc Items(ItemsRequest) returns(Response){ option (google.api.http) = { @@ -81,4 +171,108 @@ service Equipment { body: "*" }; }; + rpc MaskItems(MaskItemsRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/mask/items" + body: "*" + }; + }; + + rpc BeansItems(BeansItemsRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/beans/items" + body: "*" + }; + }; + + rpc BindExpiry(BindExpiryRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/device/expiry" + body: "*" + }; + }; + + /*******************API*************************/ + rpc ApiMaskAdd(ApiMaskAddRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/mask/add" + body: "*" + }; + }; + + rpc ApiBindItems(EmptyRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/device/items" + body: "*" + }; + }; + rpc ApiUnBind(ApiUnBindRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/device/unbind" + body: "*" + }; + }; + rpc ApiBindAdd(ApiBindAddRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/device/bind" + body: "*" + }; + }; + rpc ApiBindExpiry(ApiBindExpiryRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/device/expiry" + body: "*" + }; + }; + + rpc ApiBindExpiryGet(ApiBindExpiryGetRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/device/expiry/get" + body: "*" + }; + }; + + rpc ApiBeansAdd(ApiBeansAddRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/beans/add" + body: "*" + }; + }; + rpc ApiBeansLast(EmptyRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/beans/last" + body: "*" + }; + }; + rpc ApiBeansItems(ApiBeansItemsRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/beans/items" + body: "*" + }; + }; + rpc ApiMaskUse(ApiMaskUseRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/mask/use" + body: "*" + }; + }; + rpc ApiMaskUsedItems(ApiMaskUsedItemsRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/mask/used/items" + body: "*" + }; + }; + rpc ApiMaskStoreUse(ApiMaskUseRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/mask/store/use" + body: "*" + }; + }; + rpc ApiMaskStoreUseItems(ApiMaskUsedItemsRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/mask/store/used/items" + body: "*" + }; + }; + } \ No newline at end of file diff --git a/rpc/equipment/pb/equipment.pb.go b/rpc/equipment/pb/equipment.pb.go index cbd6f8d..e60c832 100644 --- a/rpc/equipment/pb/equipment.pb.go +++ b/rpc/equipment/pb/equipment.pb.go @@ -454,6 +454,914 @@ func (x *StatusRequest) GetReason() string { return "" } +type MaskItemsRequest 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"` + Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` + FacialMaskId string `protobuf:"bytes,4,opt,name=facial_mask_id,json=facialMaskId,proto3" json:"facial_mask_id,omitempty"` + IsOnTrial int32 `protobuf:"varint,5,opt,name=is_on_trial,json=isOnTrial,proto3" json:"is_on_trial,omitempty"` + Model int32 `protobuf:"varint,6,opt,name=model,proto3" json:"model,omitempty"` + WorkerGroupId int32 `protobuf:"varint,7,opt,name=worker_group_id,json=workerGroupId,proto3" json:"worker_group_id,omitempty"` + Batch string `protobuf:"bytes,8,opt,name=batch,proto3" json:"batch,omitempty"` + IsStore int32 `protobuf:"varint,9,opt,name=is_store,json=isStore,proto3" json:"is_store,omitempty"` + UseScenario int32 `protobuf:"varint,10,opt,name=use_scenario,json=useScenario,proto3" json:"use_scenario,omitempty"` + Effect int32 `protobuf:"varint,11,opt,name=effect,proto3" json:"effect,omitempty"` + Time []string `protobuf:"bytes,12,rep,name=time,proto3" json:"time,omitempty"` + IsUse int32 `protobuf:"varint,13,opt,name=is_use,json=isUse,proto3" json:"is_use,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MaskItemsRequest) Reset() { + *x = MaskItemsRequest{} + mi := &file_equipment_equipment_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MaskItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaskItemsRequest) ProtoMessage() {} + +func (x *MaskItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_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 MaskItemsRequest.ProtoReflect.Descriptor instead. +func (*MaskItemsRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{6} +} + +func (x *MaskItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *MaskItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *MaskItemsRequest) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *MaskItemsRequest) GetFacialMaskId() string { + if x != nil { + return x.FacialMaskId + } + return "" +} + +func (x *MaskItemsRequest) GetIsOnTrial() int32 { + if x != nil { + return x.IsOnTrial + } + return 0 +} + +func (x *MaskItemsRequest) GetModel() int32 { + if x != nil { + return x.Model + } + return 0 +} + +func (x *MaskItemsRequest) GetWorkerGroupId() int32 { + if x != nil { + return x.WorkerGroupId + } + return 0 +} + +func (x *MaskItemsRequest) GetBatch() string { + if x != nil { + return x.Batch + } + return "" +} + +func (x *MaskItemsRequest) GetIsStore() int32 { + if x != nil { + return x.IsStore + } + return 0 +} + +func (x *MaskItemsRequest) GetUseScenario() int32 { + if x != nil { + return x.UseScenario + } + return 0 +} + +func (x *MaskItemsRequest) GetEffect() int32 { + if x != nil { + return x.Effect + } + return 0 +} + +func (x *MaskItemsRequest) GetTime() []string { + if x != nil { + return x.Time + } + return nil +} + +func (x *MaskItemsRequest) GetIsUse() int32 { + if x != nil { + return x.IsUse + } + return 0 +} + +type BeansItemsRequest 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"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Time []string `protobuf:"bytes,4,rep,name=time,proto3" json:"time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BeansItemsRequest) Reset() { + *x = BeansItemsRequest{} + mi := &file_equipment_equipment_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BeansItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BeansItemsRequest) ProtoMessage() {} + +func (x *BeansItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_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 BeansItemsRequest.ProtoReflect.Descriptor instead. +func (*BeansItemsRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{7} +} + +func (x *BeansItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *BeansItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *BeansItemsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BeansItemsRequest) GetTime() []string { + if x != nil { + return x.Time + } + return nil +} + +type ApiBindAddRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + HostNickname string `protobuf:"bytes,1,opt,name=host_nickname,json=hostNickname,proto3" json:"host_nickname,omitempty"` + HostCode string `protobuf:"bytes,2,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiBindAddRequest) Reset() { + *x = ApiBindAddRequest{} + mi := &file_equipment_equipment_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiBindAddRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiBindAddRequest) ProtoMessage() {} + +func (x *ApiBindAddRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiBindAddRequest.ProtoReflect.Descriptor instead. +func (*ApiBindAddRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{8} +} + +func (x *ApiBindAddRequest) GetHostNickname() string { + if x != nil { + return x.HostNickname + } + return "" +} + +func (x *ApiBindAddRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +type ApiUnBindRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + HostCode string `protobuf:"bytes,1,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiUnBindRequest) Reset() { + *x = ApiUnBindRequest{} + mi := &file_equipment_equipment_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiUnBindRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiUnBindRequest) ProtoMessage() {} + +func (x *ApiUnBindRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[9] + 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 ApiUnBindRequest.ProtoReflect.Descriptor instead. +func (*ApiUnBindRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{9} +} + +func (x *ApiUnBindRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +type EmptyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + mi := &file_equipment_equipment_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRequest) ProtoMessage() {} + +func (x *EmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[10] + 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 EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{10} +} + +type ApiBindExpiryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + HostCode string `protobuf:"bytes,1,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiBindExpiryRequest) Reset() { + *x = ApiBindExpiryRequest{} + mi := &file_equipment_equipment_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiBindExpiryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiBindExpiryRequest) ProtoMessage() {} + +func (x *ApiBindExpiryRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[11] + 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 ApiBindExpiryRequest.ProtoReflect.Descriptor instead. +func (*ApiBindExpiryRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{11} +} + +func (x *ApiBindExpiryRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +func (x *ApiBindExpiryRequest) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type ApiBindExpiryGetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + HostCode string `protobuf:"bytes,1,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiBindExpiryGetRequest) Reset() { + *x = ApiBindExpiryGetRequest{} + mi := &file_equipment_equipment_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiBindExpiryGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiBindExpiryGetRequest) ProtoMessage() {} + +func (x *ApiBindExpiryGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[12] + 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 ApiBindExpiryGetRequest.ProtoReflect.Descriptor instead. +func (*ApiBindExpiryGetRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{12} +} + +func (x *ApiBindExpiryGetRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +type ApiBeansItemsRequest 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"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiBeansItemsRequest) Reset() { + *x = ApiBeansItemsRequest{} + mi := &file_equipment_equipment_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiBeansItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiBeansItemsRequest) ProtoMessage() {} + +func (x *ApiBeansItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[13] + 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 ApiBeansItemsRequest.ProtoReflect.Descriptor instead. +func (*ApiBeansItemsRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{13} +} + +func (x *ApiBeansItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ApiBeansItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +type ApiBeansAddRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiBeansAddRequest) Reset() { + *x = ApiBeansAddRequest{} + mi := &file_equipment_equipment_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiBeansAddRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiBeansAddRequest) ProtoMessage() {} + +func (x *ApiBeansAddRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[14] + 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 ApiBeansAddRequest.ProtoReflect.Descriptor instead. +func (*ApiBeansAddRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{14} +} + +func (x *ApiBeansAddRequest) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *ApiBeansAddRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ApiMaskAddRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + FaceMaskId string `protobuf:"bytes,1,opt,name=face_mask_id,json=faceMaskId,proto3" json:"face_mask_id,omitempty"` + ProduceTime string `protobuf:"bytes,2,opt,name=produce_time,json=produceTime,proto3" json:"produce_time,omitempty"` + QualityGuaranteePeriod int64 `protobuf:"varint,3,opt,name=quality_guarantee_period,json=qualityGuaranteePeriod,proto3" json:"quality_guarantee_period,omitempty"` + IsOnTrial int32 `protobuf:"varint,4,opt,name=is_on_trial,json=isOnTrial,proto3" json:"is_on_trial,omitempty"` + Model string `protobuf:"bytes,5,opt,name=model,proto3" json:"model,omitempty"` + Batch string `protobuf:"bytes,6,opt,name=batch,proto3" json:"batch,omitempty"` + IsStore int32 `protobuf:"varint,7,opt,name=is_store,json=isStore,proto3" json:"is_store,omitempty"` + IsOnline int32 `protobuf:"varint,8,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` + ModelId int64 `protobuf:"varint,9,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` + UseScenario int32 `protobuf:"varint,10,opt,name=use_scenario,json=useScenario,proto3" json:"use_scenario,omitempty"` + Effect int64 `protobuf:"varint,11,opt,name=effect,proto3" json:"effect,omitempty"` + WorkerGroupId int64 `protobuf:"varint,12,opt,name=worker_group_id,json=workerGroupId,proto3" json:"worker_group_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiMaskAddRequest) Reset() { + *x = ApiMaskAddRequest{} + mi := &file_equipment_equipment_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiMaskAddRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiMaskAddRequest) ProtoMessage() {} + +func (x *ApiMaskAddRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[15] + 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 ApiMaskAddRequest.ProtoReflect.Descriptor instead. +func (*ApiMaskAddRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{15} +} + +func (x *ApiMaskAddRequest) GetFaceMaskId() string { + if x != nil { + return x.FaceMaskId + } + return "" +} + +func (x *ApiMaskAddRequest) GetProduceTime() string { + if x != nil { + return x.ProduceTime + } + return "" +} + +func (x *ApiMaskAddRequest) GetQualityGuaranteePeriod() int64 { + if x != nil { + return x.QualityGuaranteePeriod + } + return 0 +} + +func (x *ApiMaskAddRequest) GetIsOnTrial() int32 { + if x != nil { + return x.IsOnTrial + } + return 0 +} + +func (x *ApiMaskAddRequest) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +func (x *ApiMaskAddRequest) GetBatch() string { + if x != nil { + return x.Batch + } + return "" +} + +func (x *ApiMaskAddRequest) GetIsStore() int32 { + if x != nil { + return x.IsStore + } + return 0 +} + +func (x *ApiMaskAddRequest) GetIsOnline() int32 { + if x != nil { + return x.IsOnline + } + return 0 +} + +func (x *ApiMaskAddRequest) GetModelId() int64 { + if x != nil { + return x.ModelId + } + return 0 +} + +func (x *ApiMaskAddRequest) GetUseScenario() int32 { + if x != nil { + return x.UseScenario + } + return 0 +} + +func (x *ApiMaskAddRequest) GetEffect() int64 { + if x != nil { + return x.Effect + } + return 0 +} + +func (x *ApiMaskAddRequest) GetWorkerGroupId() int64 { + if x != nil { + return x.WorkerGroupId + } + return 0 +} + +type ApiMaskUseRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + FacialMaskId string `protobuf:"bytes,1,opt,name=facial_mask_id,json=facialMaskId,proto3" json:"facial_mask_id,omitempty"` + UseTime string `protobuf:"bytes,2,opt,name=use_time,json=useTime,proto3" json:"use_time,omitempty"` + HostCode string `protobuf:"bytes,3,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + GearPosition string `protobuf:"bytes,4,opt,name=gear_position,json=gearPosition,proto3" json:"gear_position,omitempty"` + Voltage string `protobuf:"bytes,5,opt,name=voltage,proto3" json:"voltage,omitempty"` + ElectricCurrent string `protobuf:"bytes,6,opt,name=electric_current,json=electricCurrent,proto3" json:"electric_current,omitempty"` + Efficiency string `protobuf:"bytes,7,opt,name=efficiency,proto3" json:"efficiency,omitempty"` + Resistance string `protobuf:"bytes,8,opt,name=resistance,proto3" json:"resistance,omitempty"` + Score string `protobuf:"bytes,9,opt,name=score,proto3" json:"score,omitempty"` + StoreId int32 `protobuf:"varint,10,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiMaskUseRequest) Reset() { + *x = ApiMaskUseRequest{} + mi := &file_equipment_equipment_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiMaskUseRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiMaskUseRequest) ProtoMessage() {} + +func (x *ApiMaskUseRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[16] + 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 ApiMaskUseRequest.ProtoReflect.Descriptor instead. +func (*ApiMaskUseRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{16} +} + +func (x *ApiMaskUseRequest) GetFacialMaskId() string { + if x != nil { + return x.FacialMaskId + } + return "" +} + +func (x *ApiMaskUseRequest) GetUseTime() string { + if x != nil { + return x.UseTime + } + return "" +} + +func (x *ApiMaskUseRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +func (x *ApiMaskUseRequest) GetGearPosition() string { + if x != nil { + return x.GearPosition + } + return "" +} + +func (x *ApiMaskUseRequest) GetVoltage() string { + if x != nil { + return x.Voltage + } + return "" +} + +func (x *ApiMaskUseRequest) GetElectricCurrent() string { + if x != nil { + return x.ElectricCurrent + } + return "" +} + +func (x *ApiMaskUseRequest) GetEfficiency() string { + if x != nil { + return x.Efficiency + } + return "" +} + +func (x *ApiMaskUseRequest) GetResistance() string { + if x != nil { + return x.Resistance + } + return "" +} + +func (x *ApiMaskUseRequest) GetScore() string { + if x != nil { + return x.Score + } + return "" +} + +func (x *ApiMaskUseRequest) GetStoreId() int32 { + if x != nil { + return x.StoreId + } + return 0 +} + +type ApiMaskUsedItemsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + FacialMaskId string `protobuf:"bytes,1,opt,name=facial_mask_id,json=facialMaskId,proto3" json:"facial_mask_id,omitempty"` + UseTime string `protobuf:"bytes,2,opt,name=use_time,json=useTime,proto3" json:"use_time,omitempty"` + HostCode string `protobuf:"bytes,3,opt,name=host_code,json=hostCode,proto3" json:"host_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApiMaskUsedItemsRequest) Reset() { + *x = ApiMaskUsedItemsRequest{} + mi := &file_equipment_equipment_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiMaskUsedItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiMaskUsedItemsRequest) ProtoMessage() {} + +func (x *ApiMaskUsedItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[17] + 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 ApiMaskUsedItemsRequest.ProtoReflect.Descriptor instead. +func (*ApiMaskUsedItemsRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{17} +} + +func (x *ApiMaskUsedItemsRequest) GetFacialMaskId() string { + if x != nil { + return x.FacialMaskId + } + return "" +} + +func (x *ApiMaskUsedItemsRequest) GetUseTime() string { + if x != nil { + return x.UseTime + } + return "" +} + +func (x *ApiMaskUsedItemsRequest) GetHostCode() string { + if x != nil { + return x.HostCode + } + return "" +} + +type BindExpiryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Expiry string `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BindExpiryRequest) Reset() { + *x = BindExpiryRequest{} + mi := &file_equipment_equipment_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BindExpiryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindExpiryRequest) ProtoMessage() {} + +func (x *BindExpiryRequest) ProtoReflect() protoreflect.Message { + mi := &file_equipment_equipment_proto_msgTypes[18] + 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 BindExpiryRequest.ProtoReflect.Descriptor instead. +func (*BindExpiryRequest) Descriptor() ([]byte, []int) { + return file_equipment_equipment_proto_rawDescGZIP(), []int{18} +} + +func (x *BindExpiryRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *BindExpiryRequest) GetExpiry() string { + if x != nil { + return x.Expiry + } + return "" +} + +func (x *BindExpiryRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + var File_equipment_equipment_proto protoreflect.FileDescriptor const file_equipment_equipment_proto_rawDesc = "" + @@ -493,13 +1401,110 @@ const file_equipment_equipment_proto_rawDesc = "" + "\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\x06reason2\xd0\x03\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"\xe9\x02\n" + + "\x10MaskItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x12\n" + + "\x04type\x18\x03 \x01(\x05R\x04type\x12$\n" + + "\x0efacial_mask_id\x18\x04 \x01(\tR\ffacialMaskId\x12\x1e\n" + + "\vis_on_trial\x18\x05 \x01(\x05R\tisOnTrial\x12\x14\n" + + "\x05model\x18\x06 \x01(\x05R\x05model\x12&\n" + + "\x0fworker_group_id\x18\a \x01(\x05R\rworkerGroupId\x12\x14\n" + + "\x05batch\x18\b \x01(\tR\x05batch\x12\x19\n" + + "\bis_store\x18\t \x01(\x05R\aisStore\x12!\n" + + "\fuse_scenario\x18\n" + + " \x01(\x05R\vuseScenario\x12\x16\n" + + "\x06effect\x18\v \x01(\x05R\x06effect\x12\x12\n" + + "\x04time\x18\f \x03(\tR\x04time\x12\x15\n" + + "\x06is_use\x18\r \x01(\x05R\x05isUse\"c\n" + + "\x11BeansItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04time\x18\x04 \x03(\tR\x04time\"U\n" + + "\x11ApiBindAddRequest\x12#\n" + + "\rhost_nickname\x18\x01 \x01(\tR\fhostNickname\x12\x1b\n" + + "\thost_code\x18\x02 \x01(\tR\bhostCode\"/\n" + + "\x10ApiUnBindRequest\x12\x1b\n" + + "\thost_code\x18\x01 \x01(\tR\bhostCode\"\x0e\n" + + "\fEmptyRequest\"G\n" + + "\x14ApiBindExpiryRequest\x12\x1b\n" + + "\thost_code\x18\x01 \x01(\tR\bhostCode\x12\x12\n" + + "\x04type\x18\x02 \x01(\x05R\x04type\"6\n" + + "\x17ApiBindExpiryGetRequest\x12\x1b\n" + + "\thost_code\x18\x01 \x01(\tR\bhostCode\">\n" + + "\x14ApiBeansItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\":\n" + + "\x12ApiBeansAddRequest\x12\x14\n" + + "\x05image\x18\x01 \x01(\tR\x05image\x12\x0e\n" + + "\x02id\x18\x02 \x01(\x03R\x02id\"\x94\x03\n" + + "\x11ApiMaskAddRequest\x12 \n" + + "\fface_mask_id\x18\x01 \x01(\tR\n" + + "faceMaskId\x12!\n" + + "\fproduce_time\x18\x02 \x01(\tR\vproduceTime\x128\n" + + "\x18quality_guarantee_period\x18\x03 \x01(\x03R\x16qualityGuaranteePeriod\x12\x1e\n" + + "\vis_on_trial\x18\x04 \x01(\x05R\tisOnTrial\x12\x14\n" + + "\x05model\x18\x05 \x01(\tR\x05model\x12\x14\n" + + "\x05batch\x18\x06 \x01(\tR\x05batch\x12\x19\n" + + "\bis_store\x18\a \x01(\x05R\aisStore\x12\x1b\n" + + "\tis_online\x18\b \x01(\x05R\bisOnline\x12\x19\n" + + "\bmodel_id\x18\t \x01(\x03R\amodelId\x12!\n" + + "\fuse_scenario\x18\n" + + " \x01(\x05R\vuseScenario\x12\x16\n" + + "\x06effect\x18\v \x01(\x03R\x06effect\x12&\n" + + "\x0fworker_group_id\x18\f \x01(\x03R\rworkerGroupId\"\xcc\x02\n" + + "\x11ApiMaskUseRequest\x12$\n" + + "\x0efacial_mask_id\x18\x01 \x01(\tR\ffacialMaskId\x12\x19\n" + + "\buse_time\x18\x02 \x01(\tR\auseTime\x12\x1b\n" + + "\thost_code\x18\x03 \x01(\tR\bhostCode\x12#\n" + + "\rgear_position\x18\x04 \x01(\tR\fgearPosition\x12\x18\n" + + "\avoltage\x18\x05 \x01(\tR\avoltage\x12)\n" + + "\x10electric_current\x18\x06 \x01(\tR\x0felectricCurrent\x12\x1e\n" + + "\n" + + "efficiency\x18\a \x01(\tR\n" + + "efficiency\x12\x1e\n" + + "\n" + + "resistance\x18\b \x01(\tR\n" + + "resistance\x12\x14\n" + + "\x05score\x18\t \x01(\tR\x05score\x12\x19\n" + + "\bstore_id\x18\n" + + " \x01(\x05R\astoreId\"w\n" + + "\x17ApiMaskUsedItemsRequest\x12$\n" + + "\x0efacial_mask_id\x18\x01 \x01(\tR\ffacialMaskId\x12\x19\n" + + "\buse_time\x18\x02 \x01(\tR\auseTime\x12\x1b\n" + + "\thost_code\x18\x03 \x01(\tR\bhostCode\"S\n" + + "\x11BindExpiryRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06expiry\x18\x02 \x01(\tR\x06expiry\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason2\xab\x10\n" + "\tEquipment\x12Y\n" + "\x05Items\x12\x17.equipment.ItemsRequest\x1a\x13.equipment.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\x12\x17/admin/v3/version/items\x12T\n" + "\x04Info\x12\x14.equipment.IdRequest\x1a\x13.equipment.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\x12\x16/admin/v3/version/info\x12\\\n" + "\x06Create\x12\x18.equipment.CreateRequest\x1a\x13.equipment.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/version/create\x12V\n" + "\x04Edit\x12\x16.equipment.EditRequest\x1a\x13.equipment.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/version/edit\x12\\\n" + - "\x06Status\x12\x18.equipment.StatusRequest\x1a\x13.equipment.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/version/statusB\rZ\v./equipmentb\x06proto3" + "\x06Status\x12\x18.equipment.StatusRequest\x1a\x13.equipment.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/version/status\x12^\n" + + "\tMaskItems\x12\x1b.equipment.MaskItemsRequest\x1a\x13.equipment.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/admin/v3/mask/items\x12a\n" + + "\n" + + "BeansItems\x12\x1c.equipment.BeansItemsRequest\x1a\x13.equipment.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/beans/items\x12c\n" + + "\n" + + "BindExpiry\x12\x1c.equipment.BindExpiryRequest\x1a\x13.equipment.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/admin/v3/device/expiry\x12\\\n" + + "\n" + + "ApiMaskAdd\x12\x1c.equipment.ApiMaskAddRequest\x1a\x13.equipment.Response\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/api/v3/mask/add\x12]\n" + + "\fApiBindItems\x12\x17.equipment.EmptyRequest\x1a\x13.equipment.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/api/v3/device/items\x12_\n" + + "\tApiUnBind\x12\x1b.equipment.ApiUnBindRequest\x1a\x13.equipment.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/api/v3/device/unbind\x12_\n" + + "\n" + + "ApiBindAdd\x12\x1c.equipment.ApiBindAddRequest\x1a\x13.equipment.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/api/v3/device/bind\x12g\n" + + "\rApiBindExpiry\x12\x1f.equipment.ApiBindExpiryRequest\x1a\x13.equipment.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/api/v3/device/expiry\x12q\n" + + "\x10ApiBindExpiryGet\x12\".equipment.ApiBindExpiryGetRequest\x1a\x13.equipment.Response\"$\x82\xd3\xe4\x93\x02\x1e:\x01*\"\x19/api/v3/device/expiry/get\x12_\n" + + "\vApiBeansAdd\x12\x1d.equipment.ApiBeansAddRequest\x1a\x13.equipment.Response\"\x1c\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/api/v3/beans/add\x12[\n" + + "\fApiBeansLast\x12\x17.equipment.EmptyRequest\x1a\x13.equipment.Response\"\x1d\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/api/v3/beans/last\x12e\n" + + "\rApiBeansItems\x12\x1f.equipment.ApiBeansItemsRequest\x1a\x13.equipment.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/api/v3/beans/items\x12\\\n" + + "\n" + + "ApiMaskUse\x12\x1c.equipment.ApiMaskUseRequest\x1a\x13.equipment.Response\"\x1b\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/api/v3/mask/use\x12o\n" + + "\x10ApiMaskUsedItems\x12\".equipment.ApiMaskUsedItemsRequest\x1a\x13.equipment.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/api/v3/mask/used/items\x12g\n" + + "\x0fApiMaskStoreUse\x12\x1c.equipment.ApiMaskUseRequest\x1a\x13.equipment.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/api/v3/mask/store/use\x12y\n" + + "\x14ApiMaskStoreUseItems\x12\".equipment.ApiMaskUsedItemsRequest\x1a\x13.equipment.Response\"(\x82\xd3\xe4\x93\x02\":\x01*\"\x1d/api/v3/mask/store/used/itemsB\rZ\v./equipmentb\x06proto3" var ( file_equipment_equipment_proto_rawDescOnce sync.Once @@ -513,31 +1518,76 @@ func file_equipment_equipment_proto_rawDescGZIP() []byte { return file_equipment_equipment_proto_rawDescData } -var file_equipment_equipment_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_equipment_equipment_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_equipment_equipment_proto_goTypes = []any{ - (*Response)(nil), // 0: equipment.Response - (*CreateRequest)(nil), // 1: equipment.CreateRequest - (*EditRequest)(nil), // 2: equipment.EditRequest - (*ItemsRequest)(nil), // 3: equipment.ItemsRequest - (*IdRequest)(nil), // 4: equipment.IdRequest - (*StatusRequest)(nil), // 5: equipment.StatusRequest + (*Response)(nil), // 0: equipment.Response + (*CreateRequest)(nil), // 1: equipment.CreateRequest + (*EditRequest)(nil), // 2: equipment.EditRequest + (*ItemsRequest)(nil), // 3: equipment.ItemsRequest + (*IdRequest)(nil), // 4: equipment.IdRequest + (*StatusRequest)(nil), // 5: equipment.StatusRequest + (*MaskItemsRequest)(nil), // 6: equipment.MaskItemsRequest + (*BeansItemsRequest)(nil), // 7: equipment.BeansItemsRequest + (*ApiBindAddRequest)(nil), // 8: equipment.ApiBindAddRequest + (*ApiUnBindRequest)(nil), // 9: equipment.ApiUnBindRequest + (*EmptyRequest)(nil), // 10: equipment.EmptyRequest + (*ApiBindExpiryRequest)(nil), // 11: equipment.ApiBindExpiryRequest + (*ApiBindExpiryGetRequest)(nil), // 12: equipment.ApiBindExpiryGetRequest + (*ApiBeansItemsRequest)(nil), // 13: equipment.ApiBeansItemsRequest + (*ApiBeansAddRequest)(nil), // 14: equipment.ApiBeansAddRequest + (*ApiMaskAddRequest)(nil), // 15: equipment.ApiMaskAddRequest + (*ApiMaskUseRequest)(nil), // 16: equipment.ApiMaskUseRequest + (*ApiMaskUsedItemsRequest)(nil), // 17: equipment.ApiMaskUsedItemsRequest + (*BindExpiryRequest)(nil), // 18: equipment.BindExpiryRequest } var file_equipment_equipment_proto_depIdxs = []int32{ - 3, // 0: equipment.Equipment.Items:input_type -> equipment.ItemsRequest - 4, // 1: equipment.Equipment.Info:input_type -> equipment.IdRequest - 1, // 2: equipment.Equipment.Create:input_type -> equipment.CreateRequest - 2, // 3: equipment.Equipment.Edit:input_type -> equipment.EditRequest - 5, // 4: equipment.Equipment.Status:input_type -> equipment.StatusRequest - 0, // 5: equipment.Equipment.Items:output_type -> equipment.Response - 0, // 6: equipment.Equipment.Info:output_type -> equipment.Response - 0, // 7: equipment.Equipment.Create:output_type -> equipment.Response - 0, // 8: equipment.Equipment.Edit:output_type -> equipment.Response - 0, // 9: equipment.Equipment.Status:output_type -> equipment.Response - 5, // [5:10] is the sub-list for method output_type - 0, // [0:5] 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 + 3, // 0: equipment.Equipment.Items:input_type -> equipment.ItemsRequest + 4, // 1: equipment.Equipment.Info:input_type -> equipment.IdRequest + 1, // 2: equipment.Equipment.Create:input_type -> equipment.CreateRequest + 2, // 3: equipment.Equipment.Edit:input_type -> equipment.EditRequest + 5, // 4: equipment.Equipment.Status:input_type -> equipment.StatusRequest + 6, // 5: equipment.Equipment.MaskItems:input_type -> equipment.MaskItemsRequest + 7, // 6: equipment.Equipment.BeansItems:input_type -> equipment.BeansItemsRequest + 18, // 7: equipment.Equipment.BindExpiry:input_type -> equipment.BindExpiryRequest + 15, // 8: equipment.Equipment.ApiMaskAdd:input_type -> equipment.ApiMaskAddRequest + 10, // 9: equipment.Equipment.ApiBindItems:input_type -> equipment.EmptyRequest + 9, // 10: equipment.Equipment.ApiUnBind:input_type -> equipment.ApiUnBindRequest + 8, // 11: equipment.Equipment.ApiBindAdd:input_type -> equipment.ApiBindAddRequest + 11, // 12: equipment.Equipment.ApiBindExpiry:input_type -> equipment.ApiBindExpiryRequest + 12, // 13: equipment.Equipment.ApiBindExpiryGet:input_type -> equipment.ApiBindExpiryGetRequest + 14, // 14: equipment.Equipment.ApiBeansAdd:input_type -> equipment.ApiBeansAddRequest + 10, // 15: equipment.Equipment.ApiBeansLast:input_type -> equipment.EmptyRequest + 13, // 16: equipment.Equipment.ApiBeansItems:input_type -> equipment.ApiBeansItemsRequest + 16, // 17: equipment.Equipment.ApiMaskUse:input_type -> equipment.ApiMaskUseRequest + 17, // 18: equipment.Equipment.ApiMaskUsedItems:input_type -> equipment.ApiMaskUsedItemsRequest + 16, // 19: equipment.Equipment.ApiMaskStoreUse:input_type -> equipment.ApiMaskUseRequest + 17, // 20: equipment.Equipment.ApiMaskStoreUseItems:input_type -> equipment.ApiMaskUsedItemsRequest + 0, // 21: equipment.Equipment.Items:output_type -> equipment.Response + 0, // 22: equipment.Equipment.Info:output_type -> equipment.Response + 0, // 23: equipment.Equipment.Create:output_type -> equipment.Response + 0, // 24: equipment.Equipment.Edit:output_type -> equipment.Response + 0, // 25: equipment.Equipment.Status:output_type -> equipment.Response + 0, // 26: equipment.Equipment.MaskItems:output_type -> equipment.Response + 0, // 27: equipment.Equipment.BeansItems:output_type -> equipment.Response + 0, // 28: equipment.Equipment.BindExpiry:output_type -> equipment.Response + 0, // 29: equipment.Equipment.ApiMaskAdd:output_type -> equipment.Response + 0, // 30: equipment.Equipment.ApiBindItems:output_type -> equipment.Response + 0, // 31: equipment.Equipment.ApiUnBind:output_type -> equipment.Response + 0, // 32: equipment.Equipment.ApiBindAdd:output_type -> equipment.Response + 0, // 33: equipment.Equipment.ApiBindExpiry:output_type -> equipment.Response + 0, // 34: equipment.Equipment.ApiBindExpiryGet:output_type -> equipment.Response + 0, // 35: equipment.Equipment.ApiBeansAdd:output_type -> equipment.Response + 0, // 36: equipment.Equipment.ApiBeansLast:output_type -> equipment.Response + 0, // 37: equipment.Equipment.ApiBeansItems:output_type -> equipment.Response + 0, // 38: equipment.Equipment.ApiMaskUse:output_type -> equipment.Response + 0, // 39: equipment.Equipment.ApiMaskUsedItems:output_type -> equipment.Response + 0, // 40: equipment.Equipment.ApiMaskStoreUse:output_type -> equipment.Response + 0, // 41: equipment.Equipment.ApiMaskStoreUseItems:output_type -> equipment.Response + 21, // [21:42] is the sub-list for method output_type + 0, // [0:21] 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 } func init() { file_equipment_equipment_proto_init() } @@ -551,7 +1601,7 @@ func file_equipment_equipment_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_equipment_equipment_proto_rawDesc), len(file_equipment_equipment_proto_rawDesc)), NumEnums: 0, - NumMessages: 6, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/equipment/pb/equipment_grpc.pb.go b/rpc/equipment/pb/equipment_grpc.pb.go index a684109..0cfe4c5 100644 --- a/rpc/equipment/pb/equipment_grpc.pb.go +++ b/rpc/equipment/pb/equipment_grpc.pb.go @@ -19,11 +19,27 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Equipment_Items_FullMethodName = "/equipment.Equipment/Items" - Equipment_Info_FullMethodName = "/equipment.Equipment/Info" - Equipment_Create_FullMethodName = "/equipment.Equipment/Create" - Equipment_Edit_FullMethodName = "/equipment.Equipment/Edit" - Equipment_Status_FullMethodName = "/equipment.Equipment/Status" + Equipment_Items_FullMethodName = "/equipment.Equipment/Items" + Equipment_Info_FullMethodName = "/equipment.Equipment/Info" + Equipment_Create_FullMethodName = "/equipment.Equipment/Create" + Equipment_Edit_FullMethodName = "/equipment.Equipment/Edit" + Equipment_Status_FullMethodName = "/equipment.Equipment/Status" + Equipment_MaskItems_FullMethodName = "/equipment.Equipment/MaskItems" + Equipment_BeansItems_FullMethodName = "/equipment.Equipment/BeansItems" + Equipment_BindExpiry_FullMethodName = "/equipment.Equipment/BindExpiry" + Equipment_ApiMaskAdd_FullMethodName = "/equipment.Equipment/ApiMaskAdd" + Equipment_ApiBindItems_FullMethodName = "/equipment.Equipment/ApiBindItems" + Equipment_ApiUnBind_FullMethodName = "/equipment.Equipment/ApiUnBind" + Equipment_ApiBindAdd_FullMethodName = "/equipment.Equipment/ApiBindAdd" + Equipment_ApiBindExpiry_FullMethodName = "/equipment.Equipment/ApiBindExpiry" + Equipment_ApiBindExpiryGet_FullMethodName = "/equipment.Equipment/ApiBindExpiryGet" + Equipment_ApiBeansAdd_FullMethodName = "/equipment.Equipment/ApiBeansAdd" + Equipment_ApiBeansLast_FullMethodName = "/equipment.Equipment/ApiBeansLast" + Equipment_ApiBeansItems_FullMethodName = "/equipment.Equipment/ApiBeansItems" + Equipment_ApiMaskUse_FullMethodName = "/equipment.Equipment/ApiMaskUse" + Equipment_ApiMaskUsedItems_FullMethodName = "/equipment.Equipment/ApiMaskUsedItems" + Equipment_ApiMaskStoreUse_FullMethodName = "/equipment.Equipment/ApiMaskStoreUse" + Equipment_ApiMaskStoreUseItems_FullMethodName = "/equipment.Equipment/ApiMaskStoreUseItems" ) // EquipmentClient is the client API for Equipment service. @@ -35,6 +51,23 @@ type EquipmentClient interface { Create(ctx context.Context, in *CreateRequest, 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) + MaskItems(ctx context.Context, in *MaskItemsRequest, opts ...grpc.CallOption) (*Response, error) + BeansItems(ctx context.Context, in *BeansItemsRequest, opts ...grpc.CallOption) (*Response, error) + BindExpiry(ctx context.Context, in *BindExpiryRequest, opts ...grpc.CallOption) (*Response, error) + // ******************API************************ + ApiMaskAdd(ctx context.Context, in *ApiMaskAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + ApiUnBind(ctx context.Context, in *ApiUnBindRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindAdd(ctx context.Context, in *ApiBindAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindExpiry(ctx context.Context, in *ApiBindExpiryRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindExpiryGet(ctx context.Context, in *ApiBindExpiryGetRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansAdd(ctx context.Context, in *ApiBeansAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansLast(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansItems(ctx context.Context, in *ApiBeansItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskUsedItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskStoreUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskStoreUseItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) } type equipmentClient struct { @@ -95,6 +128,166 @@ func (c *equipmentClient) Status(ctx context.Context, in *StatusRequest, opts .. return out, nil } +func (c *equipmentClient) MaskItems(ctx context.Context, in *MaskItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_MaskItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) BeansItems(ctx context.Context, in *BeansItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_BeansItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) BindExpiry(ctx context.Context, in *BindExpiryRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_BindExpiry_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiMaskAdd(ctx context.Context, in *ApiMaskAddRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiMaskAdd_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBindItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBindItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiUnBind(ctx context.Context, in *ApiUnBindRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiUnBind_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBindAdd(ctx context.Context, in *ApiBindAddRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBindAdd_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBindExpiry(ctx context.Context, in *ApiBindExpiryRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBindExpiry_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBindExpiryGet(ctx context.Context, in *ApiBindExpiryGetRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBindExpiryGet_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBeansAdd(ctx context.Context, in *ApiBeansAddRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBeansAdd_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBeansLast(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBeansLast_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiBeansItems(ctx context.Context, in *ApiBeansItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiBeansItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiMaskUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiMaskUse_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiMaskUsedItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiMaskUsedItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiMaskStoreUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiMaskStoreUse_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *equipmentClient) ApiMaskStoreUseItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Equipment_ApiMaskStoreUseItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // EquipmentServer is the server API for Equipment service. // All implementations must embed UnimplementedEquipmentServer // for forward compatibility. @@ -104,6 +297,23 @@ type EquipmentServer interface { Create(context.Context, *CreateRequest) (*Response, error) Edit(context.Context, *EditRequest) (*Response, error) Status(context.Context, *StatusRequest) (*Response, error) + MaskItems(context.Context, *MaskItemsRequest) (*Response, error) + BeansItems(context.Context, *BeansItemsRequest) (*Response, error) + BindExpiry(context.Context, *BindExpiryRequest) (*Response, error) + // ******************API************************ + ApiMaskAdd(context.Context, *ApiMaskAddRequest) (*Response, error) + ApiBindItems(context.Context, *EmptyRequest) (*Response, error) + ApiUnBind(context.Context, *ApiUnBindRequest) (*Response, error) + ApiBindAdd(context.Context, *ApiBindAddRequest) (*Response, error) + ApiBindExpiry(context.Context, *ApiBindExpiryRequest) (*Response, error) + ApiBindExpiryGet(context.Context, *ApiBindExpiryGetRequest) (*Response, error) + ApiBeansAdd(context.Context, *ApiBeansAddRequest) (*Response, error) + ApiBeansLast(context.Context, *EmptyRequest) (*Response, error) + ApiBeansItems(context.Context, *ApiBeansItemsRequest) (*Response, error) + ApiMaskUse(context.Context, *ApiMaskUseRequest) (*Response, error) + ApiMaskUsedItems(context.Context, *ApiMaskUsedItemsRequest) (*Response, error) + ApiMaskStoreUse(context.Context, *ApiMaskUseRequest) (*Response, error) + ApiMaskStoreUseItems(context.Context, *ApiMaskUsedItemsRequest) (*Response, error) mustEmbedUnimplementedEquipmentServer() } @@ -129,6 +339,54 @@ func (UnimplementedEquipmentServer) Edit(context.Context, *EditRequest) (*Respon func (UnimplementedEquipmentServer) Status(context.Context, *StatusRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method Status not implemented") } +func (UnimplementedEquipmentServer) MaskItems(context.Context, *MaskItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method MaskItems not implemented") +} +func (UnimplementedEquipmentServer) BeansItems(context.Context, *BeansItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method BeansItems not implemented") +} +func (UnimplementedEquipmentServer) BindExpiry(context.Context, *BindExpiryRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method BindExpiry not implemented") +} +func (UnimplementedEquipmentServer) ApiMaskAdd(context.Context, *ApiMaskAddRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiMaskAdd not implemented") +} +func (UnimplementedEquipmentServer) ApiBindItems(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBindItems not implemented") +} +func (UnimplementedEquipmentServer) ApiUnBind(context.Context, *ApiUnBindRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiUnBind not implemented") +} +func (UnimplementedEquipmentServer) ApiBindAdd(context.Context, *ApiBindAddRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBindAdd not implemented") +} +func (UnimplementedEquipmentServer) ApiBindExpiry(context.Context, *ApiBindExpiryRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBindExpiry not implemented") +} +func (UnimplementedEquipmentServer) ApiBindExpiryGet(context.Context, *ApiBindExpiryGetRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBindExpiryGet not implemented") +} +func (UnimplementedEquipmentServer) ApiBeansAdd(context.Context, *ApiBeansAddRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBeansAdd not implemented") +} +func (UnimplementedEquipmentServer) ApiBeansLast(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBeansLast not implemented") +} +func (UnimplementedEquipmentServer) ApiBeansItems(context.Context, *ApiBeansItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiBeansItems not implemented") +} +func (UnimplementedEquipmentServer) ApiMaskUse(context.Context, *ApiMaskUseRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiMaskUse not implemented") +} +func (UnimplementedEquipmentServer) ApiMaskUsedItems(context.Context, *ApiMaskUsedItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiMaskUsedItems not implemented") +} +func (UnimplementedEquipmentServer) ApiMaskStoreUse(context.Context, *ApiMaskUseRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiMaskStoreUse not implemented") +} +func (UnimplementedEquipmentServer) ApiMaskStoreUseItems(context.Context, *ApiMaskUsedItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method ApiMaskStoreUseItems not implemented") +} func (UnimplementedEquipmentServer) mustEmbedUnimplementedEquipmentServer() {} func (UnimplementedEquipmentServer) testEmbeddedByValue() {} @@ -240,6 +498,294 @@ func _Equipment_Status_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Equipment_MaskItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MaskItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).MaskItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_MaskItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).MaskItems(ctx, req.(*MaskItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_BeansItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BeansItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).BeansItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_BeansItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).BeansItems(ctx, req.(*BeansItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_BindExpiry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BindExpiryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).BindExpiry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_BindExpiry_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).BindExpiry(ctx, req.(*BindExpiryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiMaskAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiMaskAddRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiMaskAdd(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiMaskAdd_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiMaskAdd(ctx, req.(*ApiMaskAddRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBindItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBindItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBindItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBindItems(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiUnBind_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiUnBindRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiUnBind(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiUnBind_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiUnBind(ctx, req.(*ApiUnBindRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBindAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiBindAddRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBindAdd(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBindAdd_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBindAdd(ctx, req.(*ApiBindAddRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBindExpiry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiBindExpiryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBindExpiry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBindExpiry_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBindExpiry(ctx, req.(*ApiBindExpiryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBindExpiryGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiBindExpiryGetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBindExpiryGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBindExpiryGet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBindExpiryGet(ctx, req.(*ApiBindExpiryGetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBeansAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiBeansAddRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBeansAdd(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBeansAdd_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBeansAdd(ctx, req.(*ApiBeansAddRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBeansLast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBeansLast(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBeansLast_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBeansLast(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiBeansItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiBeansItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiBeansItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiBeansItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiBeansItems(ctx, req.(*ApiBeansItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiMaskUse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiMaskUseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiMaskUse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiMaskUse_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiMaskUse(ctx, req.(*ApiMaskUseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiMaskUsedItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiMaskUsedItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiMaskUsedItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiMaskUsedItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiMaskUsedItems(ctx, req.(*ApiMaskUsedItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiMaskStoreUse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiMaskUseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiMaskStoreUse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiMaskStoreUse_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiMaskStoreUse(ctx, req.(*ApiMaskUseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Equipment_ApiMaskStoreUseItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiMaskUsedItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EquipmentServer).ApiMaskStoreUseItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Equipment_ApiMaskStoreUseItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EquipmentServer).ApiMaskStoreUseItems(ctx, req.(*ApiMaskUsedItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Equipment_ServiceDesc is the grpc.ServiceDesc for Equipment service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -267,6 +813,70 @@ var Equipment_ServiceDesc = grpc.ServiceDesc{ MethodName: "Status", Handler: _Equipment_Status_Handler, }, + { + MethodName: "MaskItems", + Handler: _Equipment_MaskItems_Handler, + }, + { + MethodName: "BeansItems", + Handler: _Equipment_BeansItems_Handler, + }, + { + MethodName: "BindExpiry", + Handler: _Equipment_BindExpiry_Handler, + }, + { + MethodName: "ApiMaskAdd", + Handler: _Equipment_ApiMaskAdd_Handler, + }, + { + MethodName: "ApiBindItems", + Handler: _Equipment_ApiBindItems_Handler, + }, + { + MethodName: "ApiUnBind", + Handler: _Equipment_ApiUnBind_Handler, + }, + { + MethodName: "ApiBindAdd", + Handler: _Equipment_ApiBindAdd_Handler, + }, + { + MethodName: "ApiBindExpiry", + Handler: _Equipment_ApiBindExpiry_Handler, + }, + { + MethodName: "ApiBindExpiryGet", + Handler: _Equipment_ApiBindExpiryGet_Handler, + }, + { + MethodName: "ApiBeansAdd", + Handler: _Equipment_ApiBeansAdd_Handler, + }, + { + MethodName: "ApiBeansLast", + Handler: _Equipment_ApiBeansLast_Handler, + }, + { + MethodName: "ApiBeansItems", + Handler: _Equipment_ApiBeansItems_Handler, + }, + { + MethodName: "ApiMaskUse", + Handler: _Equipment_ApiMaskUse_Handler, + }, + { + MethodName: "ApiMaskUsedItems", + Handler: _Equipment_ApiMaskUsedItems_Handler, + }, + { + MethodName: "ApiMaskStoreUse", + Handler: _Equipment_ApiMaskStoreUse_Handler, + }, + { + MethodName: "ApiMaskStoreUseItems", + Handler: _Equipment_ApiMaskStoreUseItems_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "equipment/equipment.proto", diff --git a/rpc/store/pb/store.pb.go b/rpc/store/pb/store.pb.go index 70560da..0076f6e 100644 --- a/rpc/store/pb/store.pb.go +++ b/rpc/store/pb/store.pb.go @@ -102,6 +102,50 @@ func (x *IdRequest) GetId() int64 { return 0 } +type IdsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdsRequest) Reset() { + *x = IdsRequest{} + mi := &file_store_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdsRequest) ProtoMessage() {} + +func (x *IdsRequest) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdsRequest.ProtoReflect.Descriptor instead. +func (*IdsRequest) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{2} +} + +func (x *IdsRequest) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + type StatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -113,7 +157,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_store_store_proto_msgTypes[2] + mi := &file_store_store_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -125,7 +169,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[2] + mi := &file_store_store_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -138,7 +182,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{2} + return file_store_store_proto_rawDescGZIP(), []int{3} } func (x *StatusRequest) GetId() int64 { @@ -173,7 +217,7 @@ type Response struct { func (x *Response) Reset() { *x = Response{} - mi := &file_store_store_proto_msgTypes[3] + mi := &file_store_store_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -185,7 +229,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[3] + mi := &file_store_store_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -198,7 +242,7 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{3} + return file_store_store_proto_rawDescGZIP(), []int{4} } func (x *Response) GetCode() int32 { @@ -246,7 +290,7 @@ type EditRequest struct { LatitudeWgs84 string `protobuf:"bytes,20,opt,name=latitude_wgs84,json=latitudeWgs84,proto3" json:"latitude_wgs84,omitempty"` LongitudeGcj02 string `protobuf:"bytes,21,opt,name=longitude_gcj02,json=longitudeGcj02,proto3" json:"longitude_gcj02,omitempty"` LatitudeGcj02 string `protobuf:"bytes,22,opt,name=latitude_gcj02,json=latitudeGcj02,proto3" json:"latitude_gcj02,omitempty"` - StoreType int64 `protobuf:"varint,23,opt,name=store_type,json=storeType,proto3" json:"store_type,omitempty"` + StoreType []string `protobuf:"bytes,23,rep,name=store_type,json=storeType,proto3" json:"store_type,omitempty"` Province int64 `protobuf:"varint,24,opt,name=province,proto3" json:"province,omitempty"` ProvinceName string `protobuf:"bytes,25,opt,name=province_name,json=provinceName,proto3" json:"province_name,omitempty"` City int64 `protobuf:"varint,26,opt,name=city,proto3" json:"city,omitempty"` @@ -259,7 +303,7 @@ type EditRequest struct { func (x *EditRequest) Reset() { *x = EditRequest{} - mi := &file_store_store_proto_msgTypes[4] + mi := &file_store_store_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -271,7 +315,7 @@ func (x *EditRequest) String() string { func (*EditRequest) ProtoMessage() {} func (x *EditRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[4] + mi := &file_store_store_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -284,7 +328,7 @@ func (x *EditRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EditRequest.ProtoReflect.Descriptor instead. func (*EditRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{4} + return file_store_store_proto_rawDescGZIP(), []int{5} } func (x *EditRequest) GetId() int64 { @@ -441,11 +485,11 @@ func (x *EditRequest) GetLatitudeGcj02() string { return "" } -func (x *EditRequest) GetStoreType() int64 { +func (x *EditRequest) GetStoreType() []string { if x != nil { return x.StoreType } - return 0 + return nil } func (x *EditRequest) GetProvince() int64 { @@ -517,7 +561,7 @@ type CreateRequest struct { LatitudeWgs84 string `protobuf:"bytes,23,opt,name=latitude_wgs84,json=latitudeWgs84,proto3" json:"latitude_wgs84,omitempty"` LongitudeGcj02 string `protobuf:"bytes,24,opt,name=longitude_gcj02,json=longitudeGcj02,proto3" json:"longitude_gcj02,omitempty"` LatitudeGcj02 string `protobuf:"bytes,25,opt,name=latitude_gcj02,json=latitudeGcj02,proto3" json:"latitude_gcj02,omitempty"` - StoreType int64 `protobuf:"varint,26,opt,name=store_type,json=storeType,proto3" json:"store_type,omitempty"` + StoreType []string `protobuf:"bytes,26,rep,name=store_type,json=storeType,proto3" json:"store_type,omitempty"` Province int64 `protobuf:"varint,27,opt,name=province,proto3" json:"province,omitempty"` ProvinceName string `protobuf:"bytes,28,opt,name=province_name,json=provinceName,proto3" json:"province_name,omitempty"` City int64 `protobuf:"varint,29,opt,name=city,proto3" json:"city,omitempty"` @@ -530,7 +574,7 @@ type CreateRequest struct { func (x *CreateRequest) Reset() { *x = CreateRequest{} - mi := &file_store_store_proto_msgTypes[5] + mi := &file_store_store_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -542,7 +586,7 @@ func (x *CreateRequest) String() string { func (*CreateRequest) ProtoMessage() {} func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[5] + mi := &file_store_store_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -555,7 +599,7 @@ func (x *CreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{5} + return file_store_store_proto_rawDescGZIP(), []int{6} } func (x *CreateRequest) GetUserMobile() string { @@ -733,11 +777,11 @@ func (x *CreateRequest) GetLatitudeGcj02() string { return "" } -func (x *CreateRequest) GetStoreType() int64 { +func (x *CreateRequest) GetStoreType() []string { if x != nil { return x.StoreType } - return 0 + return nil } func (x *CreateRequest) GetProvince() int64 { @@ -782,6 +826,318 @@ func (x *CreateRequest) GetCountyName() string { return "" } +type InfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserMobile string `protobuf:"bytes,2,opt,name=user_mobile,json=userMobile,proto3" json:"user_mobile,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + IdCard string `protobuf:"bytes,4,opt,name=id_card,json=idCard,proto3" json:"id_card,omitempty"` + Receipt string `protobuf:"bytes,5,opt,name=receipt,proto3" json:"receipt,omitempty"` + Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` + Area string `protobuf:"bytes,7,opt,name=area,proto3" json:"area,omitempty"` + StoreImages string `protobuf:"bytes,8,opt,name=store_images,json=storeImages,proto3" json:"store_images,omitempty"` + DistrictIds string `protobuf:"bytes,9,opt,name=district_ids,json=districtIds,proto3" json:"district_ids,omitempty"` + Address string `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"` + BankInfo string `protobuf:"bytes,11,opt,name=bank_info,json=bankInfo,proto3" json:"bank_info,omitempty"` + UserName string `protobuf:"bytes,12,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + BusinessLicense string `protobuf:"bytes,13,opt,name=business_license,json=businessLicense,proto3" json:"business_license,omitempty"` + Images string `protobuf:"bytes,14,opt,name=images,proto3" json:"images,omitempty"` + SaleId int64 `protobuf:"varint,15,opt,name=sale_id,json=saleId,proto3" json:"sale_id,omitempty"` + Contact string `protobuf:"bytes,16,opt,name=contact,proto3" json:"contact,omitempty"` + Content string `protobuf:"bytes,17,opt,name=content,proto3" json:"content,omitempty"` + OpenTime string `protobuf:"bytes,18,opt,name=open_time,json=openTime,proto3" json:"open_time,omitempty"` + LongitudeWgs84 string `protobuf:"bytes,19,opt,name=longitude_wgs84,json=longitudeWgs84,proto3" json:"longitude_wgs84,omitempty"` + LatitudeWgs84 string `protobuf:"bytes,20,opt,name=latitude_wgs84,json=latitudeWgs84,proto3" json:"latitude_wgs84,omitempty"` + LongitudeGcj02 string `protobuf:"bytes,21,opt,name=longitude_gcj02,json=longitudeGcj02,proto3" json:"longitude_gcj02,omitempty"` + LatitudeGcj02 string `protobuf:"bytes,22,opt,name=latitude_gcj02,json=latitudeGcj02,proto3" json:"latitude_gcj02,omitempty"` + StoreType []string `protobuf:"bytes,23,rep,name=store_type,json=storeType,proto3" json:"store_type,omitempty"` + Province int64 `protobuf:"varint,24,opt,name=province,proto3" json:"province,omitempty"` + ProvinceName string `protobuf:"bytes,25,opt,name=province_name,json=provinceName,proto3" json:"province_name,omitempty"` + City int64 `protobuf:"varint,26,opt,name=city,proto3" json:"city,omitempty"` + CityName string `protobuf:"bytes,27,opt,name=city_name,json=cityName,proto3" json:"city_name,omitempty"` + County int64 `protobuf:"varint,28,opt,name=county,proto3" json:"county,omitempty"` + CountyName string `protobuf:"bytes,29,opt,name=county_name,json=countyName,proto3" json:"county_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InfoResponse) Reset() { + *x = InfoResponse{} + mi := &file_store_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoResponse) ProtoMessage() {} + +func (x *InfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_store_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 InfoResponse.ProtoReflect.Descriptor instead. +func (*InfoResponse) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{7} +} + +func (x *InfoResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *InfoResponse) GetUserMobile() string { + if x != nil { + return x.UserMobile + } + return "" +} + +func (x *InfoResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InfoResponse) GetIdCard() string { + if x != nil { + return x.IdCard + } + return "" +} + +func (x *InfoResponse) GetReceipt() string { + if x != nil { + return x.Receipt + } + return "" +} + +func (x *InfoResponse) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *InfoResponse) GetArea() string { + if x != nil { + return x.Area + } + return "" +} + +func (x *InfoResponse) GetStoreImages() string { + if x != nil { + return x.StoreImages + } + return "" +} + +func (x *InfoResponse) GetDistrictIds() string { + if x != nil { + return x.DistrictIds + } + return "" +} + +func (x *InfoResponse) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *InfoResponse) GetBankInfo() string { + if x != nil { + return x.BankInfo + } + return "" +} + +func (x *InfoResponse) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *InfoResponse) GetBusinessLicense() string { + if x != nil { + return x.BusinessLicense + } + return "" +} + +func (x *InfoResponse) GetImages() string { + if x != nil { + return x.Images + } + return "" +} + +func (x *InfoResponse) GetSaleId() int64 { + if x != nil { + return x.SaleId + } + return 0 +} + +func (x *InfoResponse) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *InfoResponse) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *InfoResponse) GetOpenTime() string { + if x != nil { + return x.OpenTime + } + return "" +} + +func (x *InfoResponse) GetLongitudeWgs84() string { + if x != nil { + return x.LongitudeWgs84 + } + return "" +} + +func (x *InfoResponse) GetLatitudeWgs84() string { + if x != nil { + return x.LatitudeWgs84 + } + return "" +} + +func (x *InfoResponse) GetLongitudeGcj02() string { + if x != nil { + return x.LongitudeGcj02 + } + return "" +} + +func (x *InfoResponse) GetLatitudeGcj02() string { + if x != nil { + return x.LatitudeGcj02 + } + return "" +} + +func (x *InfoResponse) GetStoreType() []string { + if x != nil { + return x.StoreType + } + return nil +} + +func (x *InfoResponse) GetProvince() int64 { + if x != nil { + return x.Province + } + return 0 +} + +func (x *InfoResponse) GetProvinceName() string { + if x != nil { + return x.ProvinceName + } + return "" +} + +func (x *InfoResponse) GetCity() int64 { + if x != nil { + return x.City + } + return 0 +} + +func (x *InfoResponse) GetCityName() string { + if x != nil { + return x.CityName + } + return "" +} + +func (x *InfoResponse) GetCounty() int64 { + if x != nil { + return x.County + } + return 0 +} + +func (x *InfoResponse) GetCountyName() string { + if x != nil { + return x.CountyName + } + return "" +} + +type ItemsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*InfoResponse `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ItemsResponse) Reset() { + *x = ItemsResponse{} + mi := &file_store_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemsResponse) ProtoMessage() {} + +func (x *ItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ItemsResponse.ProtoReflect.Descriptor instead. +func (*ItemsResponse) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{8} +} + +func (x *ItemsResponse) GetItems() []*InfoResponse { + if x != nil { + return x.Items + } + return nil +} + type ToSaleRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -792,7 +1148,7 @@ type ToSaleRequest struct { func (x *ToSaleRequest) Reset() { *x = ToSaleRequest{} - mi := &file_store_store_proto_msgTypes[6] + mi := &file_store_store_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -804,7 +1160,7 @@ func (x *ToSaleRequest) String() string { func (*ToSaleRequest) ProtoMessage() {} func (x *ToSaleRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[6] + mi := &file_store_store_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -817,7 +1173,7 @@ func (x *ToSaleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ToSaleRequest.ProtoReflect.Descriptor instead. func (*ToSaleRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{6} + return file_store_store_proto_rawDescGZIP(), []int{9} } func (x *ToSaleRequest) GetId() int64 { @@ -844,7 +1200,7 @@ type ContentRequest struct { func (x *ContentRequest) Reset() { *x = ContentRequest{} - mi := &file_store_store_proto_msgTypes[7] + mi := &file_store_store_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -856,7 +1212,7 @@ func (x *ContentRequest) String() string { func (*ContentRequest) ProtoMessage() {} func (x *ContentRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[7] + mi := &file_store_store_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -869,7 +1225,7 @@ func (x *ContentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentRequest.ProtoReflect.Descriptor instead. func (*ContentRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{7} + return file_store_store_proto_rawDescGZIP(), []int{10} } func (x *ContentRequest) GetId() int64 { @@ -899,7 +1255,7 @@ type ItemsRequest struct { func (x *ItemsRequest) Reset() { *x = ItemsRequest{} - mi := &file_store_store_proto_msgTypes[8] + mi := &file_store_store_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -911,7 +1267,7 @@ func (x *ItemsRequest) String() string { func (*ItemsRequest) ProtoMessage() {} func (x *ItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[8] + mi := &file_store_store_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -924,7 +1280,7 @@ func (x *ItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ItemsRequest.ProtoReflect.Descriptor instead. func (*ItemsRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{8} + return file_store_store_proto_rawDescGZIP(), []int{11} } func (x *ItemsRequest) GetName() string { @@ -975,7 +1331,7 @@ type VerifyItemsRequest struct { func (x *VerifyItemsRequest) Reset() { *x = VerifyItemsRequest{} - mi := &file_store_store_proto_msgTypes[9] + mi := &file_store_store_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -987,7 +1343,7 @@ func (x *VerifyItemsRequest) String() string { func (*VerifyItemsRequest) ProtoMessage() {} func (x *VerifyItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[9] + mi := &file_store_store_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1000,7 +1356,7 @@ func (x *VerifyItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyItemsRequest.ProtoReflect.Descriptor instead. func (*VerifyItemsRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{9} + return file_store_store_proto_rawDescGZIP(), []int{12} } func (x *VerifyItemsRequest) GetName() string { @@ -1047,7 +1403,7 @@ type VerifyEditRequest struct { func (x *VerifyEditRequest) Reset() { *x = VerifyEditRequest{} - mi := &file_store_store_proto_msgTypes[10] + mi := &file_store_store_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1059,7 +1415,7 @@ func (x *VerifyEditRequest) String() string { func (*VerifyEditRequest) ProtoMessage() {} func (x *VerifyEditRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[10] + mi := &file_store_store_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1072,7 +1428,7 @@ func (x *VerifyEditRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyEditRequest.ProtoReflect.Descriptor instead. func (*VerifyEditRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{10} + return file_store_store_proto_rawDescGZIP(), []int{13} } func (x *VerifyEditRequest) GetId() int64 { @@ -1092,7 +1448,7 @@ type ApplyEditRequest struct { func (x *ApplyEditRequest) Reset() { *x = ApplyEditRequest{} - mi := &file_store_store_proto_msgTypes[11] + mi := &file_store_store_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1104,7 +1460,7 @@ func (x *ApplyEditRequest) String() string { func (*ApplyEditRequest) ProtoMessage() {} func (x *ApplyEditRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[11] + mi := &file_store_store_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1117,7 +1473,7 @@ func (x *ApplyEditRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyEditRequest.ProtoReflect.Descriptor instead. func (*ApplyEditRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{11} + return file_store_store_proto_rawDescGZIP(), []int{14} } func (x *ApplyEditRequest) GetId() int64 { @@ -1146,7 +1502,7 @@ type DepositItemsRequest struct { func (x *DepositItemsRequest) Reset() { *x = DepositItemsRequest{} - mi := &file_store_store_proto_msgTypes[12] + mi := &file_store_store_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1158,7 +1514,7 @@ func (x *DepositItemsRequest) String() string { func (*DepositItemsRequest) ProtoMessage() {} func (x *DepositItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[12] + mi := &file_store_store_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1171,7 +1527,7 @@ func (x *DepositItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositItemsRequest.ProtoReflect.Descriptor instead. func (*DepositItemsRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{12} + return file_store_store_proto_rawDescGZIP(), []int{15} } func (x *DepositItemsRequest) GetName() string { @@ -1213,7 +1569,7 @@ type DepositVerifyRequest struct { func (x *DepositVerifyRequest) Reset() { *x = DepositVerifyRequest{} - mi := &file_store_store_proto_msgTypes[13] + mi := &file_store_store_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1225,7 +1581,7 @@ func (x *DepositVerifyRequest) String() string { func (*DepositVerifyRequest) ProtoMessage() {} func (x *DepositVerifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[13] + mi := &file_store_store_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1238,7 +1594,7 @@ func (x *DepositVerifyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositVerifyRequest.ProtoReflect.Descriptor instead. func (*DepositVerifyRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{13} + return file_store_store_proto_rawDescGZIP(), []int{16} } func (x *DepositVerifyRequest) GetName() string { @@ -1272,7 +1628,7 @@ type DepositIgnoreRequest struct { func (x *DepositIgnoreRequest) Reset() { *x = DepositIgnoreRequest{} - mi := &file_store_store_proto_msgTypes[14] + mi := &file_store_store_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1284,7 +1640,7 @@ func (x *DepositIgnoreRequest) String() string { func (*DepositIgnoreRequest) ProtoMessage() {} func (x *DepositIgnoreRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[14] + mi := &file_store_store_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1297,7 +1653,7 @@ func (x *DepositIgnoreRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositIgnoreRequest.ProtoReflect.Descriptor instead. func (*DepositIgnoreRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{14} + return file_store_store_proto_rawDescGZIP(), []int{17} } func (x *DepositIgnoreRequest) GetId() int64 { @@ -1324,7 +1680,7 @@ type DepositBackfillRequest struct { func (x *DepositBackfillRequest) Reset() { *x = DepositBackfillRequest{} - mi := &file_store_store_proto_msgTypes[15] + mi := &file_store_store_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +1692,7 @@ func (x *DepositBackfillRequest) String() string { func (*DepositBackfillRequest) ProtoMessage() {} func (x *DepositBackfillRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[15] + mi := &file_store_store_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1349,7 +1705,7 @@ func (x *DepositBackfillRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DepositBackfillRequest.ProtoReflect.Descriptor instead. func (*DepositBackfillRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{15} + return file_store_store_proto_rawDescGZIP(), []int{18} } func (x *DepositBackfillRequest) GetId() int64 { @@ -1376,7 +1732,7 @@ type WebDepositCreateRequest struct { func (x *WebDepositCreateRequest) Reset() { *x = WebDepositCreateRequest{} - mi := &file_store_store_proto_msgTypes[16] + mi := &file_store_store_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1388,7 +1744,7 @@ func (x *WebDepositCreateRequest) String() string { func (*WebDepositCreateRequest) ProtoMessage() {} func (x *WebDepositCreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[16] + mi := &file_store_store_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1401,7 +1757,7 @@ func (x *WebDepositCreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WebDepositCreateRequest.ProtoReflect.Descriptor instead. func (*WebDepositCreateRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{16} + return file_store_store_proto_rawDescGZIP(), []int{19} } func (x *WebDepositCreateRequest) GetBill() string { @@ -1428,7 +1784,7 @@ type WebDepositItemsRequest struct { func (x *WebDepositItemsRequest) Reset() { *x = WebDepositItemsRequest{} - mi := &file_store_store_proto_msgTypes[17] + mi := &file_store_store_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1440,7 +1796,7 @@ func (x *WebDepositItemsRequest) String() string { func (*WebDepositItemsRequest) ProtoMessage() {} func (x *WebDepositItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_store_store_proto_msgTypes[17] + mi := &file_store_store_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1453,7 +1809,7 @@ func (x *WebDepositItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WebDepositItemsRequest.ProtoReflect.Descriptor instead. func (*WebDepositItemsRequest) Descriptor() ([]byte, []int) { - return file_store_store_proto_rawDescGZIP(), []int{17} + return file_store_store_proto_rawDescGZIP(), []int{20} } func (x *WebDepositItemsRequest) GetPage() int32 { @@ -1470,6 +1826,66 @@ func (x *WebDepositItemsRequest) GetSize() int32 { return 0 } +type ExcelExportResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // excel二进制 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExcelExportResponse) Reset() { + *x = ExcelExportResponse{} + mi := &file_store_store_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExcelExportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExcelExportResponse) ProtoMessage() {} + +func (x *ExcelExportResponse) ProtoReflect() protoreflect.Message { + mi := &file_store_store_proto_msgTypes[21] + 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 ExcelExportResponse.ProtoReflect.Descriptor instead. +func (*ExcelExportResponse) Descriptor() ([]byte, []int) { + return file_store_store_proto_rawDescGZIP(), []int{21} +} + +func (x *ExcelExportResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *ExcelExportResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ExcelExportResponse) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + var File_store_store_proto protoreflect.FileDescriptor const file_store_store_proto_rawDesc = "" + @@ -1477,7 +1893,10 @@ const file_store_store_proto_rawDesc = "" + "\x11store/store.proto\x12\x05store\x1a\x1cgoogle/api/annotations.proto\"\x0e\n" + "\fEmptyRequest\"\x1b\n" + "\tIdRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x03R\x02id\"O\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x1e\n" + + "\n" + + "IdsRequest\x12\x10\n" + + "\x03ids\x18\x01 \x03(\x03R\x03ids\"O\n" + "\rStatusRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" + @@ -1512,7 +1931,7 @@ const file_store_store_proto_rawDesc = "" + "\x0flongitude_gcj02\x18\x15 \x01(\tR\x0elongitudeGcj02\x12%\n" + "\x0elatitude_gcj02\x18\x16 \x01(\tR\rlatitudeGcj02\x12\x1d\n" + "\n" + - "store_type\x18\x17 \x01(\x03R\tstoreType\x12\x1a\n" + + "store_type\x18\x17 \x03(\tR\tstoreType\x12\x1a\n" + "\bprovince\x18\x18 \x01(\x03R\bprovince\x12#\n" + "\rprovince_name\x18\x19 \x01(\tR\fprovinceName\x12\x12\n" + "\x04city\x18\x1a \x01(\x03R\x04city\x12\x1b\n" + @@ -1549,14 +1968,50 @@ const file_store_store_proto_rawDesc = "" + "\x0flongitude_gcj02\x18\x18 \x01(\tR\x0elongitudeGcj02\x12%\n" + "\x0elatitude_gcj02\x18\x19 \x01(\tR\rlatitudeGcj02\x12\x1d\n" + "\n" + - "store_type\x18\x1a \x01(\x03R\tstoreType\x12\x1a\n" + + "store_type\x18\x1a \x03(\tR\tstoreType\x12\x1a\n" + "\bprovince\x18\x1b \x01(\x03R\bprovince\x12#\n" + "\rprovince_name\x18\x1c \x01(\tR\fprovinceName\x12\x12\n" + "\x04city\x18\x1d \x01(\x03R\x04city\x12\x1b\n" + "\tcity_name\x18\x1e \x01(\tR\bcityName\x12\x16\n" + "\x06county\x18\x1f \x01(\x03R\x06county\x12\x1f\n" + "\vcounty_name\x18 \x01(\tR\n" + - "countyName\"8\n" + + "countyName\"\xdf\x06\n" + + "\fInfoResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1f\n" + + "\vuser_mobile\x18\x02 \x01(\tR\n" + + "userMobile\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x17\n" + + "\aid_card\x18\x04 \x01(\tR\x06idCard\x12\x18\n" + + "\areceipt\x18\x05 \x01(\tR\areceipt\x12\x12\n" + + "\x04type\x18\x06 \x01(\x05R\x04type\x12\x12\n" + + "\x04area\x18\a \x01(\tR\x04area\x12!\n" + + "\fstore_images\x18\b \x01(\tR\vstoreImages\x12!\n" + + "\fdistrict_ids\x18\t \x01(\tR\vdistrictIds\x12\x18\n" + + "\aaddress\x18\n" + + " \x01(\tR\aaddress\x12\x1b\n" + + "\tbank_info\x18\v \x01(\tR\bbankInfo\x12\x1b\n" + + "\tuser_name\x18\f \x01(\tR\buserName\x12)\n" + + "\x10business_license\x18\r \x01(\tR\x0fbusinessLicense\x12\x16\n" + + "\x06images\x18\x0e \x01(\tR\x06images\x12\x17\n" + + "\asale_id\x18\x0f \x01(\x03R\x06saleId\x12\x18\n" + + "\acontact\x18\x10 \x01(\tR\acontact\x12\x18\n" + + "\acontent\x18\x11 \x01(\tR\acontent\x12\x1b\n" + + "\topen_time\x18\x12 \x01(\tR\bopenTime\x12'\n" + + "\x0flongitude_wgs84\x18\x13 \x01(\tR\x0elongitudeWgs84\x12%\n" + + "\x0elatitude_wgs84\x18\x14 \x01(\tR\rlatitudeWgs84\x12'\n" + + "\x0flongitude_gcj02\x18\x15 \x01(\tR\x0elongitudeGcj02\x12%\n" + + "\x0elatitude_gcj02\x18\x16 \x01(\tR\rlatitudeGcj02\x12\x1d\n" + + "\n" + + "store_type\x18\x17 \x03(\tR\tstoreType\x12\x1a\n" + + "\bprovince\x18\x18 \x01(\x03R\bprovince\x12#\n" + + "\rprovince_name\x18\x19 \x01(\tR\fprovinceName\x12\x12\n" + + "\x04city\x18\x1a \x01(\x03R\x04city\x12\x1b\n" + + "\tcity_name\x18\x1b \x01(\tR\bcityName\x12\x16\n" + + "\x06county\x18\x1c \x01(\x03R\x06county\x12\x1f\n" + + "\vcounty_name\x18\x1d \x01(\tR\n" + + "countyName\":\n" + + "\rItemsResponse\x12)\n" + + "\x05items\x18\x01 \x03(\v2\x13.store.InfoResponseR\x05items\"8\n" + "\rToSaleRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x17\n" + "\asale_id\x18\x02 \x01(\x03R\x06saleId\":\n" + @@ -1600,7 +2055,11 @@ const file_store_store_proto_rawDesc = "" + "\x06amount\x18\x02 \x01(\x01R\x06amount\"@\n" + "\x16WebDepositItemsRequest\x12\x12\n" + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + - "\x04size\x18\x02 \x01(\x05R\x04size2\xa2\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\"O\n" + + "\x13ExcelExportResponse\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x10\n" + + "\x03msg\x18\x03 \x01(\tR\x03msg2\x9c\x13\n" + "\x05Store\x12R\n" + "\x06Status\x12\x14.store.StatusRequest\x1a\x0f.store.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/store/status\x12L\n" + "\x04Edit\x12\x12.store.EditRequest\x1a\x0f.store.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/admin/v3/store/edit\x12R\n" + @@ -1619,15 +2078,17 @@ const file_store_store_proto_rawDesc = "" + "\x11ApplyVerifyStatus\x12\x14.store.StatusRequest\x1a\x0f.store.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/admin/v3/store/apply/status\x12Y\n" + "\vDepositDone\x12\x10.store.IdRequest\x1a\x0f.store.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/admin/v3/store/deposit/done\x12h\n" + "\rDepositIgnore\x12\x1b.store.DepositIgnoreRequest\x1a\x0f.store.Response\")\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/admin/v3/store/deposit/ignore\x12h\n" + - "\rDepositVerify\x12\x1b.store.DepositVerifyRequest\x1a\x0f.store.Response\")\x82\xd3\xe4\x93\x02#:\x01*\x12\x1e/admin/v3/store/deposit/verify\x12c\n" + - "\vDepositDown\x12\x1a.store.DepositItemsRequest\x1a\x0f.store.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\x12\x1c/admin/v3/store/deposit/down\x12e\n" + + "\rDepositVerify\x12\x1b.store.DepositVerifyRequest\x1a\x0f.store.Response\")\x82\xd3\xe4\x93\x02#:\x01*\x12\x1e/admin/v3/store/deposit/verify\x12n\n" + + "\vDepositDown\x12\x1a.store.DepositItemsRequest\x1a\x1a.store.ExcelExportResponse\"'\x82\xd3\xe4\x93\x02!:\x01*\x12\x1c/admin/v3/store/deposit/down\x12e\n" + "\fDepositItems\x12\x1a.store.DepositItemsRequest\x1a\x0f.store.Response\"(\x82\xd3\xe4\x93\x02\":\x01*\x12\x1d/admin/v3/store/deposit/items\x12s\n" + "\x12DepositIgnoreItems\x12\x1b.store.DepositVerifyRequest\x1a\x0f.store.Response\"/\x82\xd3\xe4\x93\x02):\x01*\x12$/admin/v3/store/deposit/ignore/items\x12_\n" + "\x0eDepositRecover\x12\x10.store.IdRequest\x1a\x0f.store.Response\"*\x82\xd3\xe4\x93\x02$:\x01*\x12\x1f/admin/v3/store/deposit/recover\x12n\n" + "\x0fDepositBackfill\x12\x1d.store.DepositBackfillRequest\x1a\x0f.store.Response\"+\x82\xd3\xe4\x93\x02%:\x01*\x12 /admin/v3/store/deposit/backfill\x12l\n" + "\x10WebDepositCreate\x12\x1e.store.WebDepositCreateRequest\x1a\x0f.store.Response\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/v3/store/deposit/create\x12i\n" + "\x0fWebDepositItems\x12\x1d.store.WebDepositItemsRequest\x1a\x0f.store.Response\"&\x82\xd3\xe4\x93\x02 :\x01*\x12\x1b/api/v3/store/deposit/items\x12.\n" + - "\x06SetDef\x12\x13.store.EmptyRequest\x1a\x0f.store.ResponseB\tZ\a./storeb\x06proto3" + "\x06SetDef\x12\x13.store.EmptyRequest\x1a\x0f.store.Response\x124\n" + + "\vGetInfoById\x12\x10.store.IdRequest\x1a\x13.store.InfoResponse\x127\n" + + "\fGetInfoByIds\x12\x11.store.IdsRequest\x1a\x14.store.ItemsResponseB\tZ\a./storeb\x06proto3" var ( file_store_store_proto_rawDescOnce sync.Once @@ -1641,83 +2102,92 @@ func file_store_store_proto_rawDescGZIP() []byte { return file_store_store_proto_rawDescData } -var file_store_store_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_store_store_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_store_store_proto_goTypes = []any{ (*EmptyRequest)(nil), // 0: store.EmptyRequest (*IdRequest)(nil), // 1: store.IdRequest - (*StatusRequest)(nil), // 2: store.StatusRequest - (*Response)(nil), // 3: store.Response - (*EditRequest)(nil), // 4: store.EditRequest - (*CreateRequest)(nil), // 5: store.CreateRequest - (*ToSaleRequest)(nil), // 6: store.ToSaleRequest - (*ContentRequest)(nil), // 7: store.ContentRequest - (*ItemsRequest)(nil), // 8: store.ItemsRequest - (*VerifyItemsRequest)(nil), // 9: store.VerifyItemsRequest - (*VerifyEditRequest)(nil), // 10: store.VerifyEditRequest - (*ApplyEditRequest)(nil), // 11: store.ApplyEditRequest - (*DepositItemsRequest)(nil), // 12: store.DepositItemsRequest - (*DepositVerifyRequest)(nil), // 13: store.DepositVerifyRequest - (*DepositIgnoreRequest)(nil), // 14: store.DepositIgnoreRequest - (*DepositBackfillRequest)(nil), // 15: store.DepositBackfillRequest - (*WebDepositCreateRequest)(nil), // 16: store.WebDepositCreateRequest - (*WebDepositItemsRequest)(nil), // 17: store.WebDepositItemsRequest + (*IdsRequest)(nil), // 2: store.IdsRequest + (*StatusRequest)(nil), // 3: store.StatusRequest + (*Response)(nil), // 4: store.Response + (*EditRequest)(nil), // 5: store.EditRequest + (*CreateRequest)(nil), // 6: store.CreateRequest + (*InfoResponse)(nil), // 7: store.InfoResponse + (*ItemsResponse)(nil), // 8: store.ItemsResponse + (*ToSaleRequest)(nil), // 9: store.ToSaleRequest + (*ContentRequest)(nil), // 10: store.ContentRequest + (*ItemsRequest)(nil), // 11: store.ItemsRequest + (*VerifyItemsRequest)(nil), // 12: store.VerifyItemsRequest + (*VerifyEditRequest)(nil), // 13: store.VerifyEditRequest + (*ApplyEditRequest)(nil), // 14: store.ApplyEditRequest + (*DepositItemsRequest)(nil), // 15: store.DepositItemsRequest + (*DepositVerifyRequest)(nil), // 16: store.DepositVerifyRequest + (*DepositIgnoreRequest)(nil), // 17: store.DepositIgnoreRequest + (*DepositBackfillRequest)(nil), // 18: store.DepositBackfillRequest + (*WebDepositCreateRequest)(nil), // 19: store.WebDepositCreateRequest + (*WebDepositItemsRequest)(nil), // 20: store.WebDepositItemsRequest + (*ExcelExportResponse)(nil), // 21: store.ExcelExportResponse } var file_store_store_proto_depIdxs = []int32{ - 2, // 0: store.Store.Status:input_type -> store.StatusRequest - 4, // 1: store.Store.Edit:input_type -> store.EditRequest - 5, // 2: store.Store.Create:input_type -> store.CreateRequest - 6, // 3: store.Store.ToSale:input_type -> store.ToSaleRequest - 1, // 4: store.Store.Info:input_type -> store.IdRequest - 7, // 5: store.Store.Content:input_type -> store.ContentRequest - 0, // 6: store.Store.Names:input_type -> store.EmptyRequest - 8, // 7: store.Store.Items:input_type -> store.ItemsRequest - 9, // 8: store.Store.VerifyItems:input_type -> store.VerifyItemsRequest - 2, // 9: store.Store.VerifyStatus:input_type -> store.StatusRequest - 4, // 10: store.Store.VerifyEdit:input_type -> store.EditRequest - 11, // 11: store.Store.ApplyEdit:input_type -> store.ApplyEditRequest - 8, // 12: store.Store.ApplyVerify:input_type -> store.ItemsRequest - 2, // 13: store.Store.ApplyVerifyStatus:input_type -> store.StatusRequest - 1, // 14: store.Store.DepositDone:input_type -> store.IdRequest - 14, // 15: store.Store.DepositIgnore:input_type -> store.DepositIgnoreRequest - 13, // 16: store.Store.DepositVerify:input_type -> store.DepositVerifyRequest - 12, // 17: store.Store.DepositDown:input_type -> store.DepositItemsRequest - 12, // 18: store.Store.DepositItems:input_type -> store.DepositItemsRequest - 13, // 19: store.Store.DepositIgnoreItems:input_type -> store.DepositVerifyRequest - 1, // 20: store.Store.DepositRecover:input_type -> store.IdRequest - 15, // 21: store.Store.DepositBackfill:input_type -> store.DepositBackfillRequest - 16, // 22: store.Store.WebDepositCreate:input_type -> store.WebDepositCreateRequest - 17, // 23: store.Store.WebDepositItems:input_type -> store.WebDepositItemsRequest - 0, // 24: store.Store.SetDef:input_type -> store.EmptyRequest - 3, // 25: store.Store.Status:output_type -> store.Response - 3, // 26: store.Store.Edit:output_type -> store.Response - 3, // 27: store.Store.Create:output_type -> store.Response - 3, // 28: store.Store.ToSale:output_type -> store.Response - 3, // 29: store.Store.Info:output_type -> store.Response - 3, // 30: store.Store.Content:output_type -> store.Response - 3, // 31: store.Store.Names:output_type -> store.Response - 3, // 32: store.Store.Items:output_type -> store.Response - 3, // 33: store.Store.VerifyItems:output_type -> store.Response - 3, // 34: store.Store.VerifyStatus:output_type -> store.Response - 3, // 35: store.Store.VerifyEdit:output_type -> store.Response - 3, // 36: store.Store.ApplyEdit:output_type -> store.Response - 3, // 37: store.Store.ApplyVerify:output_type -> store.Response - 3, // 38: store.Store.ApplyVerifyStatus:output_type -> store.Response - 3, // 39: store.Store.DepositDone:output_type -> store.Response - 3, // 40: store.Store.DepositIgnore:output_type -> store.Response - 3, // 41: store.Store.DepositVerify:output_type -> store.Response - 3, // 42: store.Store.DepositDown:output_type -> store.Response - 3, // 43: store.Store.DepositItems:output_type -> store.Response - 3, // 44: store.Store.DepositIgnoreItems:output_type -> store.Response - 3, // 45: store.Store.DepositRecover:output_type -> store.Response - 3, // 46: store.Store.DepositBackfill:output_type -> store.Response - 3, // 47: store.Store.WebDepositCreate:output_type -> store.Response - 3, // 48: store.Store.WebDepositItems:output_type -> store.Response - 3, // 49: store.Store.SetDef:output_type -> store.Response - 25, // [25:50] is the sub-list for method output_type - 0, // [0:25] 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 + 7, // 0: store.ItemsResponse.items:type_name -> store.InfoResponse + 3, // 1: store.Store.Status:input_type -> store.StatusRequest + 5, // 2: store.Store.Edit:input_type -> store.EditRequest + 6, // 3: store.Store.Create:input_type -> store.CreateRequest + 9, // 4: store.Store.ToSale:input_type -> store.ToSaleRequest + 1, // 5: store.Store.Info:input_type -> store.IdRequest + 10, // 6: store.Store.Content:input_type -> store.ContentRequest + 0, // 7: store.Store.Names:input_type -> store.EmptyRequest + 11, // 8: store.Store.Items:input_type -> store.ItemsRequest + 12, // 9: store.Store.VerifyItems:input_type -> store.VerifyItemsRequest + 3, // 10: store.Store.VerifyStatus:input_type -> store.StatusRequest + 5, // 11: store.Store.VerifyEdit:input_type -> store.EditRequest + 14, // 12: store.Store.ApplyEdit:input_type -> store.ApplyEditRequest + 11, // 13: store.Store.ApplyVerify:input_type -> store.ItemsRequest + 3, // 14: store.Store.ApplyVerifyStatus:input_type -> store.StatusRequest + 1, // 15: store.Store.DepositDone:input_type -> store.IdRequest + 17, // 16: store.Store.DepositIgnore:input_type -> store.DepositIgnoreRequest + 16, // 17: store.Store.DepositVerify:input_type -> store.DepositVerifyRequest + 15, // 18: store.Store.DepositDown:input_type -> store.DepositItemsRequest + 15, // 19: store.Store.DepositItems:input_type -> store.DepositItemsRequest + 16, // 20: store.Store.DepositIgnoreItems:input_type -> store.DepositVerifyRequest + 1, // 21: store.Store.DepositRecover:input_type -> store.IdRequest + 18, // 22: store.Store.DepositBackfill:input_type -> store.DepositBackfillRequest + 19, // 23: store.Store.WebDepositCreate:input_type -> store.WebDepositCreateRequest + 20, // 24: store.Store.WebDepositItems:input_type -> store.WebDepositItemsRequest + 0, // 25: store.Store.SetDef:input_type -> store.EmptyRequest + 1, // 26: store.Store.GetInfoById:input_type -> store.IdRequest + 2, // 27: store.Store.GetInfoByIds:input_type -> store.IdsRequest + 4, // 28: store.Store.Status:output_type -> store.Response + 4, // 29: store.Store.Edit:output_type -> store.Response + 4, // 30: store.Store.Create:output_type -> store.Response + 4, // 31: store.Store.ToSale:output_type -> store.Response + 4, // 32: store.Store.Info:output_type -> store.Response + 4, // 33: store.Store.Content:output_type -> store.Response + 4, // 34: store.Store.Names:output_type -> store.Response + 4, // 35: store.Store.Items:output_type -> store.Response + 4, // 36: store.Store.VerifyItems:output_type -> store.Response + 4, // 37: store.Store.VerifyStatus:output_type -> store.Response + 4, // 38: store.Store.VerifyEdit:output_type -> store.Response + 4, // 39: store.Store.ApplyEdit:output_type -> store.Response + 4, // 40: store.Store.ApplyVerify:output_type -> store.Response + 4, // 41: store.Store.ApplyVerifyStatus:output_type -> store.Response + 4, // 42: store.Store.DepositDone:output_type -> store.Response + 4, // 43: store.Store.DepositIgnore:output_type -> store.Response + 4, // 44: store.Store.DepositVerify:output_type -> store.Response + 21, // 45: store.Store.DepositDown:output_type -> store.ExcelExportResponse + 4, // 46: store.Store.DepositItems:output_type -> store.Response + 4, // 47: store.Store.DepositIgnoreItems:output_type -> store.Response + 4, // 48: store.Store.DepositRecover:output_type -> store.Response + 4, // 49: store.Store.DepositBackfill:output_type -> store.Response + 4, // 50: store.Store.WebDepositCreate:output_type -> store.Response + 4, // 51: store.Store.WebDepositItems:output_type -> store.Response + 4, // 52: store.Store.SetDef:output_type -> store.Response + 7, // 53: store.Store.GetInfoById:output_type -> store.InfoResponse + 8, // 54: store.Store.GetInfoByIds:output_type -> store.ItemsResponse + 28, // [28:55] is the sub-list for method output_type + 1, // [1:28] 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_store_store_proto_init() } @@ -1731,7 +2201,7 @@ func file_store_store_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_store_proto_rawDesc), len(file_store_store_proto_rawDesc)), NumEnums: 0, - NumMessages: 18, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/store/pb/store_grpc.pb.go b/rpc/store/pb/store_grpc.pb.go index d021e5f..f258d0e 100644 --- a/rpc/store/pb/store_grpc.pb.go +++ b/rpc/store/pb/store_grpc.pb.go @@ -44,6 +44,8 @@ const ( Store_WebDepositCreate_FullMethodName = "/store.Store/WebDepositCreate" Store_WebDepositItems_FullMethodName = "/store.Store/WebDepositItems" Store_SetDef_FullMethodName = "/store.Store/SetDef" + Store_GetInfoById_FullMethodName = "/store.Store/GetInfoById" + Store_GetInfoByIds_FullMethodName = "/store.Store/GetInfoByIds" ) // StoreClient is the client API for Store service. @@ -67,7 +69,7 @@ type StoreClient interface { DepositDone(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) DepositIgnore(ctx context.Context, in *DepositIgnoreRequest, opts ...grpc.CallOption) (*Response, error) DepositVerify(ctx context.Context, in *DepositVerifyRequest, opts ...grpc.CallOption) (*Response, error) - DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) + DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) DepositItems(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) DepositIgnoreItems(ctx context.Context, in *DepositVerifyRequest, opts ...grpc.CallOption) (*Response, error) DepositRecover(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) @@ -75,6 +77,8 @@ type StoreClient interface { WebDepositCreate(ctx context.Context, in *WebDepositCreateRequest, opts ...grpc.CallOption) (*Response, error) WebDepositItems(ctx context.Context, in *WebDepositItemsRequest, opts ...grpc.CallOption) (*Response, error) SetDef(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + GetInfoById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*InfoResponse, error) + GetInfoByIds(ctx context.Context, in *IdsRequest, opts ...grpc.CallOption) (*ItemsResponse, error) } type storeClient struct { @@ -255,9 +259,9 @@ func (c *storeClient) DepositVerify(ctx context.Context, in *DepositVerifyReques return out, nil } -func (c *storeClient) DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *storeClient) DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) + out := new(ExcelExportResponse) err := c.cc.Invoke(ctx, Store_DepositDown_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -335,6 +339,26 @@ func (c *storeClient) SetDef(ctx context.Context, in *EmptyRequest, opts ...grpc return out, nil } +func (c *storeClient) GetInfoById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InfoResponse) + err := c.cc.Invoke(ctx, Store_GetInfoById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) GetInfoByIds(ctx context.Context, in *IdsRequest, opts ...grpc.CallOption) (*ItemsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ItemsResponse) + err := c.cc.Invoke(ctx, Store_GetInfoByIds_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // StoreServer is the server API for Store service. // All implementations must embed UnimplementedStoreServer // for forward compatibility. @@ -356,7 +380,7 @@ type StoreServer interface { DepositDone(context.Context, *IdRequest) (*Response, error) DepositIgnore(context.Context, *DepositIgnoreRequest) (*Response, error) DepositVerify(context.Context, *DepositVerifyRequest) (*Response, error) - DepositDown(context.Context, *DepositItemsRequest) (*Response, error) + DepositDown(context.Context, *DepositItemsRequest) (*ExcelExportResponse, error) DepositItems(context.Context, *DepositItemsRequest) (*Response, error) DepositIgnoreItems(context.Context, *DepositVerifyRequest) (*Response, error) DepositRecover(context.Context, *IdRequest) (*Response, error) @@ -364,6 +388,8 @@ type StoreServer interface { WebDepositCreate(context.Context, *WebDepositCreateRequest) (*Response, error) WebDepositItems(context.Context, *WebDepositItemsRequest) (*Response, error) SetDef(context.Context, *EmptyRequest) (*Response, error) + GetInfoById(context.Context, *IdRequest) (*InfoResponse, error) + GetInfoByIds(context.Context, *IdsRequest) (*ItemsResponse, error) mustEmbedUnimplementedStoreServer() } @@ -425,7 +451,7 @@ func (UnimplementedStoreServer) DepositIgnore(context.Context, *DepositIgnoreReq func (UnimplementedStoreServer) DepositVerify(context.Context, *DepositVerifyRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method DepositVerify not implemented") } -func (UnimplementedStoreServer) DepositDown(context.Context, *DepositItemsRequest) (*Response, error) { +func (UnimplementedStoreServer) DepositDown(context.Context, *DepositItemsRequest) (*ExcelExportResponse, error) { return nil, status.Error(codes.Unimplemented, "method DepositDown not implemented") } func (UnimplementedStoreServer) DepositItems(context.Context, *DepositItemsRequest) (*Response, error) { @@ -449,6 +475,12 @@ func (UnimplementedStoreServer) WebDepositItems(context.Context, *WebDepositItem func (UnimplementedStoreServer) SetDef(context.Context, *EmptyRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method SetDef not implemented") } +func (UnimplementedStoreServer) GetInfoById(context.Context, *IdRequest) (*InfoResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetInfoById not implemented") +} +func (UnimplementedStoreServer) GetInfoByIds(context.Context, *IdsRequest) (*ItemsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetInfoByIds not implemented") +} func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {} func (UnimplementedStoreServer) testEmbeddedByValue() {} @@ -920,6 +952,42 @@ func _Store_SetDef_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Store_GetInfoById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).GetInfoById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Store_GetInfoById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).GetInfoById(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_GetInfoByIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).GetInfoByIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Store_GetInfoByIds_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).GetInfoByIds(ctx, req.(*IdsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Store_ServiceDesc is the grpc.ServiceDesc for Store service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1027,6 +1095,14 @@ var Store_ServiceDesc = grpc.ServiceDesc{ MethodName: "SetDef", Handler: _Store_SetDef_Handler, }, + { + MethodName: "GetInfoById", + Handler: _Store_GetInfoById_Handler, + }, + { + MethodName: "GetInfoByIds", + Handler: _Store_GetInfoByIds_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "store/store.proto", diff --git a/rpc/store/store.pb b/rpc/store/store.pb index 6c908ad..86b0560 100644 Binary files a/rpc/store/store.pb and b/rpc/store/store.pb differ diff --git a/rpc/store/store.proto b/rpc/store/store.proto index 39b5ea5..5cc5665 100644 --- a/rpc/store/store.proto +++ b/rpc/store/store.proto @@ -10,6 +10,9 @@ message EmptyRequest { message IdRequest { int64 id = 1; } +message IdsRequest { + repeated int64 ids = 1; +} message StatusRequest { int64 id = 1; @@ -46,7 +49,7 @@ message EditRequest { string latitude_wgs84 = 20; string longitude_gcj02 = 21; string latitude_gcj02 = 22; - int64 store_type = 23; + repeated string store_type = 23; int64 province = 24; string province_name = 25; int64 city = 26; @@ -81,7 +84,7 @@ message CreateRequest { string latitude_wgs84 = 23; string longitude_gcj02 = 24; string latitude_gcj02 = 25; - int64 store_type = 26; + repeated string store_type = 26; int64 province = 27; string province_name = 28; int64 city = 29; @@ -90,6 +93,42 @@ message CreateRequest { string county_name = 32; } +message InfoResponse { + int64 id = 1; + string user_mobile = 2; + string name = 3; + string id_card = 4; + string receipt = 5; + int32 type = 6; + string area = 7; + string store_images = 8; + string district_ids = 9; + string address = 10; + string bank_info = 11; + string user_name = 12; + string business_license = 13; + string images = 14; + int64 sale_id = 15; + string contact = 16; + string content = 17; + string open_time = 18; + string longitude_wgs84 = 19; + string latitude_wgs84 = 20; + string longitude_gcj02 = 21; + string latitude_gcj02 = 22; + repeated string store_type = 23; + int64 province = 24; + string province_name = 25; + int64 city = 26; + string city_name = 27; + int64 county = 28; + string county_name = 29; +} + +message ItemsResponse { + repeated InfoResponse items = 1; +} + message ToSaleRequest { int64 id = 1; int64 sale_id = 2; @@ -127,14 +166,14 @@ message ApplyEditRequest { message DepositItemsRequest { string name = 1; - int32 page = 2; - int32 size = 3; - int32 status = 4; + int32 page = 2; + int32 size = 3; + int32 status = 4; } message DepositVerifyRequest { string name = 1; - int32 page = 2; - int32 size = 3; + int32 page = 2; + int32 size = 3; } message DepositIgnoreRequest { int64 id = 1; @@ -156,6 +195,12 @@ message WebDepositItemsRequest { int32 size = 2; } +message ExcelExportResponse { + bytes data = 1; // excel二进制 + string name = 2; + string msg = 3; +} + service Store { rpc Status(StatusRequest) returns(Response){ option (google.api.http) = { @@ -263,7 +308,7 @@ service Store { }; } - rpc DepositDown(DepositItemsRequest) returns (Response) { + rpc DepositDown(DepositItemsRequest) returns (ExcelExportResponse) { option (google.api.http) = { get: "/admin/v3/store/deposit/down" body: "*" @@ -312,4 +357,6 @@ service Store { } rpc SetDef(EmptyRequest) returns (Response); + rpc GetInfoById(IdRequest) returns (InfoResponse); + rpc GetInfoByIds(IdsRequest) returns (ItemsResponse); } \ No newline at end of file diff --git a/services/chore/choreclient/chore.go b/services/chore/choreclient/chore.go index bb86000..bae15b1 100644 --- a/services/chore/choreclient/chore.go +++ b/services/chore/choreclient/chore.go @@ -26,6 +26,8 @@ type ( RegionsByIdsReq = chore.RegionsByIdsReq RegionsReq = chore.RegionsReq Response = chore.Response + SendPasswordReq = chore.SendPasswordReq + SendPasswordResp = chore.SendPasswordResp SendSmsReq = chore.SendSmsReq StatusReq = chore.StatusReq SystemEditReq = chore.SystemEditReq @@ -46,10 +48,9 @@ type ( SystemStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error) SystemInfo(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*Response, error) SystemItems(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) - // 按 id 批量查地区名称 RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) - // 服务间:写入编辑申请日志 InternalActionApplyLogCreate(ctx context.Context, in *InternalActionApplyLogCreateReq, opts ...grpc.CallOption) (*InternalActionApplyLogCreateData, error) + SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) } defaultChore struct { @@ -133,14 +134,17 @@ func (m *defaultChore) SystemItems(ctx context.Context, in *EmptyReq, opts ...gr return client.SystemItems(ctx, in, opts...) } -// 按 id 批量查地区名称 func (m *defaultChore) RegionsByIds(ctx context.Context, in *RegionsByIdsReq, opts ...grpc.CallOption) (*RegionsByIdsData, error) { client := chore.NewChoreClient(m.cli.Conn()) return client.RegionsByIds(ctx, in, opts...) } -// 服务间:写入编辑申请日志 func (m *defaultChore) InternalActionApplyLogCreate(ctx context.Context, in *InternalActionApplyLogCreateReq, opts ...grpc.CallOption) (*InternalActionApplyLogCreateData, error) { client := chore.NewChoreClient(m.cli.Conn()) return client.InternalActionApplyLogCreate(ctx, in, opts...) } + +func (m *defaultChore) SendPassword(ctx context.Context, in *SendPasswordReq, opts ...grpc.CallOption) (*SendPasswordResp, error) { + client := chore.NewChoreClient(m.cli.Conn()) + return client.SendPassword(ctx, in, opts...) +} diff --git a/services/chore/internal/dao/smsLog.go b/services/chore/internal/dao/smsLog.go new file mode 100644 index 0000000..07bb27d --- /dev/null +++ b/services/chore/internal/dao/smsLog.go @@ -0,0 +1,11 @@ +package dao + +type SmsLogCreate struct { + Id int `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:ID" json:"id"` + Mobile string `gorm:"column:mobile;type:varchar(255)" json:"mobile"` + Content string `gorm:"column:content;type:varchar(255)" json:"content"` + BakContent string `gorm:"column:bak_content;type:varchar(255);comment:内容" json:"bak_content"` + BrowserInfo string `gorm:"column:browser_info;type:varchar(255);comment:浏览器详细信息" json:"browser_info"` + BrowserName string `gorm:"column:browser_name;type:varchar(255);comment:浏览器名称" json:"browser_name"` + Ip string `gorm:"column:ip;type:varchar(20);comment:IP;NOT NULL" json:"ip"` +} diff --git a/services/chore/internal/logic/sendPasswordLogic.go b/services/chore/internal/logic/sendPasswordLogic.go new file mode 100644 index 0000000..0fab9cb --- /dev/null +++ b/services/chore/internal/logic/sendPasswordLogic.go @@ -0,0 +1,58 @@ +package logic + +import ( + "context" + "lone-services/pkg/sms" + "lone-services/pkg/utils" + "lone-services/rpc/chore/pb" + "lone-services/services/chore/internal/dao" + "lone-services/services/chore/internal/model" + "lone-services/services/chore/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type SendPasswordLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewSendPasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendPasswordLogic { + return &SendPasswordLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *SendPasswordLogic) SendPassword(in *chore.SendPasswordReq) (*chore.SendPasswordResp, error) { + if l.svcCtx.SMS == nil { + return nil, status.Error(codes.InvalidArgument, "短信服务未配置") + } + + err := l.svcCtx.SMS.SendByKind(in.Mobile, sms.TemplatePassword, map[string]string{"code": in.Password}) + + log := dao.SmsLogCreate{ + Mobile: in.Mobile, + Content: "您的初始密码为:" + in.Password + ",请尽快登录后修改!", + BakContent: err.Error(), + BrowserInfo: in.BrowserInfo, + BrowserName: in.BrowserName, + Ip: in.Ip, + } + sErr := model.SmsLogModel{}.Init().Create(&log) + if sErr != nil { + l.Errorf("sms log create: %v", sErr) + return nil, status.Error(codes.Internal, "短信日志保存失败") + } + + if err != nil { + l.Errorf("sms send: %v", err) + return nil, status.Error(codes.InvalidArgument, "短信发送失败") + } + + return &chore.SendPasswordResp{Code: utils.NumberOne}, nil +} diff --git a/services/chore/internal/model/smsLog.go b/services/chore/internal/model/smsLog.go new file mode 100644 index 0000000..6aa7c6d --- /dev/null +++ b/services/chore/internal/model/smsLog.go @@ -0,0 +1,18 @@ +package model + +import ( + "lone-services/pkg/modelbase" +) + +type SmsLogModel struct { + modelbase.Base +} + +func (m SmsLogModel) TableName() string { + return modelbase.Prefix() + "sms_log" +} + +func (m SmsLogModel) Init() SmsLogModel { + m.Table = m.TableName() + return m +} diff --git a/services/chore/internal/server/choreServer.go b/services/chore/internal/server/choreServer.go index d2394b8..3ded417 100644 --- a/services/chore/internal/server/choreServer.go +++ b/services/chore/internal/server/choreServer.go @@ -93,14 +93,17 @@ func (s *ChoreServer) SystemItems(ctx context.Context, in *chore.EmptyReq) (*cho return l.SystemItems(in) } -// 按 id 批量查地区名称 func (s *ChoreServer) RegionsByIds(ctx context.Context, in *chore.RegionsByIdsReq) (*chore.RegionsByIdsData, error) { l := logic.NewRegionsByIdsLogic(ctx, s.svcCtx) return l.RegionsByIds(in) } -// 服务间:写入编辑申请日志 func (s *ChoreServer) InternalActionApplyLogCreate(ctx context.Context, in *chore.InternalActionApplyLogCreateReq) (*chore.InternalActionApplyLogCreateData, error) { l := logic.NewInternalActionApplyLogCreateLogic(ctx, s.svcCtx) return l.InternalActionApplyLogCreate(in) } + +func (s *ChoreServer) SendPassword(ctx context.Context, in *chore.SendPasswordReq) (*chore.SendPasswordResp, error) { + l := logic.NewSendPasswordLogic(ctx, s.svcCtx) + return l.SendPassword(in) +} diff --git a/services/equipment/equipmentclient/equipment.go b/services/equipment/equipmentclient/equipment.go index 510f886..9079f59 100644 --- a/services/equipment/equipmentclient/equipment.go +++ b/services/equipment/equipmentclient/equipment.go @@ -14,12 +14,25 @@ import ( ) type ( - CreateRequest = equipment.CreateRequest - EditRequest = equipment.EditRequest - IdRequest = equipment.IdRequest - ItemsRequest = equipment.ItemsRequest - Response = equipment.Response - StatusRequest = equipment.StatusRequest + ApiBeansAddRequest = equipment.ApiBeansAddRequest + ApiBeansItemsRequest = equipment.ApiBeansItemsRequest + ApiBindAddRequest = equipment.ApiBindAddRequest + ApiBindExpiryGetRequest = equipment.ApiBindExpiryGetRequest + ApiBindExpiryRequest = equipment.ApiBindExpiryRequest + ApiMaskAddRequest = equipment.ApiMaskAddRequest + ApiMaskUseRequest = equipment.ApiMaskUseRequest + ApiMaskUsedItemsRequest = equipment.ApiMaskUsedItemsRequest + ApiUnBindRequest = equipment.ApiUnBindRequest + BeansItemsRequest = equipment.BeansItemsRequest + BindExpiryRequest = equipment.BindExpiryRequest + CreateRequest = equipment.CreateRequest + EditRequest = equipment.EditRequest + EmptyRequest = equipment.EmptyRequest + IdRequest = equipment.IdRequest + ItemsRequest = equipment.ItemsRequest + MaskItemsRequest = equipment.MaskItemsRequest + Response = equipment.Response + StatusRequest = equipment.StatusRequest Equipment interface { Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) @@ -27,6 +40,23 @@ type ( Create(ctx context.Context, in *CreateRequest, 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) + MaskItems(ctx context.Context, in *MaskItemsRequest, opts ...grpc.CallOption) (*Response, error) + BeansItems(ctx context.Context, in *BeansItemsRequest, opts ...grpc.CallOption) (*Response, error) + BindExpiry(ctx context.Context, in *BindExpiryRequest, opts ...grpc.CallOption) (*Response, error) + // API + ApiMaskAdd(ctx context.Context, in *ApiMaskAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + ApiUnBind(ctx context.Context, in *ApiUnBindRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindAdd(ctx context.Context, in *ApiBindAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindExpiry(ctx context.Context, in *ApiBindExpiryRequest, opts ...grpc.CallOption) (*Response, error) + ApiBindExpiryGet(ctx context.Context, in *ApiBindExpiryGetRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansAdd(ctx context.Context, in *ApiBeansAddRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansLast(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + ApiBeansItems(ctx context.Context, in *ApiBeansItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskUsedItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskStoreUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) + ApiMaskStoreUseItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) } defaultEquipment struct { @@ -64,3 +94,84 @@ func (m *defaultEquipment) Status(ctx context.Context, in *StatusRequest, opts . client := equipment.NewEquipmentClient(m.cli.Conn()) return client.Status(ctx, in, opts...) } + +func (m *defaultEquipment) MaskItems(ctx context.Context, in *MaskItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.MaskItems(ctx, in, opts...) +} + +func (m *defaultEquipment) BeansItems(ctx context.Context, in *BeansItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.BeansItems(ctx, in, opts...) +} + +func (m *defaultEquipment) BindExpiry(ctx context.Context, in *BindExpiryRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.BindExpiry(ctx, in, opts...) +} + +// API +func (m *defaultEquipment) ApiMaskAdd(ctx context.Context, in *ApiMaskAddRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiMaskAdd(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBindItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBindItems(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiUnBind(ctx context.Context, in *ApiUnBindRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiUnBind(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBindAdd(ctx context.Context, in *ApiBindAddRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBindAdd(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBindExpiry(ctx context.Context, in *ApiBindExpiryRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBindExpiry(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBindExpiryGet(ctx context.Context, in *ApiBindExpiryGetRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBindExpiryGet(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBeansAdd(ctx context.Context, in *ApiBeansAddRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBeansAdd(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBeansLast(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBeansLast(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiBeansItems(ctx context.Context, in *ApiBeansItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiBeansItems(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiMaskUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiMaskUse(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiMaskUsedItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiMaskUsedItems(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiMaskStoreUse(ctx context.Context, in *ApiMaskUseRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiMaskStoreUse(ctx, in, opts...) +} + +func (m *defaultEquipment) ApiMaskStoreUseItems(ctx context.Context, in *ApiMaskUsedItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := equipment.NewEquipmentClient(m.cli.Conn()) + return client.ApiMaskStoreUseItems(ctx, in, opts...) +} diff --git a/services/equipment/internal/dao/beans.go b/services/equipment/internal/dao/beans.go new file mode 100644 index 0000000..ae654d8 --- /dev/null +++ b/services/equipment/internal/dao/beans.go @@ -0,0 +1,32 @@ +package dao + +import "lone-services/pkg/utils" + +type BeansCreate struct { + Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + UserId int64 `gorm:"column:user_id;type:int(11);NOT NULL" json:"user_id"` + UserName string `gorm:"column:user_name;type:varchar(255)" json:"user_name"` + UserNickName string `gorm:"column:user_nick_name;type:varchar(255)" json:"user_nick_name"` + FirstImage string `gorm:"column:first_image;type:varchar(255)" json:"first_image"` + FirstTime utils.CustomTime `gorm:"column:first_time;type:datetime" json:"first_time"` +} + +type BeansInfo struct { + Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + UserId int64 `gorm:"column:user_id;type:int(11);NOT NULL" json:"user_id"` + UserName string `gorm:"column:user_name;type:varchar(255)" json:"user_name"` + UserNickName string `gorm:"column:user_nick_name;type:varchar(255)" json:"user_nick_name"` + FirstImage string `gorm:"column:first_image;type:varchar(255)" json:"first_image"` + SecondImage string `gorm:"column:second_image;type:varchar(255)" json:"second_image"` + FirstTime utils.CustomTime `gorm:"column:first_time;type:datetime" json:"first_time"` + SecondTime utils.CustomTime `gorm:"column:second_time;type:datetime" json:"second_time"` + RefundStatus int32 `gorm:"column:refund_status;type:tinyint(1);default:1;comment:退款状态,默认1为没有退款,2为退款" json:"refund_status"` +} + +type BeansRefund struct { + Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + RefundStatus int32 `gorm:"column:refund_status;type:tinyint(1);default:1;comment:退款状态,默认1为没有退款,2为退款" json:"refund_status"` + Reason string `gorm:"column:reason;type:varchar(255);comment:禁用原因" json:"reason"` + AdminId int64 `gorm:"column:admin_id;type:int(11)" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255)" json:"admin_name"` +} diff --git a/services/equipment/internal/dao/bind.go b/services/equipment/internal/dao/bind.go new file mode 100644 index 0000000..01ceac3 --- /dev/null +++ b/services/equipment/internal/dao/bind.go @@ -0,0 +1,40 @@ +package dao + +import ( + "lone-services/pkg/utils" +) + +type BindCreate struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + HostCode string `gorm:"column:host_code;type:varchar(64);comment:主机编号;NOT NULL" json:"host_code"` + HostNickname string `gorm:"column:host_nickname;type:varchar(128);comment:主机昵称;NOT NULL" json:"host_nickname"` + UserId int64 `gorm:"column:user_id;type:int(11);comment:用户ID;NOT NULL" json:"user_id"` + UserNickname string `gorm:"column:user_nickname;type:varchar(128);comment:用户昵称;NOT NULL" json:"user_nickname"` + Image string `gorm:"column:image;type:varchar(128);comment:图片地址;NOT NULL" json:"image"` + IsSpeciality int32 `gorm:"column:is_speciality;type:tinyint(1);default:0;comment:1是专业版;NOT NULL" json:"is_speciality"` + Status int32 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用" json:"status"` + BindTime utils.CustomTime `gorm:"column:bind_time;type:datetime;comment:绑定时间" json:"bind_time"` +} + +type BindInfo struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + HostCode string `gorm:"column:host_code;type:varchar(64);comment:主机编号;NOT NULL" json:"host_code"` + HostNickname string `gorm:"column:host_nickname;type:varchar(128);comment:主机昵称;NOT NULL" json:"host_nickname"` + UserId int64 `gorm:"column:user_id;type:int(11);comment:用户ID;NOT NULL" json:"user_id"` + UserNickname string `gorm:"column:user_nickname;type:varchar(128);comment:用户昵称;NOT NULL" json:"user_nickname"` + Image string `gorm:"column:image;type:varchar(128);comment:图片地址;NOT NULL" json:"image"` + IsSpeciality int32 `gorm:"column:is_speciality;type:tinyint(1);default:0;comment:1是专业版;NOT NULL" json:"is_speciality"` + ExpiryTime string `gorm:"column:expiry_time;type:char(11);comment:过期时间" json:"expiry_time"` + Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为禁用" json:"status"` + BindTime utils.CustomTime `gorm:"column:bind_time;type:datetime;comment:绑定时间" json:"bind_time"` + UpdatedAt utils.CustomTime `gorm:"column:updated_at;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"updated_at"` +} + +type BindExpiry struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + HostCode string `gorm:"column:host_code;type:varchar(64);comment:主机编号;NOT NULL" json:"host_code"` + ExpiryTime string `gorm:"column:expiry_time;type:char(11);comment:过期时间" json:"expiry_time"` + Reason string `gorm:"column:reason;type:varchar(255);comment:理由" json:"reason"` + AdminId int64 `gorm:"column:admin_id;type:int(11)" json:"admin_id"` + AdminName string `gorm:"column:admin_name;type:varchar(255)" json:"admin_name"` +} diff --git a/services/equipment/internal/dao/bindHistory.go b/services/equipment/internal/dao/bindHistory.go new file mode 100644 index 0000000..6d267a0 --- /dev/null +++ b/services/equipment/internal/dao/bindHistory.go @@ -0,0 +1,8 @@ +package dao + +type BindHistoryCreate struct { + Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` + HostCode string `gorm:"column:host_code;type:varchar(128);comment:设备昵称;NOT NULL" json:"host_code"` + Status int32 `gorm:"column:status;type:tinyint(1);default:2;comment:1为绑定,2为解绑;NOT NULL" json:"status"` + UserId int64 `gorm:"column:user_id;type:int(11)" json:"user_id"` +} diff --git a/services/equipment/internal/dao/mask.go b/services/equipment/internal/dao/mask.go new file mode 100644 index 0000000..195ac82 --- /dev/null +++ b/services/equipment/internal/dao/mask.go @@ -0,0 +1,100 @@ +package dao + +import "lone-services/pkg/utils" + +const ( + FacialTypeOrdinary = 0 // 面膜类型 0普通型 + FacialTypeTry = 1 // 面膜类型 1试用型 + FacialTypeAll = 2 // 面膜类型 2通用型 + FacialTypeOnce = 3 // 面膜类型 3一次性型 +) + +type MaskInfo struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + FacialMaskId string `gorm:"column:facial_mask_id;type:varchar(64);comment:面膜id;NOT NULL" json:"facial_mask_id"` + HostCode string `gorm:"column:host_code;type:varchar(64);comment:使用的设备序列号;NOT NULL" json:"host_code"` + Openid string `gorm:"column:openid;type:varchar(128);comment:使用用户的id;NOT NULL" json:"openid"` + UseTime string `gorm:"column:use_time;type:varchar(64);comment:使用的时间;NOT NULL" json:"use_time"` + SecondUseTime string `gorm:"column:second_use_time;type:varchar(64);comment:第二次使用的时间,与第一次不能超过半小时" json:"second_use_time"` + Voltage string `gorm:"column:voltage;type:varchar(64);comment:电压;NOT NULL" json:"voltage"` + ElectricCurrent string `gorm:"column:electric_current;type:varchar(64);comment:电流;NOT NULL" json:"electric_current"` + GearPosition string `gorm:"column:gear_position;type:varchar(64);comment:档位;NOT NULL" json:"gear_position"` + Efficiency string `gorm:"column:efficiency;type:varchar(64);comment:效率;NOT NULL" json:"efficiency"` + Resistance string `gorm:"column:resistance;type:varchar(64);comment:阻值;NOT NULL" json:"resistance"` + Score string `gorm:"column:score;type:varchar(64);comment:评分;NOT NULL" json:"score"` + ProduceTime string `gorm:"column:produce_time;type:varchar(64);comment:生产日期;NOT NULL" json:"produce_time"` + QualityGuaranteePeriod int64 `gorm:"column:quality_guarantee_period;type:int(11);default:36;comment:保质期月份;NOT NULL" json:"quality_guarantee_period"` + IsUse int64 `gorm:"column:is_use;type:tinyint(1);default:2;comment:1是已使用;NOT NULL" json:"is_use"` + IsOnTrial int32 `gorm:"column:is_on_trial;type:tinyint(1);default:2;comment:1是试用 2是正常;NOT NULL" json:"is_on_trial"` + IsOnline int32 `gorm:"column:is_online;type:tinyint(1);comment:是否为线上,1为线上,2为线下" json:"is_online"` + StoreId int32 `gorm:"column:store_id;type:int(11);default:0;comment:门店ID;NOT NULL" json:"store_id"` + WorkerGroupId int64 `gorm:"column:worker_group_id;type:int(11);default:0;comment:组ID" json:"worker_group_id"` + ModelId int64 `gorm:"column:model_id;type:int(11);default:0" json:"model_id"` + Model string `gorm:"column:model;type:varchar(64);comment:面膜型号;NOT NULL" json:"model"` + Effect int64 `gorm:"column:effect;type:tinyint(4);comment:效果0=智能,1=美白,2=淡斑,3=抗衰,4=祛痘" json:"effect"` + UseScenario int32 `gorm:"column:use_scenario;type:tinyint(1);comment:使用场景,0为院线,1为家用" json:"use_scenario"` + IsStore int32 `gorm:"column:is_store;type:tinyint(1);default:1;comment:是否为门店产品,1为门店线下,2为线上" json:"is_store"` + Batch string `gorm:"column:batch;type:varchar(64);comment:批次;NOT NULL" json:"batch"` + AddType int32 `gorm:"column:add_type;type:tinyint(1);default:1;comment:添加方式:1为系统录入,2为异常录入" json:"add_type"` + Status int32 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为删除" json:"status"` +} + +type MaskCreate struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + FacialMaskId string `gorm:"column:facial_mask_id;type:varchar(64);comment:面膜id;NOT NULL" json:"facial_mask_id"` + ProduceTime string `gorm:"column:produce_time;type:varchar(64);comment:生产日期;NOT NULL" json:"produce_time"` + QualityGuaranteePeriod int64 `gorm:"column:quality_guarantee_period;type:int(11);default:36;comment:保质期月份;NOT NULL" json:"quality_guarantee_period"` + IsOnTrial int32 `gorm:"column:is_on_trial;type:tinyint(1);default:2;comment:1是试用 2是正常;NOT NULL" json:"is_on_trial"` + IsOnline int32 `gorm:"column:is_online;type:tinyint(1);comment:是否为线上,1为线上,2为线下" json:"is_online"` + WorkerGroupId int64 `gorm:"column:worker_group_id;type:int(11);default:0;comment:组ID" json:"worker_group_id"` + ModelId int64 `gorm:"column:model_id;type:int(11);default:0" json:"model_id"` + Effect int32 `gorm:"column:effect;type:tinyint(4);comment:效果0=智能,1=美白,2=淡斑,3=抗衰,4=祛痘" json:"effect"` + Model string `gorm:"column:model;type:varchar(64);comment:面膜型号;NOT NULL" json:"model"` + IsStore int32 `gorm:"column:is_store;type:tinyint(1);default:1;comment:是否为门店产品,1为门店线下,2为线上" json:"is_store"` + UseScenario int32 `gorm:"column:use_scenario;type:tinyint(1);comment:使用场景,0为院线,1为家用" json:"use_scenario"` + Batch string `gorm:"column:batch;type:varchar(64);comment:批次;NOT NULL" json:"batch"` +} + +type MaskStatus struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + Status int32 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为正常,2为删除" json:"status"` +} + +type MaskAddInfo struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + FacialMaskId string `gorm:"column:facial_mask_id;type:varchar(64);comment:面膜id;NOT NULL" json:"facial_mask_id"` + IsOnTrial int32 `gorm:"column:is_on_trial;type:tinyint(1);default:2;comment:1是试用 2是正常;NOT NULL" json:"is_on_trial"` + IsOnline int32 `gorm:"column:is_online;type:tinyint(1);comment:是否为线上,1为线上,2为线下" json:"is_online"` + Effect int32 `gorm:"column:effect;type:tinyint(4);comment:效果0=智能,1=美白,2=淡斑,3=抗衰,4=祛痘" json:"effect"` + Model string `gorm:"column:model;type:varchar(64);comment:面膜型号;NOT NULL" json:"model"` + IsStore int32 `gorm:"column:is_store;type:tinyint(1);default:1;comment:是否为门店产品,1为门店线下,2为线上" json:"is_store"` + UseScenario int32 `gorm:"column:use_scenario;type:tinyint(1);comment:使用场景,0为院线,1为家用" json:"use_scenario"` + Batch string `gorm:"column:batch;type:varchar(64);comment:批次;NOT NULL" json:"batch"` + CreatedAt utils.CustomTime `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"created_at"` +} + +type MaskUseInfo struct { + Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` + FacialMaskId string `gorm:"column:facial_mask_id;type:varchar(64);comment:面膜id;NOT NULL" json:"facial_mask_id"` + IsOnTrial int32 `gorm:"column:is_on_trial;type:tinyint(1);default:2;comment:1是试用 2是正常;NOT NULL" json:"is_on_trial"` + HostCode string `gorm:"column:host_code;type:varchar(64);comment:使用的设备序列号;NOT NULL" json:"host_code"` + Openid string `gorm:"column:openid;type:varchar(128);comment:使用用户的id;NOT NULL" json:"openid"` + UserId int64 `json:"user_id" gorm:"user_id"` // 使用的用户ID + UseTime string `gorm:"column:use_time;type:varchar(64);comment:使用的时间;NOT NULL" json:"use_time"` + SecondUseTime string `gorm:"column:second_use_time;type:varchar(64);comment:第二次使用的时间,与第一次不能超过半小时" json:"second_use_time"` + Voltage string `gorm:"column:voltage;type:varchar(64);comment:电压;NOT NULL" json:"voltage"` + ElectricCurrent string `gorm:"column:electric_current;type:varchar(64);comment:电流;NOT NULL" json:"electric_current"` + GearPosition string `gorm:"column:gear_position;type:varchar(64);comment:档位;NOT NULL" json:"gear_position"` + Efficiency string `gorm:"column:efficiency;type:varchar(64);comment:效率;NOT NULL" json:"efficiency"` + Resistance string `gorm:"column:resistance;type:varchar(64);comment:阻值;NOT NULL" json:"resistance"` + Score string `gorm:"column:score;type:varchar(64);comment:评分;NOT NULL" json:"score"` + IsUse int32 `gorm:"column:is_use;type:tinyint(1);default:2;comment:1是已使用;NOT NULL" json:"is_use"` + StoreId int64 `gorm:"column:store_id;type:int(11);default:0;comment:门店ID;NOT NULL" json:"store_id"` + IsStore int32 `gorm:"column:is_store;type:tinyint(1);default:1;comment:是否为门店产品,1为门店线下,2为线上" json:"is_store"` +} + +type MaskUsedInfo struct { + FacialMaskId string `gorm:"column:facial_mask_id;type:varchar(64);comment:面膜id;NOT NULL" json:"facial_mask_id"` + UseTime string `gorm:"column:use_time;type:varchar(64);comment:使用的时间;NOT NULL" json:"use_time"` + SecondUseTime string `gorm:"column:second_use_time;type:varchar(64);comment:第二次使用的时间,与第一次不能超过半小时" json:"second_use_time"` +} diff --git a/services/equipment/internal/logic/beansItemsLogic.go b/services/equipment/internal/logic/beansItemsLogic.go new file mode 100644 index 0000000..972a8e3 --- /dev/null +++ b/services/equipment/internal/logic/beansItemsLogic.go @@ -0,0 +1,59 @@ +package logic + +import ( + "context" + "fmt" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/rpc/equipment/pb" + "lone-services/services/equipment/internal/dao" + "lone-services/services/equipment/internal/model" + "lone-services/services/equipment/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type BeansItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewBeansItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BeansItemsLogic { + return &BeansItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *BeansItemsLogic) BeansItems(in *equipment.BeansItemsRequest) (*equipment.Response, error) { + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + var info []dao.BeansInfo + w := modelbase.Params{ + Size: int(in.Size), + Order: "id DESC", + Page: int(in.Page), + } + + if len(in.Time) > utils.NumberOne { + w.Between = map[string][2]string{"created_at": { + in.Time[utils.NumberZero], in.Time[utils.NumberOne]}} + } + if in.Name != utils.StringEmpty { + key := fmt.Sprintf("(user_name LIKE '%s' OR user_nick_name LIKE ?)", "%%"+in.Name+"%%") + w.Other = map[string]string{key: "%%" + in.Name + "%%"} + } + + items, err := model.BeansModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + return l.ok(items) +} diff --git a/services/equipment/internal/logic/bindExpiryLogic.go b/services/equipment/internal/logic/bindExpiryLogic.go new file mode 100644 index 0000000..2d0dca8 --- /dev/null +++ b/services/equipment/internal/logic/bindExpiryLogic.go @@ -0,0 +1,71 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/equipment/internal/dao" + "lone-services/services/equipment/internal/model" + "lone-services/services/equipment/validator" + "strconv" + + "lone-services/rpc/equipment/pb" + "lone-services/services/equipment/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type BindExpiryLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewBindExpiryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BindExpiryLogic { + return &BindExpiryLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *BindExpiryLogic) BindExpiry(in *equipment.BindExpiryRequest) (*equipment.Response, error) { + var v validator.BindSetExpiryValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + w := modelbase.Params{ + Eq: map[string]string{ + "id": strconv.FormatInt(in.Id, utils.NumberTen), + }, + } + + var info dao.BindExpiry + err := model.BindModel{}.Init().GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if info.Id < utils.NumberOne { + return l.fail(utils.SetError(utils.Fail, "没有找到数据")) + } + + info.ExpiryTime = in.Expiry + info.AdminId = in.Id + info.AdminName = adminInfo.Name + info.Reason = in.Reason + _, err = model.BindModel{}.Init().Edit(w, &info) + + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + return l.ok(utils.NumberOne) +} diff --git a/services/equipment/internal/logic/maskItemsLogic.go b/services/equipment/internal/logic/maskItemsLogic.go new file mode 100644 index 0000000..9641866 --- /dev/null +++ b/services/equipment/internal/logic/maskItemsLogic.go @@ -0,0 +1,88 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/rpc/equipment/pb" + "lone-services/services/equipment/internal/dao" + "lone-services/services/equipment/internal/model" + "lone-services/services/equipment/internal/svc" + "strconv" + + "github.com/zeromicro/go-zero/core/logx" +) + +type MaskItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewMaskItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MaskItemsLogic { + return &MaskItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *MaskItemsLogic) MaskItems(in *equipment.MaskItemsRequest) (*equipment.Response, error) { + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + var info []dao.MaskAddInfo + w := modelbase.Params{ + Size: int(in.Size), + Order: "id desc", + Page: int(in.Page), + } + w.Eq = make(map[string]string) + if in.FacialMaskId != utils.StringEmpty { + w.Eq["facial_mask_id"] = in.FacialMaskId + } + if in.Batch != utils.StringEmpty { + w.Eq["batch"] = in.Batch + } + if in.Model >= utils.NumberZero { + mm := "MM" + if in.Model == utils.NumberOne { + mm = "YT" + } + w.Eq["model"] = mm + } + if in.IsStore >= utils.NumberZero { + w.Eq["is_store"] = strconv.Itoa(int(in.IsStore)) + } + if in.IsOnTrial >= utils.NumberZero { + w.Eq["is_on_trial"] = strconv.Itoa(int(in.IsOnTrial)) + } + if in.UseScenario >= utils.NumberZero { + w.Eq["use_scenario"] = strconv.Itoa(int(in.UseScenario)) + } + if in.Effect >= utils.NumberZero { + w.Eq["effect"] = strconv.Itoa(int(in.Effect)) + } + + if in.IsUse >= utils.NumberZero { + w.Eq["is_use"] = strconv.Itoa(int(in.IsUse)) + } + + if in.WorkerGroupId >= utils.NumberZero { + w.Eq["worker_group_id"] = strconv.Itoa(int(in.WorkerGroupId)) + } + + if len(in.Time) > utils.NumberOne { + w.Between = map[string][2]string{"created_at": { + in.Time[utils.NumberZero], in.Time[utils.NumberOne]}} + } + items, err := model.MaskModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + return l.ok(items) +} diff --git a/services/equipment/internal/model/beans.go b/services/equipment/internal/model/beans.go new file mode 100644 index 0000000..580723e --- /dev/null +++ b/services/equipment/internal/model/beans.go @@ -0,0 +1,23 @@ +package model + +import ( + "lone-services/pkg/modelbase" + "lone-services/services/equipment/internal/dao" +) + +type BeansModel struct { + modelbase.Base +} + +func (m BeansModel) TableName() string { + return modelbase.Prefix() + "beans" +} + +func (m BeansModel) Init() BeansModel { + m.Table = m.TableName() + return m +} + +func (m BeansModel) Create(data *dao.BeansCreate) error { + return m.Base.Create(data) +} diff --git a/services/equipment/internal/model/bind.go b/services/equipment/internal/model/bind.go new file mode 100644 index 0000000..db55d5a --- /dev/null +++ b/services/equipment/internal/model/bind.go @@ -0,0 +1,23 @@ +package model + +import ( + "lone-services/pkg/modelbase" + "lone-services/services/equipment/internal/dao" +) + +type BindModel struct { + modelbase.Base +} + +func (m BindModel) TableName() string { + return modelbase.Prefix() + "bind" +} + +func (m BindModel) Init() BindModel { + m.Table = m.TableName() + return m +} + +func (m BindModel) Create(data *dao.BindCreate) error { + return m.Base.Create(data) +} diff --git a/services/equipment/internal/model/bindHistory.go b/services/equipment/internal/model/bindHistory.go new file mode 100644 index 0000000..35557bb --- /dev/null +++ b/services/equipment/internal/model/bindHistory.go @@ -0,0 +1,23 @@ +package model + +import ( + "lone-services/pkg/modelbase" + "lone-services/services/equipment/internal/dao" +) + +type BindHistoryModel struct { + modelbase.Base +} + +func (m BindHistoryModel) TableName() string { + return modelbase.Prefix() + "bind_history" +} + +func (m BindHistoryModel) Init() BindHistoryModel { + m.Table = m.TableName() + return m +} + +func (m BindHistoryModel) Create(data *dao.BindHistoryCreate) error { + return m.Base.Create(data) +} diff --git a/services/equipment/internal/model/mask.go b/services/equipment/internal/model/mask.go new file mode 100644 index 0000000..2abeb9e --- /dev/null +++ b/services/equipment/internal/model/mask.go @@ -0,0 +1,23 @@ +package model + +import ( + "lone-services/pkg/modelbase" + "lone-services/services/equipment/internal/dao" +) + +type MaskModel struct { + modelbase.Base +} + +func (m MaskModel) TableName() string { + return modelbase.Prefix() + "version" +} + +func (m MaskModel) Init() MaskModel { + m.Table = m.TableName() + return m +} + +func (m MaskModel) Create(data *dao.MaskCreate) error { + return m.Base.Create(data) +} diff --git a/services/equipment/internal/server/equipmentServer.go b/services/equipment/internal/server/equipmentServer.go index 17b7209..d813a5d 100644 --- a/services/equipment/internal/server/equipmentServer.go +++ b/services/equipment/internal/server/equipmentServer.go @@ -47,3 +47,84 @@ func (s *EquipmentServer) Status(ctx context.Context, in *equipment.StatusReques l := logic.NewStatusLogic(ctx, s.svcCtx) return l.Status(in) } + +func (s *EquipmentServer) MaskItems(ctx context.Context, in *equipment.MaskItemsRequest) (*equipment.Response, error) { + l := logic.NewMaskItemsLogic(ctx, s.svcCtx) + return l.MaskItems(in) +} + +func (s *EquipmentServer) BeansItems(ctx context.Context, in *equipment.BeansItemsRequest) (*equipment.Response, error) { + l := logic.NewBeansItemsLogic(ctx, s.svcCtx) + return l.BeansItems(in) +} + +func (s *EquipmentServer) BindExpiry(ctx context.Context, in *equipment.BindExpiryRequest) (*equipment.Response, error) { + l := logic.NewBindExpiryLogic(ctx, s.svcCtx) + return l.BindExpiry(in) +} + +// API +func (s *EquipmentServer) ApiMaskAdd(ctx context.Context, in *equipment.ApiMaskAddRequest) (*equipment.Response, error) { + l := logic.NewApiMaskAddLogic(ctx, s.svcCtx) + return l.ApiMaskAdd(in) +} + +func (s *EquipmentServer) ApiBindItems(ctx context.Context, in *equipment.EmptyRequest) (*equipment.Response, error) { + l := logic.NewApiBindItemsLogic(ctx, s.svcCtx) + return l.ApiBindItems(in) +} + +func (s *EquipmentServer) ApiUnBind(ctx context.Context, in *equipment.ApiUnBindRequest) (*equipment.Response, error) { + l := logic.NewApiUnBindLogic(ctx, s.svcCtx) + return l.ApiUnBind(in) +} + +func (s *EquipmentServer) ApiBindAdd(ctx context.Context, in *equipment.ApiBindAddRequest) (*equipment.Response, error) { + l := logic.NewApiBindAddLogic(ctx, s.svcCtx) + return l.ApiBindAdd(in) +} + +func (s *EquipmentServer) ApiBindExpiry(ctx context.Context, in *equipment.ApiBindExpiryRequest) (*equipment.Response, error) { + l := logic.NewApiBindExpiryLogic(ctx, s.svcCtx) + return l.ApiBindExpiry(in) +} + +func (s *EquipmentServer) ApiBindExpiryGet(ctx context.Context, in *equipment.ApiBindExpiryGetRequest) (*equipment.Response, error) { + l := logic.NewApiBindExpiryGetLogic(ctx, s.svcCtx) + return l.ApiBindExpiryGet(in) +} + +func (s *EquipmentServer) ApiBeansAdd(ctx context.Context, in *equipment.ApiBeansAddRequest) (*equipment.Response, error) { + l := logic.NewApiBeansAddLogic(ctx, s.svcCtx) + return l.ApiBeansAdd(in) +} + +func (s *EquipmentServer) ApiBeansLast(ctx context.Context, in *equipment.EmptyRequest) (*equipment.Response, error) { + l := logic.NewApiBeansLastLogic(ctx, s.svcCtx) + return l.ApiBeansLast(in) +} + +func (s *EquipmentServer) ApiBeansItems(ctx context.Context, in *equipment.ApiBeansItemsRequest) (*equipment.Response, error) { + l := logic.NewApiBeansItemsLogic(ctx, s.svcCtx) + return l.ApiBeansItems(in) +} + +func (s *EquipmentServer) ApiMaskUse(ctx context.Context, in *equipment.ApiMaskUseRequest) (*equipment.Response, error) { + l := logic.NewApiMaskUseLogic(ctx, s.svcCtx) + return l.ApiMaskUse(in) +} + +func (s *EquipmentServer) ApiMaskUsedItems(ctx context.Context, in *equipment.ApiMaskUsedItemsRequest) (*equipment.Response, error) { + l := logic.NewApiMaskUsedItemsLogic(ctx, s.svcCtx) + return l.ApiMaskUsedItems(in) +} + +func (s *EquipmentServer) ApiMaskStoreUse(ctx context.Context, in *equipment.ApiMaskUseRequest) (*equipment.Response, error) { + l := logic.NewApiMaskStoreUseLogic(ctx, s.svcCtx) + return l.ApiMaskStoreUse(in) +} + +func (s *EquipmentServer) ApiMaskStoreUseItems(ctx context.Context, in *equipment.ApiMaskUsedItemsRequest) (*equipment.Response, error) { + l := logic.NewApiMaskStoreUseItemsLogic(ctx, s.svcCtx) + return l.ApiMaskStoreUseItems(in) +} diff --git a/services/equipment/validator/beans.go b/services/equipment/validator/beans.go new file mode 100644 index 0000000..75a5e0e --- /dev/null +++ b/services/equipment/validator/beans.go @@ -0,0 +1,35 @@ +package validator + +import "lone-services/pkg/validate" + +type BeansItemsValidator struct { + Page int `form:"page" json:"page"` + Size int `form:"size" json:"size"` +} + +// GetMessage 提示消息 +func (p BeansItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} + +type BeansImagesValidator struct { + Image string `form:"image" json:"image" validate:"required"` + Id int `form:"id" json:"id"` +} + +// GetMessage 提示消息 +func (p BeansImagesValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "Image.required": "图片不能为空", + } +} + +type BeansImagesItemsValidator struct { + Page int `form:"page" json:"page"` + Size int `form:"size" json:"size"` +} + +// GetMessage 提示消息 +func (p BeansImagesItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} diff --git a/services/equipment/validator/bind.go b/services/equipment/validator/bind.go new file mode 100644 index 0000000..a81233c --- /dev/null +++ b/services/equipment/validator/bind.go @@ -0,0 +1,80 @@ +package validator + +import "lone-services/pkg/validate" + +type BindItemsValidator struct { + Page int `form:"page" json:"page"` + Size int `form:"size" json:"size"` + Status uint8 `form:"status" json:"status"` + NickName string `form:"nick_name" json:"nick_name"` + Code string `form:"code" json:"code"` + Time []string `form:"time" json:"time"` +} + +// GetMessage 提示消息 +func (p BindItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} + +type BindSetExpiryValidator struct { + Id int `form:"id" json:"id" validate:"required"` + Expiry string `form:"expiry" json:"expiry"` + Reason string `form:"reason" json:"reason" validate:"required"` +} + +// GetMessage 提示消息 +func (p BindSetExpiryValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + validate.FieldId: validate.FieldIdValue, + "Reason.required": "理由不能为空", + } +} + +type BindValidator struct { + HostNickname string `form:"host_nickname" json:"host_nickname" validate:"required"` + HostCode string `form:"host_code" json:"host_code" validate:"required"` +} + +// GetMessage 提示消息 +func (p BindValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "HostNickname.required": "缺少设备名称", + "HostCode.required": "缺少设备编码", + } +} + +type BindUnbindValidator struct { + HostCode string `form:"host_code" json:"host_code" validate:"required"` +} + +// GetMessage 提示消息 +func (p BindUnbindValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "HostCode.required": "缺少设备编码", + } +} + +type BindExpiryValidator struct { + HostCode string `form:"host_code" json:"host_code" binding:"required"` + Type uint8 `form:"type" json:"type" binding:"required,oneof=1 2"` +} + +// GetMessage 提示消息 +func (p BindExpiryValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "HostCode.required": "缺少设备编码", + "Type.required": "缺少设备类型", + "Type.oneof": "设备类型错误", + } +} + +type BindGetExpiryValidator struct { + HostCode string `form:"host_code" json:"host_code" binding:"required"` +} + +// GetMessage 提示消息 +func (p BindGetExpiryValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "HostCode.required": "缺少设备编码", + } +} diff --git a/services/equipment/validator/mask.go b/services/equipment/validator/mask.go new file mode 100644 index 0000000..a387a27 --- /dev/null +++ b/services/equipment/validator/mask.go @@ -0,0 +1,88 @@ +package validator + +import "lone-services/pkg/validate" + +type FacialItemsValidator struct { + Page int `form:"page" json:"page"` + Size int `form:"size" json:"size"` + FacialMaskId string `form:"facial_mask_id" json:"facial_mask_id"` + IsOnTrial int8 `form:"is_on_trial" json:"is_on_trial"` + Model int8 `form:"model" json:"model"` + WorkerGroupId int `form:"worker_group_id" json:"worker_group_id"` + Batch string `form:"batch" json:"batch"` + IsStore int8 `form:"is_store" json:"is_store"` + UseScenario int8 `form:"use_scenario" json:"use_scenario"` + Effect int8 `form:"effect" json:"effect"` + Time string `form:"time" json:"time"` + IsUse int8 `form:"is_use" json:"is_use"` +} + +// GetMessage 提示消息 +func (p FacialItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} + +type MaskUseValidator struct { + FacialMaskId string `form:"facial_mask_id" json:"facial_mask_id" validate:"required"` + UseTime string `form:"use_time" json:"use_time" validate:"required"` + HostCode string `form:"host_code" json:"host_code" validate:"required"` + OpenId string `form:"openid" json:"openid"` + GearPosition string `form:"gear_position" json:"gear_position"` + Voltage string `form:"voltage" json:"voltage"` + ElectricCurrent string `form:"electric_current" json:"electric_current"` + Efficiency string `form:"efficiency" json:"efficiency"` + Resistance string `form:"resistance" json:"resistance"` + Score string `form:"score" json:"score"` + StoreId int `form:"store_id" json:"store_id"` +} + +// GetMessage 提示消息 +func (p MaskUseValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "FacialMaskId.required": "面膜ID不能为空", + "UseTime.required": "使用时间能为空", + "HostCode.required": "使用设备不能为空", + } +} + +type MaskUsedItemsValidator struct { + OpenId string `form:"openid" json:"openid"` + FacialMaskId string `form:"facial_mask_id" json:"facial_mask_id"` + UseTime string `form:"use_time" json:"use_time"` + HostCode string `form:"host_code" json:"host_code"` +} + +// GetMessage 提示消息 +func (p MaskUsedItemsValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{} +} + +type MaskAddValidator struct { + OpenId string `form:"openid" json:"openid"` + FacialMaskId string `form:"facial_mask_id" json:"facial_mask_id" validate:"required"` + ProduceTime string `form:"produce_time" json:"produce_time" validate:"required"` + QualityGuaranteePeriod string `form:"quality_guarantee_period" json:"quality_guarantee_period" validate:"required"` + IsOnTrial string `form:"is_on_trial" json:"is_on_trial" validate:"required"` + Model string `form:"model" json:"model" validate:"required"` + Batch string `form:"batch" json:"batch" validate:"required"` + IsStore string `form:"is_store" json:"is_store" validate:"required"` + IsOnline string `form:"is_online" json:"is_online"` + Auto string `form:"auto" json:"auto"` + ModelId string `form:"model_id" json:"model_id"` + UseScenario string `form:"use_scenario" json:"use_scenario"` + Effect string `form:"effect" json:"effect"` + WorkerGroupId string `form:"worker_group_id" json:"worker_group_id"` +} + +// GetMessage 返回校验提示信息 +func (p MaskAddValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + "FacialMaskId.required": "缺少ID", + "ProduceTime.required": "缺少生产日期", + "QualityGuaranteePeriod.required": "缺少保质期月份", + "IsOnTrial.required": "缺少是否试用", + "Model.required": "缺少面膜型号", + "Batch.required": "缺少批次", + "IsStore.required": "缺少渠道", + } +} diff --git a/services/factory/internal/logic/groupItemsLogic.go b/services/factory/internal/logic/groupItemsLogic.go index f596851..e1da6f4 100644 --- a/services/factory/internal/logic/groupItemsLogic.go +++ b/services/factory/internal/logic/groupItemsLogic.go @@ -37,7 +37,7 @@ func (l *GroupItemsLogic) GroupItems(in *factory.GroupItemsRequest) (*factory.Re if adminInfo.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) } - + var info []dao.GroupInfo w := modelbase.Params{ Page: int(in.Page), diff --git a/services/order/internal/logic/base.go b/services/order/internal/logic/base.go index 82a0c0a..081eda2 100644 --- a/services/order/internal/logic/base.go +++ b/services/order/internal/logic/base.go @@ -1,10 +1,12 @@ package logic import ( + "lone-services/pkg/modelbase" "lone-services/pkg/utils" "lone-services/pkg/validate" order "lone-services/rpc/order/pb" "reflect" + "strconv" jsoniter "github.com/json-iterator/go" ) @@ -46,3 +48,29 @@ func (l *BaseLogic) ok(data any) (*order.Response, error) { buf, _ := jsoniter.Marshal(data) return &order.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg, Data: string(buf)}, nil } + +func (s BaseLogic) SetWhere(w *modelbase.Params, u utils.UserInfo) { + if u.Type == utils.SaleType { + s.SetGroupWhere(w, u, false) + } +} + +func (s BaseLogic) SetGroupWhere(w *modelbase.Params, u utils.UserInfo, checkProvince bool) { + if w.Eq == nil { + w.Eq = make(map[string]string) + } + if u.GroupId < utils.NumberOne { + return + } + + //如果是公司销售 + if u.Type == utils.SaleType { + w.Eq["group_id"] = strconv.Itoa(int(u.GroupId)) + } else if u.SaleProvince > utils.NumberZero { + if checkProvince { + w.Eq["sale_province"] = strconv.Itoa(int(u.SaleProvince)) + } else { + w.Eq["group_id"] = strconv.Itoa(int(u.GroupId)) + } + } +} diff --git a/services/order/internal/logic/itemsLogic.go b/services/order/internal/logic/itemsLogic.go index b46a5e9..044583d 100644 --- a/services/order/internal/logic/itemsLogic.go +++ b/services/order/internal/logic/itemsLogic.go @@ -81,6 +81,8 @@ func (l *ItemsLogic) Items(in *order.OrderItemsRequest) (*order.Response, error) w.Other["create_time < ?"] = strconv.Itoa(int(in.Time[utils.NumberOne])) } + l.SetWhere(&w, adminInfo) + items, err := model.OrderModel{}.Init().Page(w, &info) if err != nil { l.Logger.Error(err) diff --git a/services/sale/run.toml b/services/sale/run.toml index 6f83ec6..26ee240 100644 --- a/services/sale/run.toml +++ b/services/sale/run.toml @@ -2,7 +2,7 @@ login_out_time=43200 #api接口超时时间分 login_refresh_out_time=83200 name = "sale-service" - listenOn = "0.0.0.0:10300" + listenOn = "0.0.0.0:10700" mode = "dev" [log] path = "logs" @@ -53,7 +53,5 @@ [encrypt] data_key = "u2t9T3luZtoRfhBstkFN6TiIMW38BA8a" - [services] - chore = "chore-service" - user = "user-service" \ No newline at end of file + chore = "chore-service" \ No newline at end of file diff --git a/services/store/internal/dao/salesPersonHistory.go b/services/store/internal/dao/salesPersonHistory.go index c72fb07..ebd8af8 100644 --- a/services/store/internal/dao/salesPersonHistory.go +++ b/services/store/internal/dao/salesPersonHistory.go @@ -2,17 +2,17 @@ package dao import "lone-services/pkg/utils" -type SalesPersonHistoryCreate struct { - Id int64 `json:"id" gorm:"id"` - StoreId int64 `json:"store_id" gorm:"store_id"` // 门店ID - SalesPersonId int64 `json:"sales_person_id" gorm:"sales_person_id"` // 关联销售员的id - AdminId int64 `json:"admin_id" gorm:"admin_id"` // 修改人,0 为系统 +type SaleChangeHistoryCreate struct { + Id int64 `json:"id" gorm:"id"` + StoreId int64 `json:"store_id" gorm:"store_id"` // 门店ID + SaleId int64 `json:"sale_id" gorm:"sale_id"` // 关联销售员的id + AdminId int64 `json:"admin_id" gorm:"admin_id"` // 修改人,0 为系统 } -type SalesPersonHistoryInfo struct { - Id int64 `json:"id" gorm:"id"` - StoreId int64 `json:"store_id" gorm:"store_id"` // 门店ID - SalesPersonId int64 `json:"sales_person_id" gorm:"sales_person_id"` // 关联销售员的id - AdminId int64 `json:"admin_id" gorm:"admin_id"` // 修改人,0 为系统 - CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:添加时间" json:"create_time"` +type SaleChangeHistoryInfo struct { + Id int64 `json:"id" gorm:"id"` + StoreId int64 `json:"store_id" gorm:"store_id"` // 门店ID + SaleId int64 `json:"sale_id" gorm:"sale_id"` // 关联销售员的id + AdminId int64 `json:"admin_id" gorm:"admin_id"` // 修改人,0 为系统 + CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:添加时间" json:"create_time"` } diff --git a/services/store/internal/dao/store.go b/services/store/internal/dao/store.go index d88f117..0c7a7c0 100644 --- a/services/store/internal/dao/store.go +++ b/services/store/internal/dao/store.go @@ -2,6 +2,18 @@ package dao import "lone-services/pkg/utils" +const ( + StoreApplyReview = 1 // 提交审核(按钮消息) + StoreNeedReview = 2 // 通知申请人 + StoreSubmitReview = 3 // 通知一审人员 + StoreFirstReview = 4 // 一审审核结果 + StoreSecondReview = 5 // 二审审核结果 + + LoginTypePassword = "password" + LoginTypeSms = "sms" + UserTypeName = "store" +) + type StoreCreate struct { Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` Name string `gorm:"column:name;type:varchar(256);comment:门店名;NOT NULL" json:"name"` @@ -26,7 +38,7 @@ type StoreCreate struct { OpenTime string `gorm:"column:open_time;type:varchar(100);comment:营业时间" json:"open_time"` Province int64 `gorm:"column:province;type:int(11);default:0" json:"province"` ProvinceName string `gorm:"column:province_name;type:varchar(255)" json:"province_name"` - StoreType int64 `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 + StoreType string `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 City int64 `json:"city" gorm:"city"` CityName string `json:"city_name" gorm:"city_name"` County int64 `json:"county" gorm:"county"` @@ -45,7 +57,7 @@ type StoreInfo struct { UserName string `gorm:"column:user_name;type:varchar(128);comment:负责人姓名;NOT NULL" json:"user_name"` UserMobile string `gorm:"column:user_mobile;type:varchar(128);comment:负责人手机号,也是登录账号;NOT NULL" json:"user_mobile"` BusinessLicense string `gorm:"column:business_license;type:varchar(512);comment:营业执照;NOT NULL" json:"business_license"` - StoreType int64 `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 + StoreType string `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 Amount float64 `gorm:"column:amount;type:decimal(10,2);default:0.00;comment:余额" json:"amount"` District string `gorm:"column:district;type:varchar(255);comment:地区(省,市,县)ID" json:"district"` IdCard string `gorm:"column:id_card;type:varchar(255);comment:身份证正反面" json:"id_card"` @@ -95,7 +107,7 @@ type StoreWebInfo struct { BusinessLicense string `gorm:"column:business_license;type:varchar(512);comment:营业执照;NOT NULL" json:"business_license"` District string `gorm:"column:district;type:varchar(255);comment:地区(省,市,县)ID" json:"district"` Address string `gorm:"column:address;type:varchar(512);comment:地址" json:"address"` - StoreType int64 `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 + StoreType string `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 BankInfo string `gorm:"column:bank_info;type:varchar(255);comment:银行卡信息" json:"bank_info"` Status int32 `gorm:"column:status;type:tinyint(1);default:9;comment:状态9是待审核 1是已通过 2是未通过,3为禁用" json:"status"` SourceType int32 `gorm:"column:source_type;type:tinyint(1);default:1;comment:来源类型,1为公司添加,2为销售添加" json:"source_type"` @@ -151,6 +163,7 @@ type StoreVerifyEdit struct { type StoreStatus struct { Id int64 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` Name string `gorm:"column:name;type:varchar(256);comment:姓名或公司名;NOT NULL" json:"name"` + UserName string `gorm:"column:user_name;type:varchar(128);comment:负责人姓名;NOT NULL" json:"user_name"` SaleId int64 `gorm:"column:sale_id;type:int(11);default:0;comment:父级销售;NOT NULL" json:"sale_id"` UserMobile string `gorm:"column:user_mobile;type:varchar(128);comment:负责人手机号,也是登录账号;NOT NULL" json:"user_mobile"` NewContent string `gorm:"column:new_content;type:text;comment:修改的内容" json:"new_content"` @@ -225,11 +238,15 @@ type StoreNewCreate struct { SaleId int64 `gorm:"column:sale_id;type:varchar(256);comment:关联销售员的id" json:"sale_id"` Province int64 `gorm:"column:province;type:int(11);default:0" json:"province"` ProvinceName string `gorm:"column:province_name;type:varchar(255)" json:"province_name"` + City int64 `json:"city" gorm:"city"` + CityName string `json:"city_name" gorm:"city_name"` + County int64 `json:"county" gorm:"county"` + CountyName string `json:"county_name" gorm:"county_name"` SourceType int32 `gorm:"column:source_type;type:tinyint(1);default:1;comment:来源类型,1为公司添加,2为销售添加" json:"source_type"` Images string `gorm:"column:images;type:varchar(255);comment:门店门头照片" json:"images"` StoreImages string `gorm:"column:store_images;type:text;comment:店内照片" json:"store_images"` Contact string `gorm:"column:contact;type:varchar(255);comment:联系方式,多个,号分割" json:"contact"` - StoreType int64 `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 + StoreType string `json:"store_type" gorm:"store_type"` // 门店类型,1为面膜,2为门店,3为制氧机,4为软水机,5智能化妆盒 Content string `gorm:"column:content;type:text" json:"content"` NewContent string `gorm:"column:new_content;type:text;comment:修改的内容" json:"new_content"` OpenTime string `gorm:"column:open_time;type:varchar(100);comment:营业时间" json:"open_time"` diff --git a/services/store/internal/logic/applyEditLogic.go b/services/store/internal/logic/applyEditLogic.go index 606e6d7..f1cd0d1 100644 --- a/services/store/internal/logic/applyEditLogic.go +++ b/services/store/internal/logic/applyEditLogic.go @@ -2,9 +2,10 @@ package logic import ( "context" - + "lone-services/pkg/utils" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" + "lone-services/services/store/validator" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +26,27 @@ func NewApplyEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ApplyEd } func (l *ApplyEditLogic) ApplyEdit(in *store.ApplyEditRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.ApplyEditValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } - return &store.Response{}, nil + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + + obj := svc.ApplySvc{} + info, err := obj.GetActionApply(int(adminInfo.ID), int(in.Id)) + if err != utils.Ok { + return l.fail(err) + } + if info.Status == utils.StatusWaitPass || info.Status == utils.StatusDone { + return l.fail(utils.SetError(utils.Fail, "已经申请过")) + } + err = obj.SetActionApply(int(adminInfo.ID), int(in.Id), utils.EditLogTypeStore, in.Reason) + if err != utils.Ok { + return l.fail(err) + } + return l.ok(utils.NumberTen) } diff --git a/services/store/internal/logic/applyVerifyLogic.go b/services/store/internal/logic/applyVerifyLogic.go index 655e93f..9cf4614 100644 --- a/services/store/internal/logic/applyVerifyLogic.go +++ b/services/store/internal/logic/applyVerifyLogic.go @@ -2,10 +2,18 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + sale "lone-services/rpc/sale/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" + "github.com/samber/lo" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +33,100 @@ func NewApplyVerifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Apply } func (l *ApplyVerifyLogic) ApplyVerify(in *store.ItemsRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.StoreVerifyItemsValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } - return &store.Response{}, nil + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + + var info []dao.StoreInfo + w := modelbase.Params{ + Eq: map[string]string{}, + Like: map[string]string{}, + Page: int(v.Page), + Size: int(v.Size), + Order: "id desc", + } + + if v.Status > utils.NumberZero { + w.Eq["status"] = strconv.Itoa(int(v.Status)) + } else { + w.In = map[string][]string{"status": {strconv.Itoa(utils.StatusFail), strconv.Itoa(utils.StatusWaitPass)}} + } + + if v.SaleId > utils.NumberZero { + w.Eq["sale_id"] = strconv.FormatInt(v.SaleId, utils.NumberTen) + } + + if len(v.Name) > utils.NumberZero { + w.Like["name LIKE ? "] = "%%" + v.Name + "%%" + } + + l.SetWhere(&w, adminInfo) + + items, err := model.StoreModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + var saleIds []int64 + for key, v := range info { + mobile, aErr := utils.DecryptPhone(v.UserMobile) + if aErr == nil { + info[key].UserMobile = mobile + } + + credentials, aErr := utils.Crypto{}.AESDecryptECB(v.BusinessLicense) + if aErr == nil { + info[key].BusinessLicense = credentials + } + idCard, aErr := utils.Crypto{}.AESDecryptECB(v.IdCard) + if aErr == nil { + info[key].IdCard = idCard + } + saleIds = append(saleIds, v.SaleId) + } + newSaleIds := lo.Uniq(saleIds) + if len(newSaleIds) > utils.NumberZero { + salesMap := make(map[int64]string) + if len(newSaleIds) > utils.NumberZero { + sales, err := l.getSaleInfo(saleIds) + if err == utils.Ok { + for _, val := range sales.Items { + salesMap[val.Id] = val.Name + } + } + } + + for key, item := range info { + if s, ok := salesMap[item.SaleId]; ok { + info[key].SaleName = s + } + } + } + + items.Items = info + + return l.ok(items) +} + +func (l *ApplyVerifyLogic) getSaleInfo(ids []int64) (*sale.NamesByIdsData, utils.Status) { + cli, err := svc.GetRpcClient(l.svcCtx.SaleName) + if err != nil { + logx.Errorf("get order err: %v", err) + return &sale.NamesByIdsData{}, utils.ErrorInternalServer + } + + client := sale.NewSaleClient(cli.Conn()) + w := sale.NamesByIdsReq{Ids: ids} + info, err := client.NamesByIds(context.Background(), &w) + if err != nil { + logx.Errorf("get order err: %v", err) + return &sale.NamesByIdsData{}, utils.ErrorInternalServer + } + return info, utils.Ok } diff --git a/services/store/internal/logic/applyVerifyStatusLogic.go b/services/store/internal/logic/applyVerifyStatusLogic.go index 2210f3f..4ffc086 100644 --- a/services/store/internal/logic/applyVerifyStatusLogic.go +++ b/services/store/internal/logic/applyVerifyStatusLogic.go @@ -2,9 +2,18 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/pkg/validate" + order "lone-services/rpc/order/pb" + sale "lone-services/rpc/sale/pb" "lone-services/rpc/store/pb" + user "lone-services/rpc/user/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "strconv" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +34,194 @@ func NewApplyVerifyStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *ApplyVerifyStatusLogic) ApplyVerifyStatus(in *store.StatusRequest) (*store.Response, error) { - // todo: add your logic here and delete this line - return &store.Response{}, nil + var v validate.StatusValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + + var info dao.StoreStatus + w := modelbase.Params{ + In: map[string][]string{"status": { + strconv.Itoa(utils.StatusAdminFirstVerify), + strconv.Itoa(utils.StatusAdminSecondVerify)}}, + Eq: map[string]string{"id": strconv.FormatInt(in.Id, utils.NumberTen)}} + modelObj := model.StoreModel{}.Init() + err := modelObj.GetOne(w, &info) + + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Status < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + action := utils.ActionAdd{ + OldContent: info, + Type: utils.LogActionTypeEdit, + ModuleName: utils.LogActionModuleStore, + } + info.Reason = in.Reason + info.AdminId = adminInfo.ID + info.AdminName = adminInfo.Name + + status := utils.StatusOk + if info.Status == utils.StatusAdminFirstVerify { + status = utils.StatusAdminSecondVerify + } + content := "已通过。" + if in.Status != utils.StatusOk { + status = utils.StatusAdminSecondRefuse + content = "未通过。理由为: " + in.Reason + } + + content = "门店 '" + info.Name + "'审核: " + content + if status != utils.StatusOk { + info.Status = int32(status) + info.AdminId = adminInfo.ID + info.AdminName = adminInfo.Name + info.Reason = in.Reason + _, err = modelObj.Edit(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + svc.WeCom(in.Status, utils.StoreFirstReview, info.Id, info.Reason) + action.NewContent = info + utils.SetActionLog(adminInfo, action) + return l.ok(utils.NumberOne) + } + + modelObj.Begin() + if status == utils.StatusOk { + var newData dao.StoreNewCreate + if utils.JsonStringToStruct(info.NewContent, &newData) { + newData.Status = int32(status) + newData.NewContent = utils.StringEmpty + newData.Id = info.Id + groupId, sErr := l.getSaleInfo(newData.SaleId) + if sErr != utils.Ok { + modelObj.Rollback() + return l.fail(sErr) + } + if groupId < utils.NumberOne { + modelObj.Rollback() + return l.fail(utils.ErrorNotFund) + } + + newData.GroupId = groupId + + _, err = modelObj.Edit(w, &newData) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if newData.SaleId != info.SaleId { + sErr = l.setAddressSaleInfo(newData) + if sErr != utils.Ok { + modelObj.Rollback() + return l.fail(sErr) + } + } + + if newData.UserMobile != info.UserMobile && newData.UserName != info.UserName { + uErr := l.updateUser(newData) + if uErr != utils.Ok { + modelObj.Rollback() + return l.fail(uErr) + } + } + } else { + modelObj.Rollback() + return l.fail(utils.ErrorFormatDataError) + } + } + + reason := utils.StringEmpty + if in.Reason != utils.StringEmpty { + reason = in.Reason + } + svc.WeCom(in.Status, utils.StoreSecondReview, info.Id, reason) + + modelObj.Commit() + action.NewContent = info + utils.SetActionLog(adminInfo, action) + return l.ok(utils.NumberOne) +} + +func (l *ApplyVerifyStatusLogic) getSaleInfo(id int64) (int64, utils.Status) { + cli, err := svc.GetRpcClient(l.svcCtx.SaleName) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.NumberZero, utils.ErrorInternalServer + } + + client := sale.NewSaleClient(cli.Conn()) + w := sale.InfoReq{Id: id} + info, err := client.InfoInternal(context.Background(), &w) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.NumberZero, utils.ErrorInternalServer + } + return info.GroupId, utils.Ok +} + +func (l *ApplyVerifyStatusLogic) setAddressSaleInfo(info dao.StoreNewCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get address err: %v", err) + return utils.ErrorInternalServer + } + + client := order.NewOrderClient(cli.Conn()) + data := order.UpdateAddressSaleInfoRequest{ + Id: info.Id, + SaleId: info.SaleId, + GroupId: info.GroupId, + } + _, err = client.UpdateAddressSaleInfo(context.Background(), &data) + if err != nil { + logx.Errorf("get address err: %v", err) + return utils.ErrorInternalServer + } + return utils.Ok +} + +func (l *ApplyVerifyStatusLogic) updateUser(info dao.StoreNewCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + mobile, sErr := utils.EncryptPhone(info.UserMobile) + if sErr != nil { + return utils.ErrorEncryptAesError + } + data := user.InternalUpdateReq{ + BizId: info.Id, + SubjectType: dao.UserTypeName, + Mobile: mobile, + Name: info.UserName, + ClientCode: strings.Split(info.StoreType, utils.DecollatorComma), //哪端 + CredentialType: []string{dao.LoginTypePassword, dao.LoginTypeSms}, + Identifier: mobile, //手机号 + } + _, err = client.InternalUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok } diff --git a/services/store/internal/logic/base.go b/services/store/internal/logic/base.go index 9bc96a5..66e3520 100644 --- a/services/store/internal/logic/base.go +++ b/services/store/internal/logic/base.go @@ -1,10 +1,12 @@ package logic import ( + "lone-services/pkg/modelbase" "lone-services/pkg/utils" "lone-services/pkg/validate" store "lone-services/rpc/store/pb" "reflect" + "strconv" jsoniter "github.com/json-iterator/go" ) @@ -46,3 +48,29 @@ func (l *BaseLogic) ok(data any) (*store.Response, error) { buf, _ := jsoniter.Marshal(data) return &store.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg, Data: string(buf)}, nil } + +func (s BaseLogic) SetWhere(w *modelbase.Params, u utils.UserInfo) { + if u.Type == utils.SaleType { + s.SetGroupWhere(w, u, false) + } +} + +func (s BaseLogic) SetGroupWhere(w *modelbase.Params, u utils.UserInfo, checkProvince bool) { + if w.Eq == nil { + w.Eq = make(map[string]string) + } + if u.GroupId < utils.NumberOne { + return + } + + //如果是公司销售 + if u.Type == utils.SaleType { + w.Eq["group_id"] = strconv.Itoa(int(u.GroupId)) + } else if u.SaleProvince > utils.NumberZero { + if checkProvince { + w.Eq["sale_province"] = strconv.Itoa(int(u.SaleProvince)) + } else { + w.Eq["group_id"] = strconv.Itoa(int(u.GroupId)) + } + } +} diff --git a/services/store/internal/logic/createLogic.go b/services/store/internal/logic/createLogic.go index 54f3193..74d925a 100644 --- a/services/store/internal/logic/createLogic.go +++ b/services/store/internal/logic/createLogic.go @@ -5,9 +5,12 @@ import ( "lone-services/pkg/utils" sale "lone-services/rpc/sale/pb" "lone-services/rpc/store/pb" + user "lone-services/rpc/user/pb" "lone-services/services/store/internal/dao" "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "lone-services/services/store/validator" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -28,12 +31,20 @@ func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogi } func (l *CreateLogic) Create(in *store.CreateRequest) (*store.Response, error) { + var v validator.StoreCreateValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) if adminInfo.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) } - //TODO 调用用户接口-判断是否可以注册 + uErr := l.checkUser(in.UserMobile) + if uErr != utils.Ok { + return l.fail(uErr) + } encryptMobile, cErr := utils.EncryptPhone(in.UserMobile) if cErr != nil { @@ -60,6 +71,7 @@ func (l *CreateLogic) Create(in *store.CreateRequest) (*store.Response, error) { Status: utils.StatusOk, SaleId: in.SaleId, SourceType: model.StoreTypeAdmin, + StoreType: strings.Join(in.StoreType, utils.DecollatorComma), Images: in.Images, Contact: in.Contact, Content: in.Content, @@ -93,20 +105,10 @@ func (l *CreateLogic) Create(in *store.CreateRequest) (*store.Response, error) { data.GroupId = groupId - //TODO 调用用户更新接口-更新手机号 - //err = models.StoreModel{}.Init().Create(&data) - //if err != nil { - // l.Logger.Error(err) - // return l.fail(utils.Fail) - //} - - //TODO 发送短信 - //result := utils.SendPwdSMS(in.UserMobile, in.Password) - //jsonStr, err := json.Marshal(result) - //SmsLogService{}.Add(c, in.UserMobile, "您的初始密码为:"+in.Password+",请尽快登录后修改!", string(jsonStr)) - //if result.Code != dao.NumberZero { - // return check.Id, utils.Fail - //} + uErr = l.updateUser(data) + if uErr != utils.Ok { + return l.fail(uErr) + } return l.ok(utils.NumberOne) } @@ -127,3 +129,55 @@ func (l *CreateLogic) getSaleInfo(id int64) (int64, utils.Status) { } return info.GroupId, utils.Ok } + +func (l *CreateLogic) updateUser(info dao.StoreCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + mobile, sErr := utils.EncryptPhone(info.UserMobile) + if sErr != nil { + return utils.ErrorEncryptAesError + } + data := user.InternalUpdateReq{ + BizId: info.Id, + SubjectType: dao.UserTypeName, + Mobile: mobile, + Name: info.UserName, + ClientCode: strings.Split(info.StoreType, utils.DecollatorComma), //哪端 + CredentialType: []string{dao.LoginTypePassword, dao.LoginTypeSms}, + Identifier: mobile, //手机号 + } + _, err = client.InternalUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok +} + +func (l *CreateLogic) checkUser(mobile string) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + data := user.InternalCheckCreateReq{ + Mobile: mobile, + } + _, err = client.InternalCheckCreate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok +} diff --git a/services/store/internal/logic/depositBackfillLogic.go b/services/store/internal/logic/depositBackfillLogic.go index 4d5f75d..c9bf559 100644 --- a/services/store/internal/logic/depositBackfillLogic.go +++ b/services/store/internal/logic/depositBackfillLogic.go @@ -2,6 +2,12 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +31,53 @@ func NewDepositBackfillLogic(ctx context.Context, svcCtx *svc.ServiceContext) *D } func (l *DepositBackfillLogic) DepositBackfill(in *store.DepositBackfillRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositBackfillValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info dao.DepositStatus + + w := modelbase.Params{Eq: map[string]string{ + "id": strconv.FormatInt(in.Id, utils.NumberTen), + "status": strconv.Itoa(utils.StatusWaitPass)}} + modelObj := model.DepositModel{}.Init() + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + action := utils.ActionAdd{ + OldContent: info, + Type: utils.LogActionTypeEdit, + ModuleName: utils.LogActionModuleStore, + } + + info.Status = utils.StatusBackfill + info.AccountantId = adminInfo.ID + info.AccountantName = adminInfo.Name + info.AffirmAmount = info.Amount + if in.Amount > utils.NumberZero { + info.AffirmAmount = in.Amount + } + + row, err := modelObj.Edit(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if row > utils.NumberZero { + action.NewContent = info + utils.SetActionLog(adminInfo, action) + } + return l.ok(utils.NumberOne) } diff --git a/services/store/internal/logic/depositDoneLogic.go b/services/store/internal/logic/depositDoneLogic.go index 635d419..7f88a8b 100644 --- a/services/store/internal/logic/depositDoneLogic.go +++ b/services/store/internal/logic/depositDoneLogic.go @@ -2,6 +2,12 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +31,68 @@ func NewDepositDoneLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Depos } func (l *DepositDoneLogic) DepositDone(in *store.IdRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositDoneValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info dao.DepositStatus + + w := modelbase.Params{Eq: map[string]string{ + "id": strconv.FormatInt(in.Id, utils.NumberTen), + "status": strconv.Itoa(utils.StatusBackfill)}} + modelObj := model.DepositModel{}.Init() + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + action := utils.ActionAdd{ + OldContent: info, + Type: utils.LogActionTypeEdit, + ModuleName: utils.LogActionModuleStore, + } + + info.Status = utils.StatusOk + info.AdminId = adminInfo.ID + info.AdminName = adminInfo.Name + + modelObj.Begin() + _, err = modelObj.Edit(w, &info) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + w = modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(info.StoreId))}} + var store dao.StoreDeposit + err = model.StoreModel{}.Init().GetOne(w, &store) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + store.Amount = store.Amount + info.AffirmAmount + row, err := model.StoreModel{}.Init().Edit(w, &store) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + modelObj.Commit() + if row > utils.NumberZero { + action.NewContent = info + utils.SetActionLog(adminInfo, action) + } + + return l.ok(utils.NumberOne) } diff --git a/services/store/internal/logic/depositDownLogic.go b/services/store/internal/logic/depositDownLogic.go index 064d926..d6be910 100644 --- a/services/store/internal/logic/depositDownLogic.go +++ b/services/store/internal/logic/depositDownLogic.go @@ -2,9 +2,14 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" "lone-services/rpc/store/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "lone-services/services/store/validator" + "strconv" "github.com/zeromicro/go-zero/core/logx" ) @@ -24,8 +29,103 @@ func NewDepositDownLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Depos } } -func (l *DepositDownLogic) DepositDown(in *store.DepositItemsRequest) (*store.Response, error) { - // todo: add your logic here and delete this line +func (l *DepositDownLogic) DepositDown(in *store.DepositItemsRequest) (*store.ExcelExportResponse, error) { + var v validator.DepositItemsValidator + res := &store.ExcelExportResponse{} + if fail := l.checkParams(in, &v); fail != nil { + res.Msg = fail.Msg + return res, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) - return &store.Response{}, nil + if adminInfo.ID < utils.NumberOne { + res.Msg = utils.ErrorNoLoginInfo.Msg + return res, nil + } + + var info []dao.DepositDown + w := modelbase.Params{ + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + + w.Eq = make(map[string]string) + + storeMap := make(map[int64]string) + if len(v.Name) > utils.NumberZero { + ww := modelbase.Params{Like: map[string]string{"name LIKE ? ": "%%" + v.Name + "%%"}} + var storeItems []dao.StoreNames + err := model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + res.Msg = utils.Fail.Msg + return res, nil + } + + var ids []string + for _, item := range storeItems { + ids = append(ids, strconv.Itoa(int(item.Id))) + storeMap[item.Id] = item.Name + } + if len(ids) < utils.NumberOne { + res.Msg = utils.ErrorNotFund.Msg + return res, nil + } + + w.In = map[string][]string{"store_id": ids} + } + if v.Status > utils.NumberZero { + w.Eq["status"] = strconv.Itoa(int(v.Status)) + } + err := model.DepositModel{}.Init().Items(w, &info) + if err != nil { + l.Logger.Error(err) + res.Msg = utils.Fail.Msg + return res, nil + } + + if len(storeMap) < utils.NumberOne { + var storeIds []string + for _, values := range info { + storeIds = append(storeIds, strconv.Itoa(int(values.StoreId))) + } + ww := modelbase.Params{In: map[string][]string{"id": storeIds}} + var storeItems []dao.StoreNames + err = model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + res.Msg = utils.Fail.Msg + return res, nil + } + + for _, item := range storeItems { + storeMap[item.Id] = item.Name + } + } + + for key, val := range info { + if name, ok := storeMap[val.StoreId]; ok { + info[key].StoreName = name + } + } + + // 2. 配置导出列:表头 ↔ 结构体字段 + columns := []utils.ExcelColumn{ + {Header: "ID", Field: "Id"}, + {Header: "票据", Field: "Bill"}, + {Header: "金额", Field: "Amount"}, + {Header: "门店名", Field: "StoreName"}, + {Header: "汇款时间", Field: "CreateTime"}, + } + + res.Name = "核对列表" + // 3. 一行导出 + data, err := utils.ExcelExport(columns, info) + if err != nil { + res.Msg = err.Error() + return res, nil + } + res.Data = data + return res, nil } diff --git a/services/store/internal/logic/depositIgnoreItemsLogic.go b/services/store/internal/logic/depositIgnoreItemsLogic.go index beb2284..05322f4 100644 --- a/services/store/internal/logic/depositIgnoreItemsLogic.go +++ b/services/store/internal/logic/depositIgnoreItemsLogic.go @@ -2,9 +2,13 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" "lone-services/rpc/store/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "strconv" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +29,50 @@ func NewDepositIgnoreItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) } func (l *DepositIgnoreItemsLogic) DepositIgnoreItems(in *store.DepositVerifyRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info []dao.DepositInfo + w := modelbase.Params{ + Eq: map[string]string{"status": strconv.Itoa(utils.StatusNotPass)}, + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + + storeMap := make(map[int64]string) + items, err := model.DepositModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if len(storeMap) < utils.NumberOne { + var storeIds []string + for _, values := range info { + storeIds = append(storeIds, strconv.Itoa(int(values.StoreId))) + } + ww := modelbase.Params{In: map[string][]string{"id": storeIds}} + var storeItems []dao.StoreNames + err := model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + for _, item := range storeItems { + storeMap[item.Id] = item.Name + } + } + + for key, val := range info { + if name, ok := storeMap[val.StoreId]; ok { + info[key].StoreName = name + } + } + + items.Items = info + return l.ok(items) } diff --git a/services/store/internal/logic/depositIgnoreLogic.go b/services/store/internal/logic/depositIgnoreLogic.go index e4442ee..65e7b7e 100644 --- a/services/store/internal/logic/depositIgnoreLogic.go +++ b/services/store/internal/logic/depositIgnoreLogic.go @@ -2,6 +2,12 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +31,48 @@ func NewDepositIgnoreLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Dep } func (l *DepositIgnoreLogic) DepositIgnore(in *store.DepositIgnoreRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositIgnoreValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + + var info dao.DepositStatus + + w := modelbase.Params{Eq: map[string]string{ + "id": strconv.FormatInt(in.Id, utils.NumberTen), + "status": strconv.Itoa(utils.StatusWaitPass)}} + modelObj := model.DepositModel{}.Init() + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + action := utils.ActionAdd{ + OldContent: info, + Type: utils.LogActionTypeEdit, + ModuleName: utils.LogActionModuleStore, + } + + info.Status = utils.StatusNotPass + info.Reason = v.Reason + + row, err := modelObj.Edit(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if row > utils.NumberZero { + action.NewContent = info + utils.SetActionLog(adminInfo, action) + } + + return l.ok(utils.NumberOne) - return &store.Response{}, nil } diff --git a/services/store/internal/logic/depositItemsLogic.go b/services/store/internal/logic/depositItemsLogic.go index c6beeee..6a250a2 100644 --- a/services/store/internal/logic/depositItemsLogic.go +++ b/services/store/internal/logic/depositItemsLogic.go @@ -2,6 +2,12 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +31,78 @@ func NewDepositItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Depo } func (l *DepositItemsLogic) DepositItems(in *store.DepositItemsRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositItemsValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info []dao.DepositInfo + w := modelbase.Params{ + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + + w.Eq = make(map[string]string) + + storeMap := make(map[int64]string) + if len(v.Name) > utils.NumberZero { + ww := modelbase.Params{Like: map[string]string{"name LIKE ? ": "%%" + v.Name + "%%"}} + var storeItems []dao.StoreNames + err := model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + var ids []string + for _, item := range storeItems { + ids = append(ids, strconv.Itoa(int(item.Id))) + storeMap[item.Id] = item.Name + } + if len(ids) < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + w.In = map[string][]string{"store_id": ids} + } + if v.Status > utils.NumberZero { + w.Eq["status"] = strconv.Itoa(int(v.Status)) + } + items, err := model.DepositModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if len(storeMap) < utils.NumberOne { + var storeIds []string + for _, values := range info { + storeIds = append(storeIds, strconv.Itoa(int(values.StoreId))) + } + ww := modelbase.Params{In: map[string][]string{"id": storeIds}} + var storeItems []dao.StoreNames + err = model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + for _, item := range storeItems { + storeMap[item.Id] = item.Name + } + } + + for key, val := range info { + if name, ok := storeMap[val.StoreId]; ok { + info[key].StoreName = name + } + } + items.Items = info + + return l.ok(items) } diff --git a/services/store/internal/logic/depositRecoverLogic.go b/services/store/internal/logic/depositRecoverLogic.go index 9c3baf2..7f7947f 100644 --- a/services/store/internal/logic/depositRecoverLogic.go +++ b/services/store/internal/logic/depositRecoverLogic.go @@ -2,9 +2,14 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/pkg/validate" "lone-services/rpc/store/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "strconv" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +30,46 @@ func NewDepositRecoverLogic(ctx context.Context, svcCtx *svc.ServiceContext) *De } func (l *DepositRecoverLogic) DepositRecover(in *store.IdRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validate.InfoValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info dao.DepositStatus + + w := modelbase.Params{Eq: map[string]string{"id": strconv.FormatInt(in.Id, utils.NumberTen)}, + In: map[string][]string{"status": {strconv.Itoa(utils.StatusNotPass), strconv.Itoa(utils.StatusBackfill)}}} + modelObj := model.DepositModel{}.Init() + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + action := utils.ActionAdd{ + OldContent: info, + Type: utils.LogActionTypeEdit, + ModuleName: utils.LogActionModuleStore, + } + + info.Status = utils.StatusWaitPass + info.Reason = utils.StringEmpty + row, err := modelObj.Edit(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if row > utils.NumberZero { + action.NewContent = info + utils.SetActionLog(adminInfo, action) + } + + return l.ok(utils.NumberOne) } diff --git a/services/store/internal/logic/depositVerifyLogic.go b/services/store/internal/logic/depositVerifyLogic.go index a9e229c..62d0876 100644 --- a/services/store/internal/logic/depositVerifyLogic.go +++ b/services/store/internal/logic/depositVerifyLogic.go @@ -2,6 +2,12 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +31,74 @@ func NewDepositVerifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Dep } func (l *DepositVerifyLogic) DepositVerify(in *store.DepositVerifyRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositVerifyItemsValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info []dao.DepositInfo + w := modelbase.Params{ + Eq: map[string]string{"status": strconv.Itoa(utils.StatusWaitPass)}, + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + + storeMap := make(map[int64]string) + if len(v.Name) > utils.NumberZero { + ww := modelbase.Params{Like: map[string]string{"name LIKE ? ": "%%" + v.Name + "%%"}} + var storeItems []dao.StoreNames + err := model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + var ids []string + for _, item := range storeItems { + ids = append(ids, strconv.Itoa(int(item.Id))) + storeMap[item.Id] = item.Name + } + if len(ids) < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + w.In = map[string][]string{"store_id": ids} + } + items, err := model.DepositModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if len(storeMap) < utils.NumberOne { + var storeIds []string + for _, values := range info { + storeIds = append(storeIds, strconv.Itoa(int(values.StoreId))) + } + ww := modelbase.Params{In: map[string][]string{"id": storeIds}} + var storeItems []dao.StoreNames + err = model.StoreModel{}.Init().Items(ww, &storeItems) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + for _, item := range storeItems { + storeMap[item.Id] = item.Name + } + } + + for key, val := range info { + if name, ok := storeMap[val.StoreId]; ok { + info[key].StoreName = name + } + } + + items.Items = info + return l.ok(items) } diff --git a/services/store/internal/logic/editLogic.go b/services/store/internal/logic/editLogic.go index 18001ea..cefff7e 100644 --- a/services/store/internal/logic/editLogic.go +++ b/services/store/internal/logic/editLogic.go @@ -5,10 +5,13 @@ import ( "lone-services/pkg/modelbase" "lone-services/pkg/utils" "lone-services/rpc/store/pb" + user "lone-services/rpc/user/pb" "lone-services/services/store/internal/dao" "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "lone-services/services/store/validator" "strconv" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -29,6 +32,11 @@ func NewEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EditLogic { } func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { + var v validator.StoreEditValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) if adminInfo.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) @@ -55,14 +63,15 @@ func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { } oldMobile, cErr := utils.DecryptPhone(info.UserMobile) + var oldMobile2 string if cErr == nil { - oldMobile = utils.DecryptPhoneReplace(oldMobile) + oldMobile2 = utils.DecryptPhoneReplace(oldMobile) } encryptMobile, cErr := utils.EncryptPhone(in.UserMobile) if cErr != nil { return l.fail(utils.SetError(utils.Fail, cErr.GetMsg())) } - if oldMobile != in.UserMobile { + if oldMobile != in.UserMobile && oldMobile2 != in.UserMobile { var check dao.StoreStatus ww := modelbase.Params{Eq: map[string]string{"user_mobile": encryptMobile}} err = modelObj.GetOne(ww, &check) @@ -76,8 +85,10 @@ func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { } } - //TODO 调用用户接口-判断是否可以修改 - //TODO 调用用户更新接口-更新手机号 + uErr := l.checkUser(in.UserMobile, in.Id) + if uErr != utils.Ok { + return l.fail(uErr) + } if in.BusinessLicense != info.BusinessLicense { encryptData, cErr := utils.Crypto{}.AESEncryptECB(in.BusinessLicense) @@ -111,6 +122,8 @@ func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { info.LongitudeGcj02 = in.LongitudeGcj02 info.LatitudeGcj02 = in.LatitudeGcj02 info.StoreImages = in.StoreImages + info.StoreType = strings.Join(in.StoreType, utils.DecollatorComma) + info.Area = in.Area info.Receipt = in.Receipt info.Type = in.Type @@ -121,9 +134,17 @@ func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { info.County = in.County info.CountyName = in.CountyName - if oldMobile != in.UserMobile && encryptMobile != info.UserMobile { + if oldMobile != in.UserMobile && oldMobile2 != in.UserMobile { info.UserMobile = encryptMobile } + + if (oldMobile != in.UserMobile && oldMobile2 != in.UserMobile) || in.UserName != info.UserName { + uErr = l.updateUser(info) + if uErr != utils.Ok { + return l.fail(uErr) + } + } + w = modelbase.Params{Eq: map[string]string{"id": strconv.FormatInt(in.Id, utils.NumberTen)}} edit := dao.StoreNewContent{ NewContent: utils.StructToJson(info), @@ -139,3 +160,57 @@ func (l *EditLogic) Edit(in *store.EditRequest) (*store.Response, error) { } return l.ok(utils.NumberOne) } + +func (l *EditLogic) updateUser(info dao.StoreCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + mobile, sErr := utils.EncryptPhone(info.UserMobile) + if sErr != nil { + return utils.ErrorEncryptAesError + } + data := user.InternalUpdateReq{ + BizId: info.Id, + SubjectType: dao.UserTypeName, + Mobile: mobile, + Name: info.UserName, + ClientCode: strings.Split(info.StoreType, utils.DecollatorComma), //哪端 + CredentialType: []string{dao.LoginTypePassword, dao.LoginTypeSms}, + Identifier: mobile, //手机号 + } + _, err = client.InternalUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok +} + +func (l *EditLogic) checkUser(mobile string, id int64) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + data := user.InternalCheckUpdateReq{ + Mobile: mobile, + SubjectType: dao.UserTypeName, + BizId: id, + } + _, err = client.InternalCheckUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok +} diff --git a/services/store/internal/logic/getInfoByIdLogic.go b/services/store/internal/logic/getInfoByIdLogic.go new file mode 100644 index 0000000..2f0a188 --- /dev/null +++ b/services/store/internal/logic/getInfoByIdLogic.go @@ -0,0 +1,72 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "strconv" + + "lone-services/rpc/store/pb" + "lone-services/services/store/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type GetInfoByIdLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetInfoByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetInfoByIdLogic { + return &GetInfoByIdLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetInfoByIdLogic) GetInfoById(in *store.IdRequest) (*store.InfoResponse, error) { + var info dao.StoreInfo + modelObj := model.StoreModel{}.Init() + w := modelbase.Params{Eq: map[string]string{"id": strconv.FormatInt(in.Id, utils.NumberTen)}} + err := modelObj.GetOne(w, &info) + if err != nil { + l.Logger.Error(err) + return nil, status.Error(codes.Internal, utils.Fail.Msg) + } + + if info.Id < utils.NumberOne { + return nil, status.Error(codes.Internal, utils.ErrorNotFund.Msg) + } + + if info.Id > utils.NumberZero { + mobile, dErr := utils.DecryptPhone(info.UserMobile) + if dErr == nil { + return nil, status.Error(codes.Internal, utils.ErrorEncryptAesError.Msg) + } + info.UserMobile = mobile + } + + return &store.InfoResponse{ + Id: info.Id, + Name: info.Name, + Contact: info.Contact, + UserMobile: info.UserMobile, + IdCard: info.IdCard, + BusinessLicense: info.BusinessLicense, + Images: info.Images, + Content: info.Content, + OpenTime: info.OpenTime, + Address: info.Address, + City: info.City, + County: info.County, + DistrictIds: info.District, + Area: info.Area, + BankInfo: info.BankInfo, + }, nil +} diff --git a/services/store/internal/logic/getInfoByIdsLogic.go b/services/store/internal/logic/getInfoByIdsLogic.go new file mode 100644 index 0000000..7859712 --- /dev/null +++ b/services/store/internal/logic/getInfoByIdsLogic.go @@ -0,0 +1,74 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/rpc/store/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/internal/svc" + "strconv" + + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type GetInfoByIdsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetInfoByIdsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetInfoByIdsLogic { + return &GetInfoByIdsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetInfoByIdsLogic) GetInfoByIds(in *store.IdsRequest) (*store.ItemsResponse, error) { + var info []dao.StoreInfo + modelObj := model.StoreModel{}.Init() + var ids []string + for _, id := range in.Ids { + ids = append(ids, strconv.FormatInt(id, utils.NumberTen)) + } + w := modelbase.Params{In: map[string][]string{"id": ids}} + err := modelObj.Items(w, &info) + if err != nil { + l.Logger.Error(err) + return nil, status.Error(codes.Internal, utils.Fail.Msg) + } + + if len(info) < utils.NumberOne { + return nil, status.Error(codes.Internal, utils.ErrorNotFund.Msg) + } + + var items []*store.InfoResponse + for _, item := range info { + mobile, _ := utils.DecryptPhone(item.UserMobile) + + items = append(items, &store.InfoResponse{ + Id: item.Id, + Name: item.Name, + Contact: item.Contact, + UserMobile: mobile, + IdCard: item.IdCard, + BusinessLicense: item.BusinessLicense, + Images: item.Images, + Content: item.Content, + OpenTime: item.OpenTime, + Address: item.Address, + City: item.City, + County: item.County, + DistrictIds: item.District, + Area: item.Area, + BankInfo: item.BankInfo, + }) + } + + return &store.ItemsResponse{Items: items}, nil +} diff --git a/services/store/internal/logic/toSaleLogic.go b/services/store/internal/logic/toSaleLogic.go index b154ec1..d756387 100644 --- a/services/store/internal/logic/toSaleLogic.go +++ b/services/store/internal/logic/toSaleLogic.go @@ -8,6 +8,7 @@ import ( sale "lone-services/rpc/sale/pb" "lone-services/services/store/internal/dao" "lone-services/services/store/internal/model" + "lone-services/services/store/validator" "strconv" "lone-services/rpc/store/pb" @@ -32,6 +33,10 @@ func NewToSaleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ToSaleLogi } func (l *ToSaleLogic) ToSale(in *store.ToSaleRequest) (*store.Response, error) { + var v validator.StoreToSaleValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } adminInfo := utils.GetUserFromCtx(l.ctx) if adminInfo.ID < utils.NumberOne { return l.fail(utils.ErrorNoLoginInfo) @@ -50,6 +55,9 @@ func (l *ToSaleLogic) ToSale(in *store.ToSaleRequest) (*store.Response, error) { return l.fail(utils.ErrorNotFund) } + if info.SaleId == in.SaleId { + return l.ok(utils.NumberOne) + } info.SaleId = in.SaleId info.AdminId = adminInfo.ID info.AdminName = adminInfo.Name @@ -64,17 +72,34 @@ func (l *ToSaleLogic) ToSale(in *store.ToSaleRequest) (*store.Response, error) { info.GroupId = groupId - sErr = l.setAddressSaleInfo(info) - if sErr != utils.Ok { - return l.fail(sErr) - } - + modelObj.Begin() _, err = modelObj.Edit(w, &info) if err != nil { + modelObj.Rollback() l.Logger.Error(err) return l.fail(utils.Fail) } + history := dao.SaleChangeHistoryCreate{ + StoreId: info.Id, + SaleId: info.SaleId, + AdminId: adminInfo.ID, + } + + err = model.SaleChangeHistoryModel{}.Init().Create(&history) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + sErr = l.setAddressSaleInfo(info) + if sErr != utils.Ok { + modelObj.Rollback() + return l.fail(sErr) + } + + modelObj.Commit() return l.ok(utils.NumberOne) } diff --git a/services/store/internal/logic/verifyEditLogic.go b/services/store/internal/logic/verifyEditLogic.go index 93614d3..3486e76 100644 --- a/services/store/internal/logic/verifyEditLogic.go +++ b/services/store/internal/logic/verifyEditLogic.go @@ -2,6 +2,14 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + user "lone-services/rpc/user/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" + "strings" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +33,139 @@ func NewVerifyEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Verify } func (l *VerifyEditLogic) VerifyEdit(in *store.EditRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.StoreCreateValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info dao.StoreCreate + w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}} + modelObj := model.StoreModel{}.Init() + err := modelObj.GetOne(w, &info) + if err != nil || info.Id < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + oldMobile, cErr := utils.DecryptPhone(info.UserMobile) + if cErr != nil { + return l.fail(utils.ErrorEncryptAesError) + } + oldMobile2 := utils.DecryptPhoneReplace(oldMobile) + encryptMobile, cErr := utils.EncryptPhone(in.UserMobile) + if cErr != nil { + return l.fail(utils.ErrorEncryptAesError) + } + if oldMobile != in.UserMobile && oldMobile2 != in.UserName { + var check dao.StoreStatus + ww := modelbase.Params{Eq: map[string]string{"user_mobile": encryptMobile}} + err = modelObj.GetOne(ww, &check) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + if check.Id > utils.NumberZero && check.Id != info.Id { + return l.fail(utils.ErrorDataIsExist) + } + } + + if v.BusinessLicense != info.BusinessLicense { + encryptIdCard, cErr := utils.Crypto{}.AESEncryptECB(v.BusinessLicense) + if cErr != nil { + return l.fail(utils.ErrorEncryptAesError) + } + info.BusinessLicense = encryptIdCard + } + + if v.IdCard != info.IdCard { + encryptIdCard, cErr := utils.Crypto{}.AESEncryptECB(v.IdCard) + if cErr != nil { + return l.fail(utils.ErrorEncryptAesError) + } + info.IdCard = encryptIdCard + } + + info.SaleId = v.SaleId + info.UserName = v.UserName + info.Name = v.Name + info.District = v.DistrictIds + info.Address = v.Address + info.Images = v.Images + info.Contact = v.Contact + info.Content = v.Content + info.BankInfo = v.BankInfo + info.AdminId = adminInfo.ID + info.AdminName = adminInfo.Name + info.OpenTime = v.OpenTime + info.LongitudeWgs84 = v.LongitudeWgs84 + info.LatitudeWgs84 = v.LatitudeWgs84 + info.LongitudeGcj02 = v.LongitudeGcj02 + info.LatitudeGcj02 = v.LatitudeGcj02 + info.StoreImages = v.StoreImages + info.Status = utils.StatusOk + info.Area = v.Area + info.Receipt = v.Receipt + info.Type = v.Type + + modelObj.Begin() + if oldMobile != in.UserMobile && encryptMobile != info.UserMobile { + uErr := l.updateUser(info) + if uErr != utils.Ok { + modelObj.Rollback() + return l.fail(uErr) + } + info.UserMobile = encryptMobile + _, err = modelObj.Edit(w, &info) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + } else { + _, err = modelObj.Edit(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + } + + modelObj.Commit() + + return l.ok(utils.NumberOne) +} + +func (l *VerifyEditLogic) updateUser(info dao.StoreCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + mobile, sErr := utils.EncryptPhone(info.UserMobile) + if sErr != nil { + return utils.ErrorEncryptAesError + } + data := user.InternalUpdateReq{ + BizId: info.Id, + SubjectType: dao.UserTypeName, + Mobile: mobile, + Name: info.UserName, + ClientCode: strings.Split(info.StoreType, utils.DecollatorComma), //哪端 + CredentialType: []string{dao.LoginTypePassword, dao.LoginTypeSms}, + Identifier: mobile, //手机号 + } + _, err = client.InternalUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok } diff --git a/services/store/internal/logic/verifyItemsLogic.go b/services/store/internal/logic/verifyItemsLogic.go index eecad1d..2d4a1c4 100644 --- a/services/store/internal/logic/verifyItemsLogic.go +++ b/services/store/internal/logic/verifyItemsLogic.go @@ -2,10 +2,18 @@ package logic import ( "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + sale "lone-services/rpc/sale/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" + "strconv" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" + "github.com/samber/lo" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +33,97 @@ func NewVerifyItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Verif } func (l *VerifyItemsLogic) VerifyItems(in *store.VerifyItemsRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.StoreVerifyItemsValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + var info []dao.StoreInfo + w := modelbase.Params{ + Eq: map[string]string{}, + Page: int(v.Page), + Size: int(v.Size), + Order: "id desc", + } - return &store.Response{}, nil + if v.Status > utils.NumberZero { + w.Eq["status"] = strconv.Itoa(int(v.Status)) + } else { + w.In = map[string][]string{"status": {utils.StatusFailString, strconv.Itoa(utils.StatusWaitPass)}} + } + + if v.SaleId > utils.NumberZero { + w.Eq["sale_id"] = strconv.FormatInt(v.SaleId, utils.NumberTen) + } + + l.SetWhere(&w, adminInfo) + + w.Like = make(map[string]string) + if len(v.Name) > utils.NumberZero { + w.Like["name LIKE ? "] = "%%" + v.Name + "%%" + } + + items, err := model.StoreModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + var saleIds []int64 + for key, v := range info { + mobile, aErr := utils.Crypto{}.AESDecryptECB(v.UserMobile) + if aErr == nil { + info[key].UserMobile = mobile + } + + credentials, aErr := utils.Crypto{}.AESDecryptECB(v.BusinessLicense) + if aErr == nil { + info[key].BusinessLicense = credentials + } + idCard, aErr := utils.Crypto{}.AESDecryptECB(v.IdCard) + if aErr == nil { + info[key].IdCard = idCard + } + saleIds = append(saleIds, v.SaleId) + } + newSaleIds := lo.Uniq(saleIds) + if len(newSaleIds) > utils.NumberZero { + salesMap := make(map[int64]string) + if len(newSaleIds) > utils.NumberZero { + sales, err := l.getSaleInfo(saleIds) + if err == utils.Ok { + for _, val := range sales.Items { + salesMap[val.Id] = val.Name + } + } + } + + for key, item := range info { + if s, ok := salesMap[item.SaleId]; ok { + info[key].SaleName = s + } + } + } + + items.Items = info + return l.ok(items) +} + +func (l *VerifyItemsLogic) getSaleInfo(ids []int64) (*sale.NamesByIdsData, utils.Status) { + cli, err := svc.GetRpcClient(l.svcCtx.SaleName) + if err != nil { + logx.Errorf("get order err: %v", err) + return &sale.NamesByIdsData{}, utils.ErrorInternalServer + } + + client := sale.NewSaleClient(cli.Conn()) + w := sale.NamesByIdsReq{Ids: ids} + info, err := client.NamesByIds(context.Background(), &w) + if err != nil { + logx.Errorf("get order err: %v", err) + return &sale.NamesByIdsData{}, utils.ErrorInternalServer + } + return info, utils.Ok } diff --git a/services/store/internal/logic/verifyStatusLogic.go b/services/store/internal/logic/verifyStatusLogic.go index 6015b97..37b426b 100644 --- a/services/store/internal/logic/verifyStatusLogic.go +++ b/services/store/internal/logic/verifyStatusLogic.go @@ -2,6 +2,16 @@ package logic import ( "context" + "fmt" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/pkg/validate" + chore "lone-services/rpc/chore/pb" + user "lone-services/rpc/user/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "strconv" + "strings" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +35,152 @@ func NewVerifyStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Veri } func (l *VerifyStatusLogic) VerifyStatus(in *store.StatusRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validate.StatusValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } - return &store.Response{}, nil + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } + + var info dao.StoreStatus + w := modelbase.Params{ + In: map[string][]string{"status": {utils.StatusFailString, strconv.Itoa(utils.StatusWaitPass)}}, + Eq: map[string]string{"id": strconv.FormatInt(v.Id, utils.NumberTen)}} + modelObj := model.StoreModel{}.Init() + err := modelObj.GetOne(w, &info) + + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + if info.Status < utils.NumberOne { + return l.fail(utils.ErrorNotFund) + } + + info.Status = v.Status + info.Reason = v.Reason + info.AdminId = adminInfo.ID + info.AdminName = adminInfo.Name + + status := utils.StatusOk + content := "已通过。" + if v.Status != utils.StatusOk { + status = utils.StatusFail + content = "未通过。理由为: " + v.Reason + } + + content = "门店 '" + info.Name + "'审核: " + content + + salt := utils.GetRandString(utils.NumberFive) + oldPwd := utils.RandString(utils.NumberEight) + pwd := fmt.Sprintf("%s%s", salt, oldPwd) + pwd, _ = utils.EncryptPassword(pwd) + + modelObj.Begin() + _, err = modelObj.Edit(w, &info) + if err != nil { + modelObj.Rollback() + l.Logger.Error(err) + return l.fail(utils.Fail) + } + //TODO 更新登录密码 + //login := dao.LoginStatusPassword{ + // Salt: salt, + // Password: pwd, + // Status: status, + // AdminId: u.Id, + // AdminName: u.Name, + //} + //ww := modelbase.Params{Eq: map[string]string{"obj_id": strconv.Itoa(int(v.Id)), "type": strconv.Itoa(dao.TypeStore)}} + //_, err = model.LoginModel{}.Init().Edit(ww, &login) + //if err != nil { + // modelObj.Rollback() + // l.Logger.Error(err) + // return l.fail(utils.Fail) + //} + + if status == utils.StatusOk { + mobile, cErr := utils.DecryptPhone(info.UserMobile) + if cErr == nil { + l.sendPassword(mobile, oldPwd) + } + + //mobile, cErr := utils.Crypto{}.AESDecryptECB(info.UserMobile) + //if cErr == nil { + //result := utils.SendPwdSMS(mobile, oldPwd) + //jsonStr, err := json.Marshal(result) + //if err == nil { + // SmsLogService{}.Add(string(jsonStr)) + // if result.Code != utils.NumberZero { + // modelObj.Rollback() + // return l.fail(utils.Fail) + // } + //} + //} + } + + //TODO 站内消息 + //mErr := MessageService{}.Add(dao.TargetTypeAgent, dao.ObjTypeStore, status, info.SaleId, info.Id, content) + //if mErr != nil { + // model.Rollback() + // return mErr + //} + modelObj.Commit() + + return l.ok(utils.NumberOne) +} + +func (l *VerifyStatusLogic) updateUserPwd(info dao.StoreCreate) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.OrderName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := user.NewUserClient(cli.Conn()) + + mobile, sErr := utils.EncryptPhone(info.UserMobile) + if sErr != nil { + return utils.ErrorEncryptAesError + } + data := user.InternalUpdateReq{ + BizId: info.Id, + SubjectType: dao.UserTypeName, + Mobile: mobile, + Name: info.UserName, + ClientCode: strings.Split(info.StoreType, utils.DecollatorComma), //哪端 + CredentialType: []string{dao.LoginTypePassword, dao.LoginTypeSms}, + Identifier: mobile, //手机号 + } + _, err = client.InternalUpdate(context.Background(), &data) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok +} + +func (l *VerifyStatusLogic) sendPassword(mobile, password string) utils.Status { + cli, err := svc.GetRpcClient(l.svcCtx.ChoreName) + if err != nil { + logx.Errorf("get user err: %v", err) + return utils.ErrorInternalServer + } + + client := chore.NewChoreClient(cli.Conn()) + + _, err = client.SendPassword(context.Background(), &chore.SendPasswordReq{ + Mobile: mobile, + Password: password, + }) + if err != nil { + logx.Errorf("get order err: %v", err) + return utils.ErrorInternalServer + } + + return utils.Ok } diff --git a/services/store/internal/logic/webDepositCreateLogic.go b/services/store/internal/logic/webDepositCreateLogic.go index 252f3b1..9422cec 100644 --- a/services/store/internal/logic/webDepositCreateLogic.go +++ b/services/store/internal/logic/webDepositCreateLogic.go @@ -2,6 +2,10 @@ package logic import ( "context" + "lone-services/pkg/utils" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" + "lone-services/services/store/validator" "lone-services/rpc/store/pb" "lone-services/services/store/internal/svc" @@ -25,7 +29,26 @@ func NewWebDepositCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } func (l *WebDepositCreateLogic) WebDepositCreate(in *store.WebDepositCreateRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositCreateValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + info := dao.DepositCreate{ + StoreId: adminInfo.ID, + Amount: in.Amount, + Bill: in.Bill, + Status: utils.StatusWaitPass, + } + + err := model.DepositModel{}.Init().Create(&info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + return l.ok(utils.NumberOne) } diff --git a/services/store/internal/logic/webDepositItemsLogic.go b/services/store/internal/logic/webDepositItemsLogic.go index 6c3fcd2..a3d858c 100644 --- a/services/store/internal/logic/webDepositItemsLogic.go +++ b/services/store/internal/logic/webDepositItemsLogic.go @@ -2,9 +2,14 @@ package logic import ( "context" - + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" "lone-services/rpc/store/pb" + "lone-services/services/store/internal/dao" + "lone-services/services/store/internal/model" "lone-services/services/store/internal/svc" + "lone-services/services/store/validator" + "strconv" "github.com/zeromicro/go-zero/core/logx" ) @@ -25,7 +30,27 @@ func NewWebDepositItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *W } func (l *WebDepositItemsLogic) WebDepositItems(in *store.WebDepositItemsRequest) (*store.Response, error) { - // todo: add your logic here and delete this line + var v validator.DepositWebItemsValidator + if fail := l.checkParams(in, &v); fail != nil { + return fail, nil + } + adminInfo := utils.GetUserFromCtx(l.ctx) + if adminInfo.ID < utils.NumberOne { + return l.fail(utils.ErrorNoLoginInfo) + } - return &store.Response{}, nil + var info []dao.DepositWebInfo + w := modelbase.Params{ + Eq: map[string]string{"store_id": strconv.FormatInt(adminInfo.ID, utils.NumberTen)}, + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + + items, err := model.DepositModel{}.Init().Page(w, &info) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + return l.ok(items) } diff --git a/services/store/internal/model/deposit.go b/services/store/internal/model/deposit.go index ced9d81..3dae2e0 100644 --- a/services/store/internal/model/deposit.go +++ b/services/store/internal/model/deposit.go @@ -18,6 +18,6 @@ func (m DepositModel) Init() DepositModel { return m } -func (m DepositModel) Create(data *dao.StoreCreate) error { +func (m DepositModel) Create(data *dao.DepositCreate) error { return m.Base.Create(data) } diff --git a/services/store/internal/model/saleChangeHistory.go b/services/store/internal/model/saleChangeHistory.go new file mode 100644 index 0000000..818a9b4 --- /dev/null +++ b/services/store/internal/model/saleChangeHistory.go @@ -0,0 +1,23 @@ +package model + +import ( + "lone-services/pkg/modelbase" + "lone-services/services/store/internal/dao" +) + +type SaleChangeHistoryModel struct { + modelbase.Base +} + +func (m SaleChangeHistoryModel) TableName() string { + return modelbase.Prefix() + "sale_change_history" +} + +func (m SaleChangeHistoryModel) Init() SaleChangeHistoryModel { + m.Table = m.TableName() + return m +} + +func (m SaleChangeHistoryModel) Create(data *dao.SaleChangeHistoryCreate) error { + return m.Base.Create(data) +} diff --git a/services/store/internal/model/salesPersonHistory.go b/services/store/internal/model/salesPersonHistory.go deleted file mode 100644 index 4b8a0c0..0000000 --- a/services/store/internal/model/salesPersonHistory.go +++ /dev/null @@ -1,23 +0,0 @@ -package model - -import ( - "lone-services/pkg/modelbase" - "lone-services/services/store/internal/dao" -) - -type SalesPersonHistoryModel struct { - modelbase.Base -} - -func (m SalesPersonHistoryModel) TableName() string { - return modelbase.Prefix() + "deposit" -} - -func (m SalesPersonHistoryModel) Init() SalesPersonHistoryModel { - m.Table = m.TableName() - return m -} - -func (m SalesPersonHistoryModel) Create(data *dao.SalesPersonHistoryCreate) error { - return m.Base.Create(data) -} diff --git a/services/store/internal/server/storeServer.go b/services/store/internal/server/storeServer.go index ac5f072..9bb5b2e 100644 --- a/services/store/internal/server/storeServer.go +++ b/services/store/internal/server/storeServer.go @@ -108,7 +108,7 @@ func (s *StoreServer) DepositVerify(ctx context.Context, in *store.DepositVerify return l.DepositVerify(in) } -func (s *StoreServer) DepositDown(ctx context.Context, in *store.DepositItemsRequest) (*store.Response, error) { +func (s *StoreServer) DepositDown(ctx context.Context, in *store.DepositItemsRequest) (*store.ExcelExportResponse, error) { l := logic.NewDepositDownLogic(ctx, s.svcCtx) return l.DepositDown(in) } @@ -147,3 +147,13 @@ func (s *StoreServer) SetDef(ctx context.Context, in *store.EmptyRequest) (*stor l := logic.NewSetDefLogic(ctx, s.svcCtx) return l.SetDef(in) } + +func (s *StoreServer) GetInfoById(ctx context.Context, in *store.IdRequest) (*store.InfoResponse, error) { + l := logic.NewGetInfoByIdLogic(ctx, s.svcCtx) + return l.GetInfoById(in) +} + +func (s *StoreServer) GetInfoByIds(ctx context.Context, in *store.IdsRequest) (*store.ItemsResponse, error) { + l := logic.NewGetInfoByIdsLogic(ctx, s.svcCtx) + return l.GetInfoByIds(in) +} diff --git a/services/store/internal/svc/apply.go b/services/store/internal/svc/apply.go new file mode 100644 index 0000000..55cbd43 --- /dev/null +++ b/services/store/internal/svc/apply.go @@ -0,0 +1,142 @@ +package svc + +import ( + "context" + "lone-services/pkg/redis" + "lone-services/pkg/utils" + "strconv" + "time" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ApplySvc struct { +} + +type ApplyData struct { + Uid int `json:"uid"` + Id int `json:"id"` + Reason string `json:"reason"` + Status uint8 `json:"status"` //9为审核中,1为审核通过,2为审核驳回,0为没有申请 + Time string `json:"time"` + Type uint8 `json:"type"` +} + +const ( + applyProductEditKey = "apply:edit:product:" //产品redis KEY + applyStoreEditKey = "apply:edit:store:" //门店redis KEY + applyEditTimeOut = 60 * 24 + applyMd5Key = "keys:" +) + +func (l *ApplySvc) GetActionApply(uId, objId int) (ApplyData, utils.Status) { + key := l.getKey(applyStoreEditKey, uId, objId) + var data ApplyData + _, err := l.run(key, &data) + return data, err +} + +func (l *ApplySvc) getKey(key string, uId, id int) string { + return key + strconv.Itoa(uId) + "_" + strconv.Itoa(id) +} + +func (l *ApplySvc) Run(uId, objId int, Type uint8, reason string) (string, utils.Status) { + data := ApplyData{ + Uid: uId, + Id: objId, + Reason: reason, + Status: utils.StatusWaitPass, + Type: Type, + } + return l.run(applyStoreEditKey, &data) +} + +func (l *ApplySvc) run(key string, data *ApplyData) (string, utils.Status) { + redisKey := l.getKey(key, data.Uid, data.Id) + ctx := context.Background() + if len(data.Reason) > utils.NumberZero { + data.Time = utils.Now().String() + md5 := utils.MD5Encrypt(strconv.Itoa(data.Uid) + strconv.Itoa(data.Id) + data.Time) + jsonStr := utils.StructToJson(data) + expire := l.getOutTime() + _, err := redis.Client.Set(ctx, redisKey, jsonStr, time.Duration(expire)*time.Minute).Result() + if err != nil { + logx.Error(err) + return md5, utils.SetError(utils.Fail, err.Error()) + } + if data.Status == utils.StatusWaitPass { + _, err = redis.Client.Set(ctx, l.getMd5key(key+applyMd5Key, md5), redisKey, time.Duration(expire)*time.Minute).Result() + if err != nil { + logx.Error(err) + return md5, utils.SetError(utils.Fail, err.Error()) + } + } + return md5, utils.Ok + } + + result, err := redis.Client.Get(ctx, key).Result() + if err != nil && err.Error() != redis.RedisNil { + logx.Error(err) + return utils.StringEmpty, utils.SetError(utils.Fail, err.Error()) + } + if len(result) < utils.NumberFive { + return utils.StringEmpty, utils.Ok + } + if !utils.JsonStringToStruct(result, &data) { + return utils.StringEmpty, utils.SetError(utils.Fail, "数据解析失败") + } + return utils.StringEmpty, utils.Ok +} + +func (l *ApplySvc) getOutTime() int { + outTime := utils.GetConfigInt("apply.time_out") + if outTime <= utils.NumberZero { + outTime = applyEditTimeOut + } + return outTime +} + +func (l *ApplySvc) getMd5key(key, key2 string) string { + return key + key2 +} + +func (l *ApplySvc) SetActionApply(uId, objId int, Type uint8, reason string) utils.Status { + data := ApplyData{ + Uid: uId, + Id: objId, + Reason: reason, + Status: utils.StatusWaitPass, + Type: Type, + } + key, err := l.run(applyStoreEditKey, &data) + if err == utils.Ok { + // TODO 调取企业微信发消息 队列类型 + //qErr := QueueService{}.Create(utils.WecomStream, dao.WeComJob{ + // ObjId: objId, + // ObjType: Type, + // Type: dao.StoreApplyReview, + // Ext: map[string]any{ + // "reason": reason, + // "key": key, + // }, + //}) + // + //if qErr != nil { + // l.Logger.Error(qErr) + // return utils.Fail + //} + } + logx.Error(key) + + return utils.Ok +} + +func (l *ApplySvc) DelActionApply(uId, objId int) utils.Status { + key := l.getKey(applyStoreEditKey, uId, objId) + _, err := redis.Client.Del(context.Background(), key).Result() + if err != nil { + logx.Error(err) + return utils.SetError(utils.Fail, err.Error()) + } + return utils.Ok +} diff --git a/services/store/internal/svc/servicecontext.go b/services/store/internal/svc/servicecontext.go index 60d2c5e..b8de272 100644 --- a/services/store/internal/svc/servicecontext.go +++ b/services/store/internal/svc/servicecontext.go @@ -77,6 +77,8 @@ type ServiceContext struct { Prefix string SaleName string OrderName string + UserName string + ChoreName string } func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext { @@ -90,6 +92,16 @@ func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext { if OrderSvc == utils.StringEmpty { logx.Error("config services.order empty") } + //启动仅读取配置,不建立rpc连接 多个服务就多个 + UserSvc := utils.GetConfigString("services.user") + if UserSvc == utils.StringEmpty { + logx.Error("config services.user empty") + } + //启动仅读取配置,不建立rpc连接 多个服务就多个 + ChoreSvc := utils.GetConfigString("services.chore") + if ChoreSvc == utils.StringEmpty { + logx.Error("config services.chore empty") + } svcCtx := &ServiceContext{ Config: c, @@ -97,6 +109,8 @@ func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext { Prefix: utils.GetConfigString("mysql.prefix"), SaleName: SaleSvc, OrderName: OrderSvc, + UserName: UserSvc, + ChoreName: ChoreSvc, } return svcCtx diff --git a/services/store/internal/svc/weCom.go b/services/store/internal/svc/weCom.go new file mode 100644 index 0000000..8b7a1b6 --- /dev/null +++ b/services/store/internal/svc/weCom.go @@ -0,0 +1,17 @@ +package svc + +func WeCom(status, Type int32, id int64, reason string) { + //_ = QueueService{}.Create( + // utils.WecomStream, + // dao.WeComJob{ + // ObjId: id, + // ObjType: utils.EditLogTypeStore, + // Type: Type, + // Action: status, + // Ext: map[string]any{ + // "reason": reason, + // }, + // }, + //) + +} diff --git a/services/store/storeclient/store.go b/services/store/storeclient/store.go index 0495144..8fd29a4 100644 --- a/services/store/storeclient/store.go +++ b/services/store/storeclient/store.go @@ -23,8 +23,12 @@ type ( DepositVerifyRequest = store.DepositVerifyRequest EditRequest = store.EditRequest EmptyRequest = store.EmptyRequest + ExcelExportResponse = store.ExcelExportResponse IdRequest = store.IdRequest + IdsRequest = store.IdsRequest + InfoResponse = store.InfoResponse ItemsRequest = store.ItemsRequest + ItemsResponse = store.ItemsResponse Response = store.Response StatusRequest = store.StatusRequest ToSaleRequest = store.ToSaleRequest @@ -51,7 +55,7 @@ type ( DepositDone(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) DepositIgnore(ctx context.Context, in *DepositIgnoreRequest, opts ...grpc.CallOption) (*Response, error) DepositVerify(ctx context.Context, in *DepositVerifyRequest, opts ...grpc.CallOption) (*Response, error) - DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) + DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) DepositItems(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) DepositIgnoreItems(ctx context.Context, in *DepositVerifyRequest, opts ...grpc.CallOption) (*Response, error) DepositRecover(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) @@ -59,6 +63,8 @@ type ( WebDepositCreate(ctx context.Context, in *WebDepositCreateRequest, opts ...grpc.CallOption) (*Response, error) WebDepositItems(ctx context.Context, in *WebDepositItemsRequest, opts ...grpc.CallOption) (*Response, error) SetDef(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + GetInfoById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*InfoResponse, error) + GetInfoByIds(ctx context.Context, in *IdsRequest, opts ...grpc.CallOption) (*ItemsResponse, error) } defaultStore struct { @@ -157,7 +163,7 @@ func (m *defaultStore) DepositVerify(ctx context.Context, in *DepositVerifyReque return client.DepositVerify(ctx, in, opts...) } -func (m *defaultStore) DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultStore) DepositDown(ctx context.Context, in *DepositItemsRequest, opts ...grpc.CallOption) (*ExcelExportResponse, error) { client := store.NewStoreClient(m.cli.Conn()) return client.DepositDown(ctx, in, opts...) } @@ -196,3 +202,13 @@ func (m *defaultStore) SetDef(ctx context.Context, in *EmptyRequest, opts ...grp client := store.NewStoreClient(m.cli.Conn()) return client.SetDef(ctx, in, opts...) } + +func (m *defaultStore) GetInfoById(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + client := store.NewStoreClient(m.cli.Conn()) + return client.GetInfoById(ctx, in, opts...) +} + +func (m *defaultStore) GetInfoByIds(ctx context.Context, in *IdsRequest, opts ...grpc.CallOption) (*ItemsResponse, error) { + client := store.NewStoreClient(m.cli.Conn()) + return client.GetInfoByIds(ctx, in, opts...) +} diff --git a/services/store/validator/store.go b/services/store/validator/store.go index d698226..a33b8ea 100644 --- a/services/store/validator/store.go +++ b/services/store/validator/store.go @@ -263,3 +263,16 @@ func (p StoreWebPayPasswordValidator) GetMessage() validate.ValidatorMessages { "Password.required": "支付密码不能为空", } } + +type ApplyEditValidator struct { + Id int64 `form:"id" json:"id" validate:"required"` + Reason string `form:"reason" json:"reason" validate:"required"` +} + +// GetMessage 提示消息 +func (p ApplyEditValidator) GetMessage() validate.ValidatorMessages { + return validate.ValidatorMessages{ + validate.FieldId: validate.FieldIdValue, + "Reason.required": "理由不能为空", + } +} diff --git a/services/user/.gitignore b/services/user/.gitignore index 9ec6736..e4a1273 100644 --- a/services/user/.gitignore +++ b/services/user/.gitignore @@ -1,2 +1,3 @@ run.toml -etc/user.yaml \ No newline at end of file +etc/user.yaml +tmp \ No newline at end of file