From 99587b984e4f8b859cb20ae6de170e586e7f20e8 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 16 Feb 2023 19:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=81=E5=8C=A0=E9=93=BA=E8=A3=85=E5=A4=87?= =?UTF-8?q?=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithy/api_getCustomer.go | 48 ++++++++ modules/smithy/api_trade.go | 35 +++++- modules/smithy/comp_configure.go | 17 ++- modules/smithy/model_trade.go | 67 ++++++++++- pb/errorcode.pb.go | 10 +- pb/smithy_msg.pb.go | 192 ++++++++++++++++-------------- 6 files changed, 268 insertions(+), 101 deletions(-) create mode 100644 modules/smithy/api_getCustomer.go diff --git a/modules/smithy/api_getCustomer.go b/modules/smithy/api_getCustomer.go new file mode 100644 index 000000000..58acfb0f3 --- /dev/null +++ b/modules/smithy/api_getCustomer.go @@ -0,0 +1,48 @@ +package smithy + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "go_dreamfactory/utils" + + "go.mongodb.org/mongo-driver/mongo" + "google.golang.org/protobuf/proto" +) + +func (this *apiComp) CustomerCheck(session comm.IUserSession, req *pb.SmithyCustomerReq) (code pb.ErrorCode) { + return +} + +func (this *apiComp) Customer(session comm.IUserSession, req *pb.SmithyCustomerReq) (code pb.ErrorCode, data proto.Message) { + cus, err := this.module.modelTrade.getDBCustomer(session.GetUserId()) + if err != nil { + if err == mongo.ErrNoDocuments { + c, err := this.module.modelTrade.addCustomer(session.GetUserId(), 3) + if err != nil { + code = pb.ErrorCode_DBError + return + } + cus = c + } else { + code = pb.ErrorCode_DBError + return + } + } + + if utils.IsFirstTody(cus.LastRefreshTime) { + this.module.modelTrade.DelByUId(session.GetUserId()) + c, err := this.module.modelTrade.addCustomer(session.GetUserId(), 3) + if err != nil { + code = pb.ErrorCode_DBError + return + } + cus = c + } + + rsp := &pb.SmithyCustomerResp{ + CustomerIds: cus.CustomerIds, + } + + session.SendMsg(string(this.module.GetType()), "customer", rsp) + return +} diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index 61a53e49e..2bf2f76fe 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -3,10 +3,43 @@ package smithy import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + + "github.com/golang/protobuf/proto" ) // 贸易 -func (this *apiComp) TradeCheck(session comm.IUserSession, req *pb.SmithySellItemReq) (code pb.ErrorCode) { +func (this *apiComp) SellCheck(session comm.IUserSession, req *pb.SmithySellReq) (code pb.ErrorCode) { + if req.CustomerId == 0 || len(req.Ids) == 0 { + code = pb.ErrorCode_ReqParameterError + } + return +} + +func (this *apiComp) SellItem(session comm.IUserSession, req *pb.SmithySellReq) (code pb.ErrorCode, data proto.Message) { + if code = this.SellCheck(session, req); code != pb.ErrorCode_Success { + return + } + + //校验customer类型,因为有的类型是不能进入交易逻辑的 + //TODO + + _ = this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) + + conf := this.module.configure.GetSmithyCustomerConf(req.CustomerId) + if conf == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + + // 发奖励 + this.module.DispenseRes(session, conf.Reword, true) + + rsp := &pb.SmithySellResp{ + CustomerId: req.CustomerId, + Ids: req.Ids, + } + + session.SendMsg(string(this.module.GetType()), "sell", rsp) return } diff --git a/modules/smithy/comp_configure.go b/modules/smithy/comp_configure.go index da10ac116..022b6ece5 100644 --- a/modules/smithy/comp_configure.go +++ b/modules/smithy/comp_configure.go @@ -13,10 +13,10 @@ const ( game_smithy = "game_smithy.json" game_smithystoveold = "game_smithystove.json" - game_smithyreel = "game_newsmithy.json" // 新版铁匠铺卷轴 - game_smproficiency = "game_smithyproficiency.json" // 铁匠铺熟练度 - game_smithystove = "game_smithystovev1.json" // 铁匠铺台子 打造配置 - game_smithytools = "game_smithytool.json" // 铁匠铺工具台 + game_smithyreel = "game_newsmithy.json" // 新版铁匠铺卷轴 + game_smproficiency = "game_smithyproficiency.json" // 铁匠铺熟练度 + game_smithystove = "game_smithystovev1.json" // 铁匠铺台子 打造配置 + game_smithytools = "game_smithytool.json" // 铁匠铺工具台 game_smithycustomer = "game_smithycustomer.json" ) @@ -180,3 +180,12 @@ func (this *configureComp) GetSmithyCustomerConfList() (data []*cfg.GameSmithyCu } return } + +func (this *configureComp) GetSmithyCustomerConf(id int32) *cfg.GameSmithyCustomerData { + if v, err := this.GetConfigure(game_smithycustomer); err == nil { + if configure, ok := v.(*cfg.GameSmithyCustomer); ok { + return configure.GetDataMap()[id] + } + } + return nil +} diff --git a/modules/smithy/model_trade.go b/modules/smithy/model_trade.go index 8f9ddb04d..793f675b5 100644 --- a/modules/smithy/model_trade.go +++ b/modules/smithy/model_trade.go @@ -4,9 +4,12 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" + "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" "math/rand" + "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/x/bsonx" ) @@ -62,9 +65,69 @@ func (s *modelTrade) getCustomerRandom() (customerId int32) { return } -// 更新顾客 -func(s *modelTrade) updateCustomer(uid string) { +func (s *modelTrade) getDBCustomer(uid string) (*pb.DBCustomer, error) { + customer := &pb.DBCustomer{} + if err := s.Get(uid, customer); err != nil { + s.module.Errorln(err) + return nil, err + } + return customer, nil +} +// 初始顾客 +func (s *modelTrade) addCustomer(uid string, num int32) (*pb.DBCustomer, error) { + customer := &pb.DBCustomer{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Total: num, + LastRefreshTime: configure.Now().Unix(), + } + for i := 0; i < int(num); i++ { + customer.CustomerIds = append(customer.CustomerIds, s.getCustomerRandom()) + } + if err := s.Add(uid, customer); err != nil { + s.module.Errorln(err) + return nil, err + } + return customer, nil +} + +// 移除顾客 +func (s *modelTrade) removeCustomer(cus *pb.DBCustomer, customerId int32) *pb.DBCustomer { + for i, v := range cus.CustomerIds { + if v == customerId { + cus.CustomerIds = append(cus.CustomerIds[:i], cus.CustomerIds[i+1:]...) + i-- + } + } + return cus +} + +// 随机新顾客 +func (s *modelTrade) updateCustomer(uid string, customerId int32) error { + cus, err := s.getDBCustomer(uid) + if err == nil { + cus = s.removeCustomer(cus, customerId) + cus.Total++ + //上限 + limit := 20 + left := limit - int(cus.Total) + if left <= 0 { + return comm.NewCustomError(pb.ErrorCode_SmithyCustomerLimit) + } + + cus.CustomerIds = append(cus.CustomerIds, s.getCustomerRandom()) + cus.LastRefreshTime = configure.Now().Unix() + update := map[string]interface{}{ + "customerIds": cus.CustomerIds, + "total": cus.Total, + "lastRefreshTime": cus.LastRefreshTime, + } + if err := s.Change(uid, update); err != nil { + return err + } + } + return nil } //顾客类型策略 diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 011b826e5..ef8515547 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -318,6 +318,7 @@ const ( // smithy ErrorCode_SmithyNoReel ErrorCode = 4101 // 没有激活图纸信息 ErrorCode_SmithyNoTemperature ErrorCode = 4102 // 炉温不够不能打造 + ErrorCode_SmithyCustomerLimit ErrorCode = 4103 //顾客上限 ) // Enum value maps for ErrorCode. @@ -586,6 +587,7 @@ var ( 4002: "AutoBattleStatesErr", 4101: "SmithyNoReel", 4102: "SmithyNoTemperature", + 4103: "SmithyCustomerLimit", } ErrorCode_value = map[string]int32{ "Success": 0, @@ -851,6 +853,7 @@ var ( "AutoBattleStatesErr": 4002, "SmithyNoReel": 4101, "SmithyNoTemperature": 4102, + "SmithyCustomerLimit": 4103, } ) @@ -885,7 +888,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xbf, 0x2f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xd9, 0x2f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -1265,8 +1268,9 @@ var file_errorcode_proto_rawDesc = []byte{ 0x45, 0x72, 0x72, 0x10, 0xa2, 0x1f, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x4e, 0x6f, 0x52, 0x65, 0x65, 0x6c, 0x10, 0x85, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x4e, 0x6f, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x10, 0x86, 0x20, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x10, 0x86, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x87, 0x20, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/smithy_msg.pb.go b/pb/smithy_msg.pb.go index 894916d5d..b91728ce2 100644 --- a/pb/smithy_msg.pb.go +++ b/pb/smithy_msg.pb.go @@ -637,14 +637,14 @@ func (x *SmithyToolsUpResp) GetData() *DBStove { } // 刷新商人 -type SmithyRefreshShopReq struct { +type SmithyCustomerReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *SmithyRefreshShopReq) Reset() { - *x = SmithyRefreshShopReq{} +func (x *SmithyCustomerReq) Reset() { + *x = SmithyCustomerReq{} if protoimpl.UnsafeEnabled { mi := &file_smithy_smithy_msg_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -652,13 +652,13 @@ func (x *SmithyRefreshShopReq) Reset() { } } -func (x *SmithyRefreshShopReq) String() string { +func (x *SmithyCustomerReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SmithyRefreshShopReq) ProtoMessage() {} +func (*SmithyCustomerReq) ProtoMessage() {} -func (x *SmithyRefreshShopReq) ProtoReflect() protoreflect.Message { +func (x *SmithyCustomerReq) ProtoReflect() protoreflect.Message { mi := &file_smithy_smithy_msg_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -670,12 +670,12 @@ func (x *SmithyRefreshShopReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SmithyRefreshShopReq.ProtoReflect.Descriptor instead. -func (*SmithyRefreshShopReq) Descriptor() ([]byte, []int) { +// Deprecated: Use SmithyCustomerReq.ProtoReflect.Descriptor instead. +func (*SmithyCustomerReq) Descriptor() ([]byte, []int) { return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{12} } -type SmithyRefreshShopResp struct { +type SmithyCustomerResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -683,8 +683,8 @@ type SmithyRefreshShopResp struct { CustomerIds []int32 `protobuf:"varint,1,rep,packed,name=customerIds,proto3" json:"customerIds"` //顾客 } -func (x *SmithyRefreshShopResp) Reset() { - *x = SmithyRefreshShopResp{} +func (x *SmithyCustomerResp) Reset() { + *x = SmithyCustomerResp{} if protoimpl.UnsafeEnabled { mi := &file_smithy_smithy_msg_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -692,13 +692,13 @@ func (x *SmithyRefreshShopResp) Reset() { } } -func (x *SmithyRefreshShopResp) String() string { +func (x *SmithyCustomerResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SmithyRefreshShopResp) ProtoMessage() {} +func (*SmithyCustomerResp) ProtoMessage() {} -func (x *SmithyRefreshShopResp) ProtoReflect() protoreflect.Message { +func (x *SmithyCustomerResp) ProtoReflect() protoreflect.Message { mi := &file_smithy_smithy_msg_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -710,12 +710,12 @@ func (x *SmithyRefreshShopResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SmithyRefreshShopResp.ProtoReflect.Descriptor instead. -func (*SmithyRefreshShopResp) Descriptor() ([]byte, []int) { +// Deprecated: Use SmithyCustomerResp.ProtoReflect.Descriptor instead. +func (*SmithyCustomerResp) Descriptor() ([]byte, []int) { return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{13} } -func (x *SmithyRefreshShopResp) GetCustomerIds() []int32 { +func (x *SmithyCustomerResp) GetCustomerIds() []int32 { if x != nil { return x.CustomerIds } @@ -723,16 +723,17 @@ func (x *SmithyRefreshShopResp) GetCustomerIds() []int32 { } // 出售装备 -type SmithySellItemReq struct { +type SmithySellReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Ids []int32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids"` // 装备ID + Ids []int32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids"` // 装备ID + CustomerId int32 `protobuf:"varint,2,opt,name=customerId,proto3" json:"customerId"` //顾客ID } -func (x *SmithySellItemReq) Reset() { - *x = SmithySellItemReq{} +func (x *SmithySellReq) Reset() { + *x = SmithySellReq{} if protoimpl.UnsafeEnabled { mi := &file_smithy_smithy_msg_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -740,13 +741,13 @@ func (x *SmithySellItemReq) Reset() { } } -func (x *SmithySellItemReq) String() string { +func (x *SmithySellReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SmithySellItemReq) ProtoMessage() {} +func (*SmithySellReq) ProtoMessage() {} -func (x *SmithySellItemReq) ProtoReflect() protoreflect.Message { +func (x *SmithySellReq) ProtoReflect() protoreflect.Message { mi := &file_smithy_smithy_msg_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -758,19 +759,26 @@ func (x *SmithySellItemReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SmithySellItemReq.ProtoReflect.Descriptor instead. -func (*SmithySellItemReq) Descriptor() ([]byte, []int) { +// Deprecated: Use SmithySellReq.ProtoReflect.Descriptor instead. +func (*SmithySellReq) Descriptor() ([]byte, []int) { return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{14} } -func (x *SmithySellItemReq) GetIds() []int32 { +func (x *SmithySellReq) GetIds() []int32 { if x != nil { return x.Ids } return nil } -type SmithySellItemResp struct { +func (x *SmithySellReq) GetCustomerId() int32 { + if x != nil { + return x.CustomerId + } + return 0 +} + +type SmithySellResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -779,8 +787,8 @@ type SmithySellItemResp struct { Ids []int32 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids"` //出售的装备 } -func (x *SmithySellItemResp) Reset() { - *x = SmithySellItemResp{} +func (x *SmithySellResp) Reset() { + *x = SmithySellResp{} if protoimpl.UnsafeEnabled { mi := &file_smithy_smithy_msg_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -788,13 +796,13 @@ func (x *SmithySellItemResp) Reset() { } } -func (x *SmithySellItemResp) String() string { +func (x *SmithySellResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SmithySellItemResp) ProtoMessage() {} +func (*SmithySellResp) ProtoMessage() {} -func (x *SmithySellItemResp) ProtoReflect() protoreflect.Message { +func (x *SmithySellResp) ProtoReflect() protoreflect.Message { mi := &file_smithy_smithy_msg_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -806,19 +814,19 @@ func (x *SmithySellItemResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SmithySellItemResp.ProtoReflect.Descriptor instead. -func (*SmithySellItemResp) Descriptor() ([]byte, []int) { +// Deprecated: Use SmithySellResp.ProtoReflect.Descriptor instead. +func (*SmithySellResp) Descriptor() ([]byte, []int) { return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{15} } -func (x *SmithySellItemResp) GetCustomerId() int32 { +func (x *SmithySellResp) GetCustomerId() int32 { if x != nil { return x.CustomerId } return 0 } -func (x *SmithySellItemResp) GetIds() []int32 { +func (x *SmithySellResp) GetIds() []int32 { if x != nil { return x.Ids } @@ -1420,54 +1428,56 @@ var file_smithy_smithy_msg_proto_rawDesc = []byte{ 0x22, 0x31, 0x0a, 0x11, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x54, 0x6f, 0x6f, 0x6c, 0x73, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x44, 0x42, 0x53, 0x74, 0x6f, 0x76, 0x65, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x65, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x53, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x22, 0x39, 0x0a, 0x15, 0x53, - 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x53, 0x68, 0x6f, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, - 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x25, 0x0a, 0x11, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, - 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x46, 0x0a, - 0x12, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, - 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x39, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, - 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x22, 0x36, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, - 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x6d, 0x69, 0x74, - 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x34, - 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x32, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x44, 0x65, - 0x73, 0x6b, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, - 0x64, 0x65, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x64, 0x65, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x36, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, - 0x68, 0x79, 0x44, 0x65, 0x73, 0x6b, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x17, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x74, 0x6f, 0x76, 0x65, 0x53, - 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x22, 0x37, 0x0a, 0x16, 0x53, 0x6d, 0x69, - 0x74, 0x68, 0x79, 0x53, 0x74, 0x6f, 0x76, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, + 0x61, 0x74, 0x61, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x22, 0x36, 0x0a, 0x12, 0x53, 0x6d, 0x69, 0x74, + 0x68, 0x79, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, + 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x73, + 0x22, 0x41, 0x0a, 0x0d, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x65, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x03, + 0x69, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0e, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x65, 0x6c, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x39, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, + 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, + 0x21, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x22, 0x36, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, + 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x6d, + 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, + 0x22, 0x34, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x32, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, + 0x44, 0x65, 0x73, 0x6b, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x65, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x64, 0x65, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x36, 0x0a, 0x15, 0x53, 0x6d, + 0x69, 0x74, 0x68, 0x79, 0x44, 0x65, 0x73, 0x6b, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, - 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x65, 0x6f, 0x70, - 0x6c, 0x65, 0x22, 0x34, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x6d, 0x69, 0x74, - 0x68, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x11, - 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x74, 0x6f, 0x76, + 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x22, 0x37, 0x0a, 0x16, 0x53, + 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x74, 0x6f, 0x76, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, + 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x14, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, + 0x74, 0x52, 0x61, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x65, + 0x6f, 0x70, 0x6c, 0x65, 0x22, 0x34, 0x0a, 0x15, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, + 0x74, 0x52, 0x61, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x6d, + 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, + 0x0a, 0x11, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1496,10 +1506,10 @@ var file_smithy_smithy_msg_proto_goTypes = []interface{}{ (*SmithyRiseResp)(nil), // 9: SmithyRiseResp (*SmithyToolsUpReq)(nil), // 10: SmithyToolsUpReq (*SmithyToolsUpResp)(nil), // 11: SmithyToolsUpResp - (*SmithyRefreshShopReq)(nil), // 12: SmithyRefreshShopReq - (*SmithyRefreshShopResp)(nil), // 13: SmithyRefreshShopResp - (*SmithySellItemReq)(nil), // 14: SmithySellItemReq - (*SmithySellItemResp)(nil), // 15: SmithySellItemResp + (*SmithyCustomerReq)(nil), // 12: SmithyCustomerReq + (*SmithyCustomerResp)(nil), // 13: SmithyCustomerResp + (*SmithySellReq)(nil), // 14: SmithySellReq + (*SmithySellResp)(nil), // 15: SmithySellResp (*SmithyCreateOrderReq)(nil), // 16: SmithyCreateOrderReq (*SmithyCreateOrderResp)(nil), // 17: SmithyCreateOrderResp (*SmithyGetRewardReq)(nil), // 18: SmithyGetRewardReq @@ -1691,7 +1701,7 @@ func file_smithy_smithy_msg_proto_init() { } } file_smithy_smithy_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SmithyRefreshShopReq); i { + switch v := v.(*SmithyCustomerReq); i { case 0: return &v.state case 1: @@ -1703,7 +1713,7 @@ func file_smithy_smithy_msg_proto_init() { } } file_smithy_smithy_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SmithyRefreshShopResp); i { + switch v := v.(*SmithyCustomerResp); i { case 0: return &v.state case 1: @@ -1715,7 +1725,7 @@ func file_smithy_smithy_msg_proto_init() { } } file_smithy_smithy_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SmithySellItemReq); i { + switch v := v.(*SmithySellReq); i { case 0: return &v.state case 1: @@ -1727,7 +1737,7 @@ func file_smithy_smithy_msg_proto_init() { } } file_smithy_smithy_msg_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SmithySellItemResp); i { + switch v := v.(*SmithySellResp); i { case 0: return &v.state case 1: