From c33fbdb422f911c8e333a483077dddb619ef27da Mon Sep 17 00:00:00 2001 From: gjs Date: Fri, 21 Aug 2026 16:07:03 +0800 Subject: [PATCH] fix admin login log --- pkg/utils/log.go | 5 +- pkg/utils/loginInfo.go | 1 + rpc/lonelog/lonelog.pb | Bin 14425 -> 14638 bytes rpc/lonelog/lonelog.proto | 16 +- rpc/lonelog/pb/lonelog.pb.go | 119 ++- rpc/lonelog/pb/lonelog_grpc.pb.go | 44 +- rpc/order/order.pb | Bin 13592 -> 15800 bytes rpc/order/order.proto | 145 +++- rpc/order/pb/order.pb.go | 798 +++++++++++++++++- rpc/order/pb/order_grpc.pb.go | 470 ++++++++++- services/lonelog/internal/dao/actionLogs.go | 2 +- services/lonelog/internal/dao/loginLogs.go | 2 +- .../lonelog/internal/logic/loginItemsLogic.go | 64 ++ .../lonelog/internal/server/lonelogServer.go | 5 + .../lonelog/internal/service/logwatcher.go | 7 +- services/lonelog/lonelogClient/lonelog.go | 15 +- .../order/internal/logic/addressItemLogic.go | 30 + .../internal/logic/orderAuditingItemsLogic.go | 30 + .../internal/logic/orderAuditingLogic.go | 30 + .../order/internal/logic/orderCreateLogic.go | 30 + .../internal/logic/webAddressCreateLogic.go | 30 + .../internal/logic/webAddressDefLogic.go | 30 + .../internal/logic/webAddressEditLogic.go | 30 + .../internal/logic/webAddressItemsLogic.go | 30 + .../internal/logic/webAddressStatusLogic.go | 30 + .../order/internal/logic/webCartEditLogic.go | 30 + services/order/internal/logic/webCartLogic.go | 30 + .../order/internal/logic/webCreateLogic.go | 30 + services/order/internal/server/orderServer.go | 62 +- services/order/orderClient/order.go | 90 +- 30 files changed, 2131 insertions(+), 74 deletions(-) create mode 100644 services/lonelog/internal/logic/loginItemsLogic.go create mode 100644 services/order/internal/logic/addressItemLogic.go create mode 100644 services/order/internal/logic/orderAuditingItemsLogic.go create mode 100644 services/order/internal/logic/orderAuditingLogic.go create mode 100644 services/order/internal/logic/orderCreateLogic.go create mode 100644 services/order/internal/logic/webAddressCreateLogic.go create mode 100644 services/order/internal/logic/webAddressDefLogic.go create mode 100644 services/order/internal/logic/webAddressEditLogic.go create mode 100644 services/order/internal/logic/webAddressItemsLogic.go create mode 100644 services/order/internal/logic/webAddressStatusLogic.go create mode 100644 services/order/internal/logic/webCartEditLogic.go create mode 100644 services/order/internal/logic/webCartLogic.go create mode 100644 services/order/internal/logic/webCreateLogic.go diff --git a/pkg/utils/log.go b/pkg/utils/log.go index cf1936c..0c5df4d 100644 --- a/pkg/utils/log.go +++ b/pkg/utils/log.go @@ -3,6 +3,7 @@ package utils import ( "context" "lone-services/pkg/logRedis" + "time" jsoniter "github.com/json-iterator/go" "github.com/zeromicro/go-zero/core/logx" @@ -102,7 +103,7 @@ func SetActionLog(adminInfo UserInfo, info ActionAdd) { BrowserName: adminInfo.BrowserName, BrowserVersion: adminInfo.BrowserVer, Reason: info.Reason, - CreateTime: Now().GoString(), + CreateTime: Now().Format(time.DateTime), } logJson, err := jsoniter.Marshal(log) @@ -128,7 +129,7 @@ func SetLoginLog(adminInfo UserInfo, status bool, reason string) { BrowserName: adminInfo.BrowserName, BrowserVersion: adminInfo.BrowserVer, Status: int32(st), - CreateTime: Now().GoString(), + CreateTime: Now().Format(time.DateTime), Reason: reason, } diff --git a/pkg/utils/loginInfo.go b/pkg/utils/loginInfo.go index e5692ba..38f4bb3 100644 --- a/pkg/utils/loginInfo.go +++ b/pkg/utils/loginInfo.go @@ -51,6 +51,7 @@ func GetUserFromCtx(ctx context.Context) UserInfo { } if len(userAgentList) > 0 { userInfo.UserAgent = userAgentList[0] + userInfo.UserAgent, _ = url.QueryUnescape(userInfo.UserAgent) ua := user_agent.New(userInfo.UserAgent) userInfo.BrowserName, userInfo.BrowserVer = ua.Browser() } diff --git a/rpc/lonelog/lonelog.pb b/rpc/lonelog/lonelog.pb index a2d05991902fb777759b7d76a98240896623d099..8a9b6bda3251c42fc93db5f6a830a7ab746242f8 100644 GIT binary patch delta 171 zcmcavu&!vsV`HY1T$`U7cQNxRRdES=mZatu`{bu*=1tZ$G4SEzV#+L#U{+w%;0yw? zge18*5>s+B^Wrm8Bv^o=%t7p6zGsS%5En~HW^Sqks{%7nF_>*Mn~96vCqFMWCqG>% zXmYK&k*0jp&@L+fl@$+oHp+R E089!r6#xJL delta 48 zcmZ2ibhBW?V`HW-9GjmScQNxB9b)8S_sP#o&B;#}3Y`4Y+-P!(g*a lonelog.ItemsRequest - 2, // 1: lonelog.Lonelog.ActionAdd:input_type -> lonelog.ActionLog - 3, // 2: lonelog.Lonelog.LoginAdd:input_type -> lonelog.LoginLog - 1, // 3: lonelog.Lonelog.Items:output_type -> lonelog.Response - 1, // 4: lonelog.Lonelog.ActionAdd:output_type -> lonelog.Response - 1, // 5: lonelog.Lonelog.LoginAdd:output_type -> lonelog.Response - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type + 0, // 1: lonelog.Lonelog.LoginItems:input_type -> lonelog.ItemsRequest + 2, // 2: lonelog.Lonelog.ActionAdd:input_type -> lonelog.ActionLog + 3, // 3: lonelog.Lonelog.LoginAdd:input_type -> lonelog.LoginLog + 1, // 4: lonelog.Lonelog.Items:output_type -> lonelog.Response + 1, // 5: lonelog.Lonelog.LoginItems:output_type -> lonelog.Response + 1, // 6: lonelog.Lonelog.ActionAdd:output_type -> lonelog.Response + 1, // 7: lonelog.Lonelog.LoginAdd:output_type -> lonelog.Response + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] 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 @@ -500,7 +587,7 @@ func file_lonelog_lonelog_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_lonelog_lonelog_proto_rawDesc), len(file_lonelog_lonelog_proto_rawDesc)), NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/lonelog/pb/lonelog_grpc.pb.go b/rpc/lonelog/pb/lonelog_grpc.pb.go index 6dbf138..a990a77 100644 --- a/rpc/lonelog/pb/lonelog_grpc.pb.go +++ b/rpc/lonelog/pb/lonelog_grpc.pb.go @@ -19,9 +19,10 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Lonelog_Items_FullMethodName = "/lonelog.Lonelog/Items" - Lonelog_ActionAdd_FullMethodName = "/lonelog.Lonelog/ActionAdd" - Lonelog_LoginAdd_FullMethodName = "/lonelog.Lonelog/LoginAdd" + Lonelog_Items_FullMethodName = "/lonelog.Lonelog/Items" + Lonelog_LoginItems_FullMethodName = "/lonelog.Lonelog/LoginItems" + Lonelog_ActionAdd_FullMethodName = "/lonelog.Lonelog/ActionAdd" + Lonelog_LoginAdd_FullMethodName = "/lonelog.Lonelog/LoginAdd" ) // LonelogClient is the client API for Lonelog service. @@ -29,6 +30,7 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type LonelogClient interface { Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) } @@ -51,6 +53,16 @@ func (c *lonelogClient) Items(ctx context.Context, in *ItemsRequest, opts ...grp return out, nil } +func (c *lonelogClient) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Lonelog_LoginItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *lonelogClient) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) @@ -76,6 +88,7 @@ func (c *lonelogClient) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc // for forward compatibility. type LonelogServer interface { Items(context.Context, *ItemsRequest) (*Response, error) + LoginItems(context.Context, *ItemsRequest) (*Response, error) ActionAdd(context.Context, *ActionLog) (*Response, error) LoginAdd(context.Context, *LoginLog) (*Response, error) mustEmbedUnimplementedLonelogServer() @@ -91,6 +104,9 @@ type UnimplementedLonelogServer struct{} func (UnimplementedLonelogServer) Items(context.Context, *ItemsRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method Items not implemented") } +func (UnimplementedLonelogServer) LoginItems(context.Context, *ItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method LoginItems not implemented") +} func (UnimplementedLonelogServer) ActionAdd(context.Context, *ActionLog) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method ActionAdd not implemented") } @@ -136,6 +152,24 @@ func _Lonelog_Items_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Lonelog_LoginItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LonelogServer).LoginItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Lonelog_LoginItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LonelogServer).LoginItems(ctx, req.(*ItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Lonelog_ActionAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ActionLog) if err := dec(in); err != nil { @@ -183,6 +217,10 @@ var Lonelog_ServiceDesc = grpc.ServiceDesc{ MethodName: "Items", Handler: _Lonelog_Items_Handler, }, + { + MethodName: "LoginItems", + Handler: _Lonelog_LoginItems_Handler, + }, { MethodName: "ActionAdd", Handler: _Lonelog_ActionAdd_Handler, diff --git a/rpc/order/order.pb b/rpc/order/order.pb index 19f5584c7bf8614399b16133fe1ad0e5fdb8f0c3..2beb57ee43e43cb8bdb5171bee2673c9f2a246ff 100644 GIT binary patch delta 1916 zcmbVM%Wl(95LMEqi6?#DREg6^+Pb_KwbTR&5Gquqlt@SwZg~koabp)5HBPY|B*Y>T zzu*m@!3rT*vSCd>0a&u(3%E1)+Hq1M5IfJ@J7?ycd&X~{e|Y`wTQz-L2!B*BD?d{( zwe4B97cSLm9X1be-E3nnH=z`zc=M=C_ z%L&#+U4%3PIm___&uIjNqZo0_ROnRN~1fx+4KCLfh z%tyJp?G{oSfqxw74Ft#0~>(7L>Xb-RNtkeN90@&Lix$05QL=-=Ir5 z7EnmlFW~<>jf{5o&rZ`epiDMeZ*#_u`;5gHoWNQN_6F(rtGhnPc*$w-E zO-iu3g+g7g5II#V^poQYjP(y;qFXQCq#zM!?>NXQT}T{Jaq#7^_7-G$Ev_Q#uPI+D zQR68#8Z~b4dswv#d09n57Nc%lAcVrHug+0%QJYE@>yd^}ATJ*l2WB%8LFTxND%%$e)YVvm`aQSV&k8 PETA{}wT1oUskX`hwpSH6 diff --git a/rpc/order/order.proto b/rpc/order/order.proto index a581e6e..8ef430f 100644 --- a/rpc/order/order.proto +++ b/rpc/order/order.proto @@ -6,9 +6,16 @@ package order; option go_package = "lone-services/rpc/order"; -message ItemsRequest { +message OrderItemsRequest { int32 page = 1; int32 size = 2; + int64 product_id =3; + string order_sn = 4; + string mobile = 5; + int64 store_id = 6; + int64 sale_id = 7; + string time = 8; + int32 status = 9; } message Response { @@ -17,12 +24,146 @@ message Response { string data = 3; } +message CreateOrderRequest { + int64 address_id = 1; + string note = 2; +} + +message EditAddressRequest { + string district = 1; + string address = 2; + string name = 3; + string mobile = 4; + string district_ids = 5; + bool default = 6; + int64 id = 7; +} + +message StatusAddressRequest { + int64 id = 1; + int32 status = 2; +} + +message EmptyRequest { +} + +message EditCartRequest { + string info = 1; +} + +message IdRequest { + int64 id = 1; +} + +message AddressItemsRequest { + int32 page = 1; + int32 size = 2; + int64 district_id =3; + string name = 4; + string mobile = 5; + int64 store_id = 6; + int64 sale_id = 7; + string time = 8; +} + +message OrderAuditingItemsRequest { + int32 page = 1; + int32 size = 2; +} + +message OrderAuditingRequest { + int64 id = 1; + int32 status = 2; + string reason = 3; +} + +message AdminCreateOrderRequest { + int64 address_id = 1; + string note = 2; + string info = 3; +} service order { - rpc Items(ItemsRequest) returns(Response){ + rpc Items(OrderItemsRequest) returns(Response){ option (google.api.http) = { get: "/admin/v3/order/items" body: "*" }; }; + + rpc WebCreate(CreateOrderRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/order/create" + body: "*" + }; + }; + + rpc WebAddressCreate(EditAddressRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/address/create" + body: "*" + }; + }; + rpc WebAddressEdit(EditAddressRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/address/edit" + body: "*" + }; + }; + rpc WebAddressStatus(StatusAddressRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/address/status" + body: "*" + }; + }; + rpc WebAddressDef(IdRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/address/def" + body: "*" + }; + }; + rpc WebAddressItems(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/api/v3/address/items" + body: "*" + }; + }; + + rpc WebCart(EmptyRequest) returns(Response){ + option (google.api.http) = { + get: "/api/v3/cart" + body: "*" + }; + }; + rpc WebCartEdit(EditCartRequest) returns(Response){ + option (google.api.http) = { + post: "/api/v3/cart/edit" + body: "*" + }; + }; + + rpc AddressItem(AddressItemsRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/address/items" + body: "*" + }; + }; + rpc OrderAuditingItems(OrderAuditingItemsRequest) returns(Response){ + option (google.api.http) = { + get: "/admin/v3/order/auditing/items" + body: "*" + }; + }; + rpc OrderAuditing(OrderAuditingRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/order/auditing" + body: "*" + }; + }; + rpc OrderCreate(AdminCreateOrderRequest) returns(Response){ + option (google.api.http) = { + post: "/admin/v3/order/create" + body: "*" + }; + }; } \ No newline at end of file diff --git a/rpc/order/pb/order.pb.go b/rpc/order/pb/order.pb.go index 20979dd..abc4474 100644 --- a/rpc/order/pb/order.pb.go +++ b/rpc/order/pb/order.pb.go @@ -22,28 +22,35 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type ItemsRequest struct { +type OrderItemsRequest 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"` + ProductId int64 `protobuf:"varint,3,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + OrderSn string `protobuf:"bytes,4,opt,name=order_sn,json=orderSn,proto3" json:"order_sn,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` + StoreId int64 `protobuf:"varint,6,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` + SaleId int64 `protobuf:"varint,7,opt,name=sale_id,json=saleId,proto3" json:"sale_id,omitempty"` + Time string `protobuf:"bytes,8,opt,name=time,proto3" json:"time,omitempty"` + Status int32 `protobuf:"varint,9,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *ItemsRequest) Reset() { - *x = ItemsRequest{} +func (x *OrderItemsRequest) Reset() { + *x = OrderItemsRequest{} mi := &file_order_order_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *ItemsRequest) String() string { +func (x *OrderItemsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ItemsRequest) ProtoMessage() {} +func (*OrderItemsRequest) ProtoMessage() {} -func (x *ItemsRequest) ProtoReflect() protoreflect.Message { +func (x *OrderItemsRequest) ProtoReflect() protoreflect.Message { mi := &file_order_order_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -55,25 +62,74 @@ func (x *ItemsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ItemsRequest.ProtoReflect.Descriptor instead. -func (*ItemsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use OrderItemsRequest.ProtoReflect.Descriptor instead. +func (*OrderItemsRequest) Descriptor() ([]byte, []int) { return file_order_order_proto_rawDescGZIP(), []int{0} } -func (x *ItemsRequest) GetPage() int32 { +func (x *OrderItemsRequest) GetPage() int32 { if x != nil { return x.Page } return 0 } -func (x *ItemsRequest) GetSize() int32 { +func (x *OrderItemsRequest) GetSize() int32 { if x != nil { return x.Size } return 0 } +func (x *OrderItemsRequest) GetProductId() int64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *OrderItemsRequest) GetOrderSn() string { + if x != nil { + return x.OrderSn + } + return "" +} + +func (x *OrderItemsRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *OrderItemsRequest) GetStoreId() int64 { + if x != nil { + return x.StoreId + } + return 0 +} + +func (x *OrderItemsRequest) GetSaleId() int64 { + if x != nil { + return x.SaleId + } + return 0 +} + +func (x *OrderItemsRequest) GetTime() string { + if x != nil { + return x.Time + } + return "" +} + +func (x *OrderItemsRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + type Response struct { state protoimpl.MessageState `protogen:"open.v1"` Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` @@ -134,20 +190,674 @@ func (x *Response) GetData() string { return "" } +type CreateOrderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AddressId int64 `protobuf:"varint,1,opt,name=address_id,json=addressId,proto3" json:"address_id,omitempty"` + Note string `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrderRequest) Reset() { + *x = CreateOrderRequest{} + mi := &file_order_order_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrderRequest) ProtoMessage() {} + +func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 CreateOrderRequest.ProtoReflect.Descriptor instead. +func (*CreateOrderRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateOrderRequest) GetAddressId() int64 { + if x != nil { + return x.AddressId + } + return 0 +} + +func (x *CreateOrderRequest) GetNote() string { + if x != nil { + return x.Note + } + return "" +} + +type EditAddressRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + District string `protobuf:"bytes,1,opt,name=district,proto3" json:"district,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Mobile string `protobuf:"bytes,4,opt,name=mobile,proto3" json:"mobile,omitempty"` + DistrictIds string `protobuf:"bytes,5,opt,name=district_ids,json=districtIds,proto3" json:"district_ids,omitempty"` + Default bool `protobuf:"varint,6,opt,name=default,proto3" json:"default,omitempty"` + Id int64 `protobuf:"varint,7,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EditAddressRequest) Reset() { + *x = EditAddressRequest{} + mi := &file_order_order_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EditAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditAddressRequest) ProtoMessage() {} + +func (x *EditAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditAddressRequest.ProtoReflect.Descriptor instead. +func (*EditAddressRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{3} +} + +func (x *EditAddressRequest) GetDistrict() string { + if x != nil { + return x.District + } + return "" +} + +func (x *EditAddressRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *EditAddressRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EditAddressRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *EditAddressRequest) GetDistrictIds() string { + if x != nil { + return x.DistrictIds + } + return "" +} + +func (x *EditAddressRequest) GetDefault() bool { + if x != nil { + return x.Default + } + return false +} + +func (x *EditAddressRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type StatusAddressRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusAddressRequest) Reset() { + *x = StatusAddressRequest{} + mi := &file_order_order_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusAddressRequest) ProtoMessage() {} + +func (x *StatusAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusAddressRequest.ProtoReflect.Descriptor instead. +func (*StatusAddressRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{4} +} + +func (x *StatusAddressRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StatusAddressRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type EmptyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + mi := &file_order_order_proto_msgTypes[5] + 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_order_order_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{5} +} + +type EditCartRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EditCartRequest) Reset() { + *x = EditCartRequest{} + mi := &file_order_order_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EditCartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditCartRequest) ProtoMessage() {} + +func (x *EditCartRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 EditCartRequest.ProtoReflect.Descriptor instead. +func (*EditCartRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{6} +} + +func (x *EditCartRequest) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + +type IdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdRequest) Reset() { + *x = IdRequest{} + mi := &file_order_order_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdRequest) ProtoMessage() {} + +func (x *IdRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 IdRequest.ProtoReflect.Descriptor instead. +func (*IdRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{7} +} + +func (x *IdRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type AddressItemsRequest 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"` + DistrictId int64 `protobuf:"varint,3,opt,name=district_id,json=districtId,proto3" json:"district_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` + StoreId int64 `protobuf:"varint,6,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` + SaleId int64 `protobuf:"varint,7,opt,name=sale_id,json=saleId,proto3" json:"sale_id,omitempty"` + Time string `protobuf:"bytes,8,opt,name=time,proto3" json:"time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddressItemsRequest) Reset() { + *x = AddressItemsRequest{} + mi := &file_order_order_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddressItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddressItemsRequest) ProtoMessage() {} + +func (x *AddressItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 AddressItemsRequest.ProtoReflect.Descriptor instead. +func (*AddressItemsRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{8} +} + +func (x *AddressItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *AddressItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *AddressItemsRequest) GetDistrictId() int64 { + if x != nil { + return x.DistrictId + } + return 0 +} + +func (x *AddressItemsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddressItemsRequest) GetMobile() string { + if x != nil { + return x.Mobile + } + return "" +} + +func (x *AddressItemsRequest) GetStoreId() int64 { + if x != nil { + return x.StoreId + } + return 0 +} + +func (x *AddressItemsRequest) GetSaleId() int64 { + if x != nil { + return x.SaleId + } + return 0 +} + +func (x *AddressItemsRequest) GetTime() string { + if x != nil { + return x.Time + } + return "" +} + +type OrderAuditingItemsRequest 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 *OrderAuditingItemsRequest) Reset() { + *x = OrderAuditingItemsRequest{} + mi := &file_order_order_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OrderAuditingItemsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrderAuditingItemsRequest) ProtoMessage() {} + +func (x *OrderAuditingItemsRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 OrderAuditingItemsRequest.ProtoReflect.Descriptor instead. +func (*OrderAuditingItemsRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{9} +} + +func (x *OrderAuditingItemsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *OrderAuditingItemsRequest) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +type OrderAuditingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OrderAuditingRequest) Reset() { + *x = OrderAuditingRequest{} + mi := &file_order_order_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OrderAuditingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrderAuditingRequest) ProtoMessage() {} + +func (x *OrderAuditingRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 OrderAuditingRequest.ProtoReflect.Descriptor instead. +func (*OrderAuditingRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{10} +} + +func (x *OrderAuditingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *OrderAuditingRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *OrderAuditingRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type AdminCreateOrderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AddressId int64 `protobuf:"varint,1,opt,name=address_id,json=addressId,proto3" json:"address_id,omitempty"` + Note string `protobuf:"bytes,2,opt,name=note,proto3" json:"note,omitempty"` + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminCreateOrderRequest) Reset() { + *x = AdminCreateOrderRequest{} + mi := &file_order_order_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminCreateOrderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminCreateOrderRequest) ProtoMessage() {} + +func (x *AdminCreateOrderRequest) ProtoReflect() protoreflect.Message { + mi := &file_order_order_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 AdminCreateOrderRequest.ProtoReflect.Descriptor instead. +func (*AdminCreateOrderRequest) Descriptor() ([]byte, []int) { + return file_order_order_proto_rawDescGZIP(), []int{11} +} + +func (x *AdminCreateOrderRequest) GetAddressId() int64 { + if x != nil { + return x.AddressId + } + return 0 +} + +func (x *AdminCreateOrderRequest) GetNote() string { + if x != nil { + return x.Note + } + return "" +} + +func (x *AdminCreateOrderRequest) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + var File_order_order_proto protoreflect.FileDescriptor const file_order_order_proto_rawDesc = "" + "\n" + - "\x11order/order.proto\x12\x05order\x1a\x1cgoogle/api/annotations.proto\"6\n" + - "\fItemsRequest\x12\x12\n" + + "\x11order/order.proto\x12\x05order\x1a\x1cgoogle/api/annotations.proto\"\xed\x01\n" + + "\x11OrderItemsRequest\x12\x12\n" + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + - "\x04size\x18\x02 \x01(\x05R\x04size\"D\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x1d\n" + + "\n" + + "product_id\x18\x03 \x01(\x03R\tproductId\x12\x19\n" + + "\border_sn\x18\x04 \x01(\tR\aorderSn\x12\x16\n" + + "\x06mobile\x18\x05 \x01(\tR\x06mobile\x12\x19\n" + + "\bstore_id\x18\x06 \x01(\x03R\astoreId\x12\x17\n" + + "\asale_id\x18\a \x01(\x03R\x06saleId\x12\x12\n" + + "\x04time\x18\b \x01(\tR\x04time\x12\x16\n" + + "\x06status\x18\t \x01(\x05R\x06status\"D\n" + "\bResponse\x12\x12\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" + "\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" + - "\x04data\x18\x03 \x01(\tR\x04data2X\n" + - "\x05order\x12O\n" + - "\x05Items\x12\x13.order.ItemsRequest\x1a\x0f.order.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/order/itemsB\x19Z\x17lone-services/rpc/orderb\x06proto3" + "\x04data\x18\x03 \x01(\tR\x04data\"G\n" + + "\x12CreateOrderRequest\x12\x1d\n" + + "\n" + + "address_id\x18\x01 \x01(\x03R\taddressId\x12\x12\n" + + "\x04note\x18\x02 \x01(\tR\x04note\"\xc3\x01\n" + + "\x12EditAddressRequest\x12\x1a\n" + + "\bdistrict\x18\x01 \x01(\tR\bdistrict\x12\x18\n" + + "\aaddress\x18\x02 \x01(\tR\aaddress\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + + "\x06mobile\x18\x04 \x01(\tR\x06mobile\x12!\n" + + "\fdistrict_ids\x18\x05 \x01(\tR\vdistrictIds\x12\x18\n" + + "\adefault\x18\x06 \x01(\bR\adefault\x12\x0e\n" + + "\x02id\x18\a \x01(\x03R\x02id\">\n" + + "\x14StatusAddressRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\"\x0e\n" + + "\fEmptyRequest\"%\n" + + "\x0fEditCartRequest\x12\x12\n" + + "\x04info\x18\x01 \x01(\tR\x04info\"\x1b\n" + + "\tIdRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\xd2\x01\n" + + "\x13AddressItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\x12\x1f\n" + + "\vdistrict_id\x18\x03 \x01(\x03R\n" + + "districtId\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x16\n" + + "\x06mobile\x18\x05 \x01(\tR\x06mobile\x12\x19\n" + + "\bstore_id\x18\x06 \x01(\x03R\astoreId\x12\x17\n" + + "\asale_id\x18\a \x01(\x03R\x06saleId\x12\x12\n" + + "\x04time\x18\b \x01(\tR\x04time\"C\n" + + "\x19OrderAuditingItemsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x02 \x01(\x05R\x04size\"V\n" + + "\x14OrderAuditingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" + + "\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"`\n" + + "\x17AdminCreateOrderRequest\x12\x1d\n" + + "\n" + + "address_id\x18\x01 \x01(\x03R\taddressId\x12\x12\n" + + "\x04note\x18\x02 \x01(\tR\x04note\x12\x12\n" + + "\x04info\x18\x03 \x01(\tR\x04info2\xc8\t\n" + + "\x05order\x12T\n" + + "\x05Items\x12\x18.order.OrderItemsRequest\x1a\x0f.order.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/order/items\x12X\n" + + "\tWebCreate\x12\x19.order.CreateOrderRequest\x1a\x0f.order.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/api/v3/order/create\x12a\n" + + "\x10WebAddressCreate\x12\x19.order.EditAddressRequest\x1a\x0f.order.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/api/v3/address/create\x12]\n" + + "\x0eWebAddressEdit\x12\x19.order.EditAddressRequest\x1a\x0f.order.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\"\x14/api/v3/address/edit\x12c\n" + + "\x10WebAddressStatus\x12\x1b.order.StatusAddressRequest\x1a\x0f.order.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/api/v3/address/status\x12R\n" + + "\rWebAddressDef\x12\x10.order.IdRequest\x1a\x0f.order.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/api/v3/address/def\x12Y\n" + + "\x0fWebAddressItems\x12\x13.order.EmptyRequest\x1a\x0f.order.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/api/v3/address/items\x12H\n" + + "\aWebCart\x12\x13.order.EmptyRequest\x1a\x0f.order.Response\"\x17\x82\xd3\xe4\x93\x02\x11:\x01*\x12\f/api/v3/cart\x12T\n" + + "\vWebCartEdit\x12\x16.order.EditCartRequest\x1a\x0f.order.Response\"\x1c\x82\xd3\xe4\x93\x02\x16:\x01*\"\x11/api/v3/cart/edit\x12^\n" + + "\vAddressItem\x12\x1a.order.AddressItemsRequest\x1a\x0f.order.Response\"\"\x82\xd3\xe4\x93\x02\x1c:\x01*\x12\x17/admin/v3/address/items\x12r\n" + + "\x12OrderAuditingItems\x12 .order.OrderAuditingItemsRequest\x1a\x0f.order.Response\")\x82\xd3\xe4\x93\x02#:\x01*\x12\x1e/admin/v3/order/auditing/items\x12b\n" + + "\rOrderAuditing\x12\x1b.order.OrderAuditingRequest\x1a\x0f.order.Response\"#\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/admin/v3/order/auditing\x12a\n" + + "\vOrderCreate\x12\x1e.order.AdminCreateOrderRequest\x1a\x0f.order.Response\"!\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/admin/v3/order/createB\x19Z\x17lone-services/rpc/orderb\x06proto3" var ( file_order_order_proto_rawDescOnce sync.Once @@ -161,19 +871,53 @@ func file_order_order_proto_rawDescGZIP() []byte { return file_order_order_proto_rawDescData } -var file_order_order_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_order_order_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_order_order_proto_goTypes = []any{ - (*ItemsRequest)(nil), // 0: order.ItemsRequest - (*Response)(nil), // 1: order.Response + (*OrderItemsRequest)(nil), // 0: order.OrderItemsRequest + (*Response)(nil), // 1: order.Response + (*CreateOrderRequest)(nil), // 2: order.CreateOrderRequest + (*EditAddressRequest)(nil), // 3: order.EditAddressRequest + (*StatusAddressRequest)(nil), // 4: order.StatusAddressRequest + (*EmptyRequest)(nil), // 5: order.EmptyRequest + (*EditCartRequest)(nil), // 6: order.EditCartRequest + (*IdRequest)(nil), // 7: order.IdRequest + (*AddressItemsRequest)(nil), // 8: order.AddressItemsRequest + (*OrderAuditingItemsRequest)(nil), // 9: order.OrderAuditingItemsRequest + (*OrderAuditingRequest)(nil), // 10: order.OrderAuditingRequest + (*AdminCreateOrderRequest)(nil), // 11: order.AdminCreateOrderRequest } var file_order_order_proto_depIdxs = []int32{ - 0, // 0: order.order.Items:input_type -> order.ItemsRequest - 1, // 1: order.order.Items:output_type -> order.Response - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] 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 + 0, // 0: order.order.Items:input_type -> order.OrderItemsRequest + 2, // 1: order.order.WebCreate:input_type -> order.CreateOrderRequest + 3, // 2: order.order.WebAddressCreate:input_type -> order.EditAddressRequest + 3, // 3: order.order.WebAddressEdit:input_type -> order.EditAddressRequest + 4, // 4: order.order.WebAddressStatus:input_type -> order.StatusAddressRequest + 7, // 5: order.order.WebAddressDef:input_type -> order.IdRequest + 5, // 6: order.order.WebAddressItems:input_type -> order.EmptyRequest + 5, // 7: order.order.WebCart:input_type -> order.EmptyRequest + 6, // 8: order.order.WebCartEdit:input_type -> order.EditCartRequest + 8, // 9: order.order.AddressItem:input_type -> order.AddressItemsRequest + 9, // 10: order.order.OrderAuditingItems:input_type -> order.OrderAuditingItemsRequest + 10, // 11: order.order.OrderAuditing:input_type -> order.OrderAuditingRequest + 11, // 12: order.order.OrderCreate:input_type -> order.AdminCreateOrderRequest + 1, // 13: order.order.Items:output_type -> order.Response + 1, // 14: order.order.WebCreate:output_type -> order.Response + 1, // 15: order.order.WebAddressCreate:output_type -> order.Response + 1, // 16: order.order.WebAddressEdit:output_type -> order.Response + 1, // 17: order.order.WebAddressStatus:output_type -> order.Response + 1, // 18: order.order.WebAddressDef:output_type -> order.Response + 1, // 19: order.order.WebAddressItems:output_type -> order.Response + 1, // 20: order.order.WebCart:output_type -> order.Response + 1, // 21: order.order.WebCartEdit:output_type -> order.Response + 1, // 22: order.order.AddressItem:output_type -> order.Response + 1, // 23: order.order.OrderAuditingItems:output_type -> order.Response + 1, // 24: order.order.OrderAuditing:output_type -> order.Response + 1, // 25: order.order.OrderCreate:output_type -> order.Response + 13, // [13:26] is the sub-list for method output_type + 0, // [0:13] 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_order_order_proto_init() } @@ -187,7 +931,7 @@ func file_order_order_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_order_order_proto_rawDesc), len(file_order_order_proto_rawDesc)), NumEnums: 0, - NumMessages: 2, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/order/pb/order_grpc.pb.go b/rpc/order/pb/order_grpc.pb.go index 7d62014..9262df6 100644 --- a/rpc/order/pb/order_grpc.pb.go +++ b/rpc/order/pb/order_grpc.pb.go @@ -19,14 +19,38 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Order_Items_FullMethodName = "/order.order/Items" + Order_Items_FullMethodName = "/order.order/Items" + Order_WebCreate_FullMethodName = "/order.order/WebCreate" + Order_WebAddressCreate_FullMethodName = "/order.order/WebAddressCreate" + Order_WebAddressEdit_FullMethodName = "/order.order/WebAddressEdit" + Order_WebAddressStatus_FullMethodName = "/order.order/WebAddressStatus" + Order_WebAddressDef_FullMethodName = "/order.order/WebAddressDef" + Order_WebAddressItems_FullMethodName = "/order.order/WebAddressItems" + Order_WebCart_FullMethodName = "/order.order/WebCart" + Order_WebCartEdit_FullMethodName = "/order.order/WebCartEdit" + Order_AddressItem_FullMethodName = "/order.order/AddressItem" + Order_OrderAuditingItems_FullMethodName = "/order.order/OrderAuditingItems" + Order_OrderAuditing_FullMethodName = "/order.order/OrderAuditing" + Order_OrderCreate_FullMethodName = "/order.order/OrderCreate" ) // OrderClient is the client API for Order service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type OrderClient interface { - Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) + WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + WebCart(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error) + AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error) + OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error) + OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) + OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) } type orderClient struct { @@ -37,7 +61,7 @@ func NewOrderClient(cc grpc.ClientConnInterface) OrderClient { return &orderClient{cc} } -func (c *orderClient) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (c *orderClient) Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) err := c.cc.Invoke(ctx, Order_Items_FullMethodName, in, out, cOpts...) @@ -47,11 +71,143 @@ func (c *orderClient) Items(ctx context.Context, in *ItemsRequest, opts ...grpc. return out, nil } +func (c *orderClient) WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebAddressCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebAddressEdit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebAddressStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebAddressDef_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebAddressItems(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, Order_WebAddressItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebCart(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, Order_WebCart_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_WebCartEdit_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_AddressItem_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_OrderAuditingItems_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_OrderAuditing_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *orderClient) OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, Order_OrderCreate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // OrderServer is the server API for Order service. // All implementations must embed UnimplementedOrderServer // for forward compatibility. type OrderServer interface { - Items(context.Context, *ItemsRequest) (*Response, error) + Items(context.Context, *OrderItemsRequest) (*Response, error) + WebCreate(context.Context, *CreateOrderRequest) (*Response, error) + WebAddressCreate(context.Context, *EditAddressRequest) (*Response, error) + WebAddressEdit(context.Context, *EditAddressRequest) (*Response, error) + WebAddressStatus(context.Context, *StatusAddressRequest) (*Response, error) + WebAddressDef(context.Context, *IdRequest) (*Response, error) + WebAddressItems(context.Context, *EmptyRequest) (*Response, error) + WebCart(context.Context, *EmptyRequest) (*Response, error) + WebCartEdit(context.Context, *EditCartRequest) (*Response, error) + AddressItem(context.Context, *AddressItemsRequest) (*Response, error) + OrderAuditingItems(context.Context, *OrderAuditingItemsRequest) (*Response, error) + OrderAuditing(context.Context, *OrderAuditingRequest) (*Response, error) + OrderCreate(context.Context, *AdminCreateOrderRequest) (*Response, error) mustEmbedUnimplementedOrderServer() } @@ -62,9 +218,45 @@ type OrderServer interface { // pointer dereference when methods are called. type UnimplementedOrderServer struct{} -func (UnimplementedOrderServer) Items(context.Context, *ItemsRequest) (*Response, error) { +func (UnimplementedOrderServer) Items(context.Context, *OrderItemsRequest) (*Response, error) { return nil, status.Error(codes.Unimplemented, "method Items not implemented") } +func (UnimplementedOrderServer) WebCreate(context.Context, *CreateOrderRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebCreate not implemented") +} +func (UnimplementedOrderServer) WebAddressCreate(context.Context, *EditAddressRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebAddressCreate not implemented") +} +func (UnimplementedOrderServer) WebAddressEdit(context.Context, *EditAddressRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebAddressEdit not implemented") +} +func (UnimplementedOrderServer) WebAddressStatus(context.Context, *StatusAddressRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebAddressStatus not implemented") +} +func (UnimplementedOrderServer) WebAddressDef(context.Context, *IdRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebAddressDef not implemented") +} +func (UnimplementedOrderServer) WebAddressItems(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebAddressItems not implemented") +} +func (UnimplementedOrderServer) WebCart(context.Context, *EmptyRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebCart not implemented") +} +func (UnimplementedOrderServer) WebCartEdit(context.Context, *EditCartRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method WebCartEdit not implemented") +} +func (UnimplementedOrderServer) AddressItem(context.Context, *AddressItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method AddressItem not implemented") +} +func (UnimplementedOrderServer) OrderAuditingItems(context.Context, *OrderAuditingItemsRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method OrderAuditingItems not implemented") +} +func (UnimplementedOrderServer) OrderAuditing(context.Context, *OrderAuditingRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method OrderAuditing not implemented") +} +func (UnimplementedOrderServer) OrderCreate(context.Context, *AdminCreateOrderRequest) (*Response, error) { + return nil, status.Error(codes.Unimplemented, "method OrderCreate not implemented") +} func (UnimplementedOrderServer) mustEmbedUnimplementedOrderServer() {} func (UnimplementedOrderServer) testEmbeddedByValue() {} @@ -87,7 +279,7 @@ func RegisterOrderServer(s grpc.ServiceRegistrar, srv OrderServer) { } func _Order_Items_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ItemsRequest) + in := new(OrderItemsRequest) if err := dec(in); err != nil { return nil, err } @@ -99,7 +291,223 @@ func _Order_Items_Handler(srv interface{}, ctx context.Context, dec func(interfa FullMethod: Order_Items_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrderServer).Items(ctx, req.(*ItemsRequest)) + return srv.(OrderServer).Items(ctx, req.(*OrderItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).WebCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebCreate(ctx, req.(*CreateOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebAddressCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EditAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).WebAddressCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebAddressCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebAddressCreate(ctx, req.(*EditAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebAddressEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EditAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).WebAddressEdit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebAddressEdit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebAddressEdit(ctx, req.(*EditAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebAddressStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).WebAddressStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebAddressStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebAddressStatus(ctx, req.(*StatusAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebAddressDef_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.(OrderServer).WebAddressDef(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebAddressDef_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebAddressDef(ctx, req.(*IdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebAddressItems_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.(OrderServer).WebAddressItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebAddressItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebAddressItems(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebCart_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.(OrderServer).WebCart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebCart_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebCart(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_WebCartEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EditCartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).WebCartEdit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_WebCartEdit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).WebCartEdit(ctx, req.(*EditCartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_AddressItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddressItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).AddressItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_AddressItem_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).AddressItem(ctx, req.(*AddressItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_OrderAuditingItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OrderAuditingItemsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).OrderAuditingItems(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_OrderAuditingItems_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).OrderAuditingItems(ctx, req.(*OrderAuditingItemsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_OrderAuditing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OrderAuditingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).OrderAuditing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_OrderAuditing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).OrderAuditing(ctx, req.(*OrderAuditingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Order_OrderCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminCreateOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrderServer).OrderCreate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Order_OrderCreate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrderServer).OrderCreate(ctx, req.(*AdminCreateOrderRequest)) } return interceptor(ctx, in, info, handler) } @@ -115,6 +523,54 @@ var Order_ServiceDesc = grpc.ServiceDesc{ MethodName: "Items", Handler: _Order_Items_Handler, }, + { + MethodName: "WebCreate", + Handler: _Order_WebCreate_Handler, + }, + { + MethodName: "WebAddressCreate", + Handler: _Order_WebAddressCreate_Handler, + }, + { + MethodName: "WebAddressEdit", + Handler: _Order_WebAddressEdit_Handler, + }, + { + MethodName: "WebAddressStatus", + Handler: _Order_WebAddressStatus_Handler, + }, + { + MethodName: "WebAddressDef", + Handler: _Order_WebAddressDef_Handler, + }, + { + MethodName: "WebAddressItems", + Handler: _Order_WebAddressItems_Handler, + }, + { + MethodName: "WebCart", + Handler: _Order_WebCart_Handler, + }, + { + MethodName: "WebCartEdit", + Handler: _Order_WebCartEdit_Handler, + }, + { + MethodName: "AddressItem", + Handler: _Order_AddressItem_Handler, + }, + { + MethodName: "OrderAuditingItems", + Handler: _Order_OrderAuditingItems_Handler, + }, + { + MethodName: "OrderAuditing", + Handler: _Order_OrderAuditing_Handler, + }, + { + MethodName: "OrderCreate", + Handler: _Order_OrderCreate_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "order/order.proto", diff --git a/services/lonelog/internal/dao/actionLogs.go b/services/lonelog/internal/dao/actionLogs.go index 240cdd8..78d7821 100644 --- a/services/lonelog/internal/dao/actionLogs.go +++ b/services/lonelog/internal/dao/actionLogs.go @@ -12,7 +12,7 @@ type ActionLog struct { ModuleName string `gorm:"column:module_name;type:varchar(255);comment:操作模块名,如管理员;NOT NULL" json:"module_name"` Ip string `gorm:"column:ip;type:varchar(20);comment:IP;NOT NULL" json:"ip"` BrowserInfo string `gorm:"column:browser_info;type:varchar(255);comment:浏览器详细信息" json:"browser_info"` - BrowserName string `gorm:"column:browser_name;type:varchar(50);comment:浏览器名称" json:"browser_name"` + BrowserName string `gorm:"column:browser_name;type:varchar(255);comment:浏览器名称" json:"browser_name"` BrowserVersion string `gorm:"column:browser_version;type:varchar(50);comment:版本" json:"browser_version"` Reason string `gorm:"column:reason;type:varchar(255);comment:原因" json:"reason"` CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:NULL;comment:添加时间;NOT NULL" json:"create_time"` diff --git a/services/lonelog/internal/dao/loginLogs.go b/services/lonelog/internal/dao/loginLogs.go index 58fc544..52f5e22 100644 --- a/services/lonelog/internal/dao/loginLogs.go +++ b/services/lonelog/internal/dao/loginLogs.go @@ -8,7 +8,7 @@ type LoginLog struct { AdminName string `gorm:"column:admin_name;type:varchar(255);comment:登录人姓名" json:"admin_name"` Ip string `gorm:"column:ip;type:varchar(50);comment:IP;NOT NULL" json:"ip"` BrowserInfo string `gorm:"column:browser_info;type:varchar(255);comment:浏览器详细信息" json:"browser_info"` - BrowserName string `gorm:"column:browser_name;type:varchar(50);comment:浏览器名称" json:"browser_name"` + BrowserName string `gorm:"column:browser_name;type:varchar(255);comment:浏览器名称" json:"browser_name"` BrowserVersion string `gorm:"column:browser_version;type:varchar(50);comment:浏览器版本" json:"browser_version"` Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态,1为成功,2为失败" json:"status"` CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;comment:添加时间;NOT NULL" json:"create_time"` diff --git a/services/lonelog/internal/logic/loginItemsLogic.go b/services/lonelog/internal/logic/loginItemsLogic.go new file mode 100644 index 0000000..9e82aa5 --- /dev/null +++ b/services/lonelog/internal/logic/loginItemsLogic.go @@ -0,0 +1,64 @@ +package logic + +import ( + "context" + "lone-services/pkg/modelbase" + "lone-services/pkg/utils" + "lone-services/services/lonelog/internal/dao" + "lone-services/services/lonelog/internal/model" + "strconv" + + "lone-services/rpc/lonelog/pb" + "lone-services/services/lonelog/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type LoginItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger + BaseLogic +} + +func NewLoginItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LoginItemsLogic { + return &LoginItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *LoginItemsLogic) LoginItems(in *lonelog.ItemsRequest) (*lonelog.Response, error) { + modelObj := model.LoginModel{}.Init() + w := modelbase.Params{ + Page: int(in.Page), + Size: int(in.Size), + Order: "id desc", + } + w.Like = make(map[string]string) + eq := make(map[string]string) + w.Other = make(map[string]string) + if in.AdminId > utils.NumberZero { + eq["admin_id"] = strconv.FormatInt(in.AdminId, utils.NumberTen) + } + + if len(in.Ip) > utils.NumberZero { + w.Like["ip LIKE ? "] = "%%" + in.Ip + "%%" + } + + if len(in.Time) > utils.NumberZero { + w.Other["create_time > ?"] = in.Time[utils.NumberZero] + w.Other["create_time < ?"] = in.Time[utils.NumberOne] + } + + w.Eq = eq + var data []dao.LoginLog + items, err := modelObj.Page(w, &data) + if err != nil { + l.Logger.Error(err) + return l.fail(utils.Fail) + } + + return l.ok(items) +} diff --git a/services/lonelog/internal/server/lonelogServer.go b/services/lonelog/internal/server/lonelogServer.go index 90f54e5..ae5db35 100644 --- a/services/lonelog/internal/server/lonelogServer.go +++ b/services/lonelog/internal/server/lonelogServer.go @@ -28,6 +28,11 @@ func (s *LonelogServer) Items(ctx context.Context, in *lonelog.ItemsRequest) (*l return l.Items(in) } +func (s *LonelogServer) LoginItems(ctx context.Context, in *lonelog.ItemsRequest) (*lonelog.Response, error) { + l := logic.NewLoginItemsLogic(ctx, s.svcCtx) + return l.LoginItems(in) +} + func (s *LonelogServer) ActionAdd(ctx context.Context, in *lonelog.ActionLog) (*lonelog.Response, error) { l := logic.NewActionAddLogic(ctx, s.svcCtx) return l.ActionAdd(in) diff --git a/services/lonelog/internal/service/logwatcher.go b/services/lonelog/internal/service/logwatcher.go index c567706..37d1c78 100644 --- a/services/lonelog/internal/service/logwatcher.go +++ b/services/lonelog/internal/service/logwatcher.go @@ -81,7 +81,6 @@ func (w *LogWatcher) loopActionLog() { continue } - ctxBg := context.Background() logTime, _ := utils.ParseCustomTime(action.CreateTime) edit := dao.ActionLog{ Content: action.Content, @@ -100,7 +99,7 @@ func (w *LogWatcher) loopActionLog() { err = model.ActionModel{}.Init().Create(&edit) if err != nil { logx.Errorf("insert actionlog mysql err=%v payload=%s", err, payload) - _ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogActionQueueKey, payload).Err() + // 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列 time.Sleep(500 * time.Millisecond) } } @@ -147,8 +146,6 @@ func (w *LogWatcher) loopLoginLog() { continue } - ctxBg := context.Background() - logTime, _ := utils.ParseCustomTime(login.CreateTime) edit := dao.LoginLog{ AdminId: login.AdminId, @@ -164,7 +161,7 @@ func (w *LogWatcher) loopLoginLog() { err = model.LoginModel{}.Init().Create(&edit) if err != nil { logx.Errorf("insert loginlog mysql err=%v payload=%s", err, payload) - _ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogLoginQueueKey, payload).Err() + // 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列 time.Sleep(500 * time.Millisecond) } } diff --git a/services/lonelog/lonelogClient/lonelog.go b/services/lonelog/lonelogClient/lonelog.go index daadd62..f74ff8b 100644 --- a/services/lonelog/lonelogClient/lonelog.go +++ b/services/lonelog/lonelogClient/lonelog.go @@ -14,13 +14,15 @@ import ( ) type ( - ActionLog = lonelog.ActionLog - ItemsRequest = lonelog.ItemsRequest - LoginLog = lonelog.LoginLog - Response = lonelog.Response + ActionLog = lonelog.ActionLog + ItemsLoginRequest = lonelog.ItemsLoginRequest + ItemsRequest = lonelog.ItemsRequest + LoginLog = lonelog.LoginLog + Response = lonelog.Response Lonelog interface { Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) LoginAdd(ctx context.Context, in *LoginLog, opts ...grpc.CallOption) (*Response, error) } @@ -41,6 +43,11 @@ func (m *defaultLonelog) Items(ctx context.Context, in *ItemsRequest, opts ...gr return client.Items(ctx, in, opts...) } +func (m *defaultLonelog) LoginItems(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := lonelog.NewLonelogClient(m.cli.Conn()) + return client.LoginItems(ctx, in, opts...) +} + func (m *defaultLonelog) ActionAdd(ctx context.Context, in *ActionLog, opts ...grpc.CallOption) (*Response, error) { client := lonelog.NewLonelogClient(m.cli.Conn()) return client.ActionAdd(ctx, in, opts...) diff --git a/services/order/internal/logic/addressItemLogic.go b/services/order/internal/logic/addressItemLogic.go new file mode 100644 index 0000000..e40cd67 --- /dev/null +++ b/services/order/internal/logic/addressItemLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AddressItemLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewAddressItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddressItemLogic { + return &AddressItemLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *AddressItemLogic) AddressItem(in *order.AddressItemsRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/orderAuditingItemsLogic.go b/services/order/internal/logic/orderAuditingItemsLogic.go new file mode 100644 index 0000000..1f011a8 --- /dev/null +++ b/services/order/internal/logic/orderAuditingItemsLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type OrderAuditingItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewOrderAuditingItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderAuditingItemsLogic { + return &OrderAuditingItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *OrderAuditingItemsLogic) OrderAuditingItems(in *order.OrderAuditingItemsRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/orderAuditingLogic.go b/services/order/internal/logic/orderAuditingLogic.go new file mode 100644 index 0000000..10d6591 --- /dev/null +++ b/services/order/internal/logic/orderAuditingLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type OrderAuditingLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewOrderAuditingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderAuditingLogic { + return &OrderAuditingLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *OrderAuditingLogic) OrderAuditing(in *order.OrderAuditingRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/orderCreateLogic.go b/services/order/internal/logic/orderCreateLogic.go new file mode 100644 index 0000000..2854e46 --- /dev/null +++ b/services/order/internal/logic/orderCreateLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type OrderCreateLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewOrderCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderCreateLogic { + return &OrderCreateLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *OrderCreateLogic) OrderCreate(in *order.AdminCreateOrderRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webAddressCreateLogic.go b/services/order/internal/logic/webAddressCreateLogic.go new file mode 100644 index 0000000..ca6435a --- /dev/null +++ b/services/order/internal/logic/webAddressCreateLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebAddressCreateLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebAddressCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressCreateLogic { + return &WebAddressCreateLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebAddressCreateLogic) WebAddressCreate(in *order.EditAddressRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webAddressDefLogic.go b/services/order/internal/logic/webAddressDefLogic.go new file mode 100644 index 0000000..cddd4d4 --- /dev/null +++ b/services/order/internal/logic/webAddressDefLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebAddressDefLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebAddressDefLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressDefLogic { + return &WebAddressDefLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebAddressDefLogic) WebAddressDef(in *order.IdRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webAddressEditLogic.go b/services/order/internal/logic/webAddressEditLogic.go new file mode 100644 index 0000000..c614eeb --- /dev/null +++ b/services/order/internal/logic/webAddressEditLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebAddressEditLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebAddressEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressEditLogic { + return &WebAddressEditLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebAddressEditLogic) WebAddressEdit(in *order.EditAddressRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webAddressItemsLogic.go b/services/order/internal/logic/webAddressItemsLogic.go new file mode 100644 index 0000000..27b713a --- /dev/null +++ b/services/order/internal/logic/webAddressItemsLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebAddressItemsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebAddressItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressItemsLogic { + return &WebAddressItemsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebAddressItemsLogic) WebAddressItems(in *order.EmptyRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webAddressStatusLogic.go b/services/order/internal/logic/webAddressStatusLogic.go new file mode 100644 index 0000000..3ceb077 --- /dev/null +++ b/services/order/internal/logic/webAddressStatusLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebAddressStatusLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebAddressStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebAddressStatusLogic { + return &WebAddressStatusLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebAddressStatusLogic) WebAddressStatus(in *order.StatusAddressRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webCartEditLogic.go b/services/order/internal/logic/webCartEditLogic.go new file mode 100644 index 0000000..333dcaa --- /dev/null +++ b/services/order/internal/logic/webCartEditLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebCartEditLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebCartEditLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCartEditLogic { + return &WebCartEditLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebCartEditLogic) WebCartEdit(in *order.EditCartRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webCartLogic.go b/services/order/internal/logic/webCartLogic.go new file mode 100644 index 0000000..30c9a90 --- /dev/null +++ b/services/order/internal/logic/webCartLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebCartLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebCartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCartLogic { + return &WebCartLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebCartLogic) WebCart(in *order.EmptyRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/logic/webCreateLogic.go b/services/order/internal/logic/webCreateLogic.go new file mode 100644 index 0000000..f205b94 --- /dev/null +++ b/services/order/internal/logic/webCreateLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "lone-services/rpc/order/pb" + "lone-services/services/order/internal/svc" + + "github.com/zeromicro/go-zero/core/logx" +) + +type WebCreateLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewWebCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebCreateLogic { + return &WebCreateLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *WebCreateLogic) WebCreate(in *order.CreateOrderRequest) (*order.Response, error) { + // todo: add your logic here and delete this line + + return &order.Response{}, nil +} diff --git a/services/order/internal/server/orderServer.go b/services/order/internal/server/orderServer.go index 7670b15..62f445f 100644 --- a/services/order/internal/server/orderServer.go +++ b/services/order/internal/server/orderServer.go @@ -23,7 +23,67 @@ func NewOrderServer(svcCtx *svc.ServiceContext) *OrderServer { } } -func (s *OrderServer) Items(ctx context.Context, in *order.ItemsRequest) (*order.Response, error) { +func (s *OrderServer) Items(ctx context.Context, in *order.OrderItemsRequest) (*order.Response, error) { l := logic.NewItemsLogic(ctx, s.svcCtx) return l.Items(in) } + +func (s *OrderServer) WebCreate(ctx context.Context, in *order.CreateOrderRequest) (*order.Response, error) { + l := logic.NewWebCreateLogic(ctx, s.svcCtx) + return l.WebCreate(in) +} + +func (s *OrderServer) WebAddressCreate(ctx context.Context, in *order.EditAddressRequest) (*order.Response, error) { + l := logic.NewWebAddressCreateLogic(ctx, s.svcCtx) + return l.WebAddressCreate(in) +} + +func (s *OrderServer) WebAddressEdit(ctx context.Context, in *order.EditAddressRequest) (*order.Response, error) { + l := logic.NewWebAddressEditLogic(ctx, s.svcCtx) + return l.WebAddressEdit(in) +} + +func (s *OrderServer) WebAddressStatus(ctx context.Context, in *order.StatusAddressRequest) (*order.Response, error) { + l := logic.NewWebAddressStatusLogic(ctx, s.svcCtx) + return l.WebAddressStatus(in) +} + +func (s *OrderServer) WebAddressDef(ctx context.Context, in *order.IdRequest) (*order.Response, error) { + l := logic.NewWebAddressDefLogic(ctx, s.svcCtx) + return l.WebAddressDef(in) +} + +func (s *OrderServer) WebAddressItems(ctx context.Context, in *order.EmptyRequest) (*order.Response, error) { + l := logic.NewWebAddressItemsLogic(ctx, s.svcCtx) + return l.WebAddressItems(in) +} + +func (s *OrderServer) WebCart(ctx context.Context, in *order.EmptyRequest) (*order.Response, error) { + l := logic.NewWebCartLogic(ctx, s.svcCtx) + return l.WebCart(in) +} + +func (s *OrderServer) WebCartEdit(ctx context.Context, in *order.EditCartRequest) (*order.Response, error) { + l := logic.NewWebCartEditLogic(ctx, s.svcCtx) + return l.WebCartEdit(in) +} + +func (s *OrderServer) AddressItem(ctx context.Context, in *order.AddressItemsRequest) (*order.Response, error) { + l := logic.NewAddressItemLogic(ctx, s.svcCtx) + return l.AddressItem(in) +} + +func (s *OrderServer) OrderAuditingItems(ctx context.Context, in *order.OrderAuditingItemsRequest) (*order.Response, error) { + l := logic.NewOrderAuditingItemsLogic(ctx, s.svcCtx) + return l.OrderAuditingItems(in) +} + +func (s *OrderServer) OrderAuditing(ctx context.Context, in *order.OrderAuditingRequest) (*order.Response, error) { + l := logic.NewOrderAuditingLogic(ctx, s.svcCtx) + return l.OrderAuditing(in) +} + +func (s *OrderServer) OrderCreate(ctx context.Context, in *order.AdminCreateOrderRequest) (*order.Response, error) { + l := logic.NewOrderCreateLogic(ctx, s.svcCtx) + return l.OrderCreate(in) +} diff --git a/services/order/orderClient/order.go b/services/order/orderClient/order.go index 72c2d9a..3b01251 100644 --- a/services/order/orderClient/order.go +++ b/services/order/orderClient/order.go @@ -14,11 +14,33 @@ import ( ) type ( - ItemsRequest = order.ItemsRequest - Response = order.Response + AddressItemsRequest = order.AddressItemsRequest + AdminCreateOrderRequest = order.AdminCreateOrderRequest + CreateOrderRequest = order.CreateOrderRequest + EditAddressRequest = order.EditAddressRequest + EditCartRequest = order.EditCartRequest + EmptyRequest = order.EmptyRequest + IdRequest = order.IdRequest + OrderAuditingItemsRequest = order.OrderAuditingItemsRequest + OrderAuditingRequest = order.OrderAuditingRequest + OrderItemsRequest = order.OrderItemsRequest + Response = order.Response + StatusAddressRequest = order.StatusAddressRequest Order interface { - Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) + Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) + WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) + WebAddressItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + WebCart(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) + WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error) + AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error) + OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error) + OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) + OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) } defaultOrder struct { @@ -32,7 +54,67 @@ func NewOrder(cli zrpc.Client) Order { } } -func (m *defaultOrder) Items(ctx context.Context, in *ItemsRequest, opts ...grpc.CallOption) (*Response, error) { +func (m *defaultOrder) Items(ctx context.Context, in *OrderItemsRequest, opts ...grpc.CallOption) (*Response, error) { client := order.NewOrderClient(m.cli.Conn()) return client.Items(ctx, in, opts...) } + +func (m *defaultOrder) WebCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebCreate(ctx, in, opts...) +} + +func (m *defaultOrder) WebAddressCreate(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebAddressCreate(ctx, in, opts...) +} + +func (m *defaultOrder) WebAddressEdit(ctx context.Context, in *EditAddressRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebAddressEdit(ctx, in, opts...) +} + +func (m *defaultOrder) WebAddressStatus(ctx context.Context, in *StatusAddressRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebAddressStatus(ctx, in, opts...) +} + +func (m *defaultOrder) WebAddressDef(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebAddressDef(ctx, in, opts...) +} + +func (m *defaultOrder) WebAddressItems(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebAddressItems(ctx, in, opts...) +} + +func (m *defaultOrder) WebCart(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebCart(ctx, in, opts...) +} + +func (m *defaultOrder) WebCartEdit(ctx context.Context, in *EditCartRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.WebCartEdit(ctx, in, opts...) +} + +func (m *defaultOrder) AddressItem(ctx context.Context, in *AddressItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.AddressItem(ctx, in, opts...) +} + +func (m *defaultOrder) OrderAuditingItems(ctx context.Context, in *OrderAuditingItemsRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.OrderAuditingItems(ctx, in, opts...) +} + +func (m *defaultOrder) OrderAuditing(ctx context.Context, in *OrderAuditingRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.OrderAuditing(ctx, in, opts...) +} + +func (m *defaultOrder) OrderCreate(ctx context.Context, in *AdminCreateOrderRequest, opts ...grpc.CallOption) (*Response, error) { + client := order.NewOrderClient(m.cli.Conn()) + return client.OrderCreate(ctx, in, opts...) +}