上传商店代码修复

This commit is contained in:
liwei 2023-07-12 17:16:00 +08:00
parent fa8e950733
commit 59577fa35f
7 changed files with 303 additions and 205 deletions

View File

@ -1,6 +1,7 @@
package shop
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
@ -10,7 +11,7 @@ import (
// 参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.ShopBuyReq) (errdata *pb.ErrorData) {
if req.ShopType == 0 || req.GoodsId == 0 || req.BuyNum <= 0 {
if req.ShopType == 0 || req.Gid == 0 || req.BuyNum <= 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
@ -25,6 +26,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
err error
conf *cfg.GameShopitemData
shopData *pb.DBShop
good *pb.UserShopGood
filed string
record *pb.UserShopData
need []*cfg.Gameatn
@ -35,14 +37,6 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
return
}
if conf, err = this.module.configure.GetShopItemsConfigure(req.GoodsId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SystemError,
Title: pb.ErrorCode_SystemError.ToString(),
Message: err.Error(),
}
return
}
if shopData, err = this.module.modelShop.QueryUserShopData(session.GetUserId()); err != nil { //没有购买记录
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
@ -51,23 +45,6 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
}
return
}
need = make([]*cfg.Gameatn, len(conf.Need))
for i, v := range conf.Need {
need[i] = &cfg.Gameatn{
A: v.A,
T: v.T,
N: int32(math.Ceil(float64(v.N)*float64(conf.Sale)/float64(1000))) * req.BuyNum,
}
}
give = make([]*cfg.Gameatn, len(conf.Iteminfo))
for i, v := range conf.Iteminfo {
give[i] = &cfg.Gameatn{
A: v.A,
T: v.T,
N: v.N * req.BuyNum,
}
}
switch req.ShopType {
case pb.ShopType_GoldShop:
@ -106,18 +83,64 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
return
}
if record == nil {
record = &pb.UserShopData{
Buy: map[int32]int32{},
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
for _, v := range record.Items {
if v.Id == req.Gid {
good = v
}
}
if conf.Buyminnum-record.Buy[req.GoodsId] < req.BuyNum {
if good == nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("no found good:%d", req.Gid),
}
return
}
if conf, err = this.module.configure.GetShopItemsConfigure(good.Gid); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SystemError,
Title: pb.ErrorCode_SystemError.ToString(),
Message: err.Error(),
}
return
}
need = make([]*cfg.Gameatn, len(conf.Need))
for i, v := range conf.Need {
need[i] = &cfg.Gameatn{
A: v.A,
T: v.T,
N: int32(math.Ceil(float64(v.N)*float64(conf.Sale)/float64(1000))) * req.BuyNum,
}
}
give = make([]*cfg.Gameatn, len(conf.Iteminfo))
for i, v := range conf.Iteminfo {
give[i] = &cfg.Gameatn{
A: v.A,
T: v.T,
N: v.N * req.BuyNum,
}
}
if conf.Buyminnum-good.Buy < req.BuyNum {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ShopGoodsIsSoldOut,
Title: pb.ErrorCode_ShopGoodsIsSoldOut.ToString(),
}
return
}
record.Buy[req.GoodsId] += req.BuyNum
good.Buy += req.BuyNum
if errdata = this.module.ConsumeRes(session, need, true); errdata != nil {
return
}
@ -127,25 +150,21 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
return
}
} else {
if errdata = this.module.equip.AddEquipment(session, record.Preview[req.GoodsId]); errdata != nil {
if errdata = this.module.equip.AddEquipment(session, record.Preview[req.Gid]); errdata != nil {
return
}
}
//随机任务
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype64, 1))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype64, 1)
for _, v := range give {
if v.A == comm.ItemType {
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype65, v.N, utils.ToInt32(v.T)))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype65, v.N, utils.ToInt32(v.T))
}
}
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype66, 1, int32(req.ShopType)))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype66, 1, int32(req.ShopType))
for _, v := range need {
if v.A == comm.AttrType {
// tasks = append(tasks, comm.GetBuriedParam(comm.Rtype67, v.N, utils.ToInt32(v.T)))
switch v.T {
case comm.ResGold:
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype67, v.N, 1))

View File

@ -102,7 +102,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
}
if sdata == nil {
sdata = &pb.UserShopData{
Buy: map[int32]int32{},
Items: make([]*pb.UserShopGood, 0),
}
}
if shopconf.Rnum > 0 {
@ -169,14 +169,17 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
}
items = append(items, randomGoods(_items))
}
sdata.Buy = make(map[int32]int32)
sdata.LastRefreshTime = configure.Now().Unix()
sdata.ManualRefreshNum++
sdata.Leftfreerefreshnum = refresh - shopData.RefreshnumgoldShop
sdata.Items = make([]int32, len(items))
sdata.Items = make([]*pb.UserShopGood, len(items))
sdata.Preview = make(map[int32]*pb.DB_Equipment)
for i, v := range items {
sdata.Items[i] = v.Key
sdata.Items[i] = &pb.UserShopGood{
Id: v.Key*100 + int32(i),
Gid: v.Key,
Buy: 0,
}
if v.Preview { //是否预览
if errdata, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
return
@ -217,12 +220,15 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
}
items = append(items, randomGoods(_items))
}
sdata.Buy = make(map[int32]int32)
sdata.LastRefreshTime = configure.Now().Unix()
sdata.Items = make([]int32, len(items))
sdata.Items = make([]*pb.UserShopGood, len(items))
sdata.Preview = make(map[int32]*pb.DB_Equipment)
for i, v := range items {
sdata.Items[i] = v.Key
sdata.Items[i] = &pb.UserShopGood{
Id: v.Key*100 + int32(i),
Gid: v.Key,
Buy: 0,
}
if v.Preview { //是否预览
if errdata, sdata.Preview[v.Key] = this.module.equip.NewEquipment(session.GetUserId(), v.Iteminfo[0].T); errdata != nil {
return
@ -234,7 +240,11 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
go this.module.ModuleBuried.TriggerBuried(session.Clone(), comm.GetBuriedParam(comm.Rtype105, 1))
} else { //返回以前的商品列表
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
keys := make([]int32, len(sdata.Items))
for i, v := range sdata.Items {
keys[i] = v.Gid
}
if items, err = this.module.configure.GetShopItemsConfigureByIds(keys...); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SystemError,
Title: pb.ErrorCode_SystemError.ToString(),

View File

@ -8,7 +8,7 @@ import (
"math/big"
)
//随机商品列表
// 随机商品列表
func randomGoods(goods []*cfg.GameShopitemData) (result *cfg.GameShopitemData) {
var (
totle int64
@ -30,7 +30,7 @@ func randomGoods(goods []*cfg.GameShopitemData) (result *cfg.GameShopitemData) {
return
}
//转换商品对象
// 转换商品对象
func transGoods(goods []*cfg.GameShopitemData, sdata *pb.UserShopData) (result []*pb.ShopItem) {
result = make([]*pb.ShopItem, len(goods))
// ok := false
@ -40,10 +40,11 @@ func transGoods(goods []*cfg.GameShopitemData, sdata *pb.UserShopData) (result [
// uitem = &pb.DBShopItem{}
// }
result[i] = &pb.ShopItem{
Gid: sdata.Items[i].Id,
GoodsId: v.Key,
Sale: int32(v.Sale),
}
result[i].LeftBuyNum = v.Buyminnum - sdata.Buy[v.Key]
result[i].LeftBuyNum = v.Buyminnum - sdata.Items[i].Buy
result[i].Items = make([]*pb.UserAssets, len(v.Iteminfo))
for i1, v1 := range v.Iteminfo {
result[i].Items[i1] = &pb.UserAssets{

View File

@ -30,12 +30,12 @@ func newService(ops ...rpcx.Option) core.IService {
return s
}
//梦工厂基础服务对象
// 梦工厂基础服务对象
type TestService struct {
rpcx.RPCXService
}
//初始化相关系统
// 初始化相关系统
func (this *TestService) InitSys() {
this.RPCXService.InitSys()
if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil {
@ -54,7 +54,7 @@ var service core.IService
var s_gateComp comm.ISC_GateRouteComp = services.NewGateRouteComp()
var module = new(shop.Shop)
//测试环境下初始化db和cache 系统
// 测试环境下初始化db和cache 系统
func TestMain(m *testing.M) {
service = newService(
rpcx.SetConfPath("../../bin/conf/worker_1.yaml"),
@ -76,18 +76,10 @@ func TestMain(m *testing.M) {
defer os.Exit(m.Run())
}
//测试api_getlist
// 测试api_getlist
func Test_Module_APIGetList(t *testing.T) {
data, _ := ptypes.MarshalAny(&pb.ShopGetListReq{SType: pb.ShopType_GoldShop, IsManualRefresh: false})
reply := &pb.RPCMessageReply{}
s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62b16dda909b2f8faeff788d", MainType: "shop", SubType: "getlist", Message: data}, reply)
log.Debugf("reply:%v", reply)
}
//测试api_buy
func Test_Module_APIBuy(t *testing.T) {
data, _ := ptypes.MarshalAny(&pb.ShopBuyReq{GoodsId: 7})
reply := &pb.RPCMessageReply{}
s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62b16dda909b2f8faeff788d", MainType: "shop", SubType: "buy", Message: data}, reply)
log.Debugf("reply:%v", reply)
}

View File

@ -1152,7 +1152,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, 0x8c, 0x40, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x6f, 0x2a, 0xa1, 0x40, 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, 0x14, 0x0a, 0x10,
0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76,
@ -1665,7 +1665,9 @@ var file_errorcode_proto_rawDesc = []byte{
0x61, 0x73, 0x73, 0x6f, 0x6e, 0x48, 0x65, 0x72, 0x6f, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c,
0x61, 0x62, 0x6c, 0x65, 0x10, 0xde, 0x24, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x61, 0x73, 0x73, 0x6f,
0x6e, 0x53, 0x65, 0x61, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x72, 0x72, 0x10, 0xdf, 0x24,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x12, 0x13, 0x0a, 0x0e, 0x57, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x4f, 0x70,
0x65, 0x6e, 0x10, 0xc1, 0x25, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -84,6 +84,69 @@ func (ShopType) EnumDescriptor() ([]byte, []int) {
return file_shop_shop_db_proto_rawDescGZIP(), []int{0}
}
type UserShopGood struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` //实例id
Gid int32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid"` //商品Id
Buy int32 `protobuf:"varint,3,opt,name=buy,proto3" json:"buy"` //购买实例
}
func (x *UserShopGood) Reset() {
*x = UserShopGood{}
if protoimpl.UnsafeEnabled {
mi := &file_shop_shop_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserShopGood) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserShopGood) ProtoMessage() {}
func (x *UserShopGood) ProtoReflect() protoreflect.Message {
mi := &file_shop_shop_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserShopGood.ProtoReflect.Descriptor instead.
func (*UserShopGood) Descriptor() ([]byte, []int) {
return file_shop_shop_db_proto_rawDescGZIP(), []int{0}
}
func (x *UserShopGood) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *UserShopGood) GetGid() int32 {
if x != nil {
return x.Gid
}
return 0
}
func (x *UserShopGood) GetBuy() int32 {
if x != nil {
return x.Buy
}
return 0
}
type UserShopData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -91,8 +154,7 @@ type UserShopData struct {
LastRefreshTime int64 `protobuf:"varint,1,opt,name=LastRefreshTime,proto3" json:"LastRefreshTime"` //最后一次刷新时间
ManualRefreshNum int32 `protobuf:"varint,2,opt,name=ManualRefreshNum,proto3" json:"ManualRefreshNum"` //手动刷新次数
Items []int32 `protobuf:"varint,3,rep,packed,name=Items,proto3" json:"Items"` //商品列表
Buy map[int32]int32 `protobuf:"bytes,4,rep,name=buy,proto3" json:"buy" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //购买记录
Items []*UserShopGood `protobuf:"bytes,3,rep,name=Items,proto3" json:"Items"` //商品列表
Preview map[int32]*DB_Equipment `protobuf:"bytes,5,rep,name=preview,proto3" json:"preview" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //预览数据
Leftfreerefreshnum int32 `protobuf:"varint,6,opt,name=leftfreerefreshnum,proto3" json:"leftfreerefreshnum"` //剩余免费刷新次数
}
@ -100,7 +162,7 @@ type UserShopData struct {
func (x *UserShopData) Reset() {
*x = UserShopData{}
if protoimpl.UnsafeEnabled {
mi := &file_shop_shop_db_proto_msgTypes[0]
mi := &file_shop_shop_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -113,7 +175,7 @@ func (x *UserShopData) String() string {
func (*UserShopData) ProtoMessage() {}
func (x *UserShopData) ProtoReflect() protoreflect.Message {
mi := &file_shop_shop_db_proto_msgTypes[0]
mi := &file_shop_shop_db_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -126,7 +188,7 @@ func (x *UserShopData) ProtoReflect() protoreflect.Message {
// Deprecated: Use UserShopData.ProtoReflect.Descriptor instead.
func (*UserShopData) Descriptor() ([]byte, []int) {
return file_shop_shop_db_proto_rawDescGZIP(), []int{0}
return file_shop_shop_db_proto_rawDescGZIP(), []int{1}
}
func (x *UserShopData) GetLastRefreshTime() int64 {
@ -143,20 +205,13 @@ func (x *UserShopData) GetManualRefreshNum() int32 {
return 0
}
func (x *UserShopData) GetItems() []int32 {
func (x *UserShopData) GetItems() []*UserShopGood {
if x != nil {
return x.Items
}
return nil
}
func (x *UserShopData) GetBuy() map[int32]int32 {
if x != nil {
return x.Buy
}
return nil
}
func (x *UserShopData) GetPreview() map[int32]*DB_Equipment {
if x != nil {
return x.Preview
@ -192,7 +247,7 @@ type DBShop struct {
func (x *DBShop) Reset() {
*x = DBShop{}
if protoimpl.UnsafeEnabled {
mi := &file_shop_shop_db_proto_msgTypes[1]
mi := &file_shop_shop_db_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -205,7 +260,7 @@ func (x *DBShop) String() string {
func (*DBShop) ProtoMessage() {}
func (x *DBShop) ProtoReflect() protoreflect.Message {
mi := &file_shop_shop_db_proto_msgTypes[1]
mi := &file_shop_shop_db_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -218,7 +273,7 @@ func (x *DBShop) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBShop.ProtoReflect.Descriptor instead.
func (*DBShop) Descriptor() ([]byte, []int) {
return file_shop_shop_db_proto_rawDescGZIP(), []int{1}
return file_shop_shop_db_proto_rawDescGZIP(), []int{2}
}
func (x *DBShop) GetId() string {
@ -304,69 +359,68 @@ var file_shop_shop_db_proto_rawDesc = []byte{
0x0a, 0x12, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x5f, 0x64, 0x62, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f,
0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x8d, 0x03, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44,
0x61, 0x74, 0x61, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x4c, 0x61,
0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a,
0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75,
0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52,
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12,
0x28, 0x0a, 0x03, 0x62, 0x75, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x75, 0x79, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x62, 0x75, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x65,
0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65,
0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12,
0x2e, 0x0a, 0x12, 0x6c, 0x65, 0x66, 0x74, 0x66, 0x72, 0x65, 0x65, 0x72, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x65, 0x66,
0x74, 0x66, 0x72, 0x65, 0x65, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x1a,
0x36, 0x0a, 0x08, 0x42, 0x75, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x49, 0x0a, 0x0c, 0x50, 0x72, 0x65, 0x76, 0x69,
0x65, 0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45, 0x71,
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x22, 0xc7, 0x03, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
0x2e, 0x0a, 0x12, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x67, 0x6f, 0x6c,
0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x72, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12,
0x30, 0x0a, 0x13, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x67, 0x6f,
0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x72, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f,
0x70, 0x12, 0x29, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61,
0x74, 0x61, 0x52, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2f, 0x0a, 0x0b,
0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61,
0x52, 0x0b, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a,
0x07, 0x70, 0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70,
0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f,
0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68,
0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x12,
0x31, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x18,
0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70,
0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68,
0x6f, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x0a,
0x74, 0x6f, 0x22, 0x42, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f,
0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x75, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x03, 0x62, 0x75, 0x79, 0x22, 0xba, 0x02, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53,
0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x52,
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0f, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d,
0x65, 0x12, 0x2a, 0x0a, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x4d, 0x61, 0x6e,
0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x23, 0x0a,
0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x52, 0x05, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61,
0x74, 0x61, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x65, 0x66, 0x74,
0x66, 0x72, 0x65, 0x65, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x18, 0x06,
0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x65, 0x66, 0x74, 0x66, 0x72, 0x65, 0x65, 0x72, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x1a, 0x49, 0x0a, 0x0c, 0x50, 0x72, 0x65, 0x76,
0x69, 0x65, 0x77, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45,
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x22, 0xc7, 0x03, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x67, 0x6f,
0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x72, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70,
0x12, 0x30, 0x0a, 0x13, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x67,
0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x72,
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68,
0x6f, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44,
0x61, 0x74, 0x61, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2d, 0x0a,
0x0a, 0x73, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61,
0x52, 0x0a, 0x73, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x2a, 0x7d, 0x0a, 0x08,
0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x75, 0x6c, 0x6c,
0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x01,
0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x10,
0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x50, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x03, 0x12, 0x0b,
0x0a, 0x07, 0x50, 0x56, 0x45, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x41,
0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x05, 0x12, 0x0c, 0x0a,
0x08, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x53,
0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x61, 0x74, 0x61, 0x52, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2f, 0x0a,
0x0b, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74,
0x61, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27,
0x0a, 0x07, 0x70, 0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07,
0x70, 0x76, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68,
0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53,
0x68, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x76, 0x65, 0x53, 0x68, 0x6f, 0x70,
0x12, 0x31, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70,
0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f,
0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53,
0x68, 0x6f, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70,
0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x2d,
0x0a, 0x0a, 0x73, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x70, 0x44, 0x61, 0x74,
0x61, 0x52, 0x0a, 0x73, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x2a, 0x7d, 0x0a,
0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x75, 0x6c,
0x6c, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x6f, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x70, 0x10,
0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x53, 0x68, 0x6f, 0x70,
0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x56, 0x50, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x03, 0x12,
0x0b, 0x0a, 0x07, 0x50, 0x56, 0x45, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c,
0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x05, 0x12, 0x0c,
0x0a, 0x08, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a,
0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x68, 0x6f, 0x70, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -385,22 +439,22 @@ var file_shop_shop_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_shop_shop_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_shop_shop_db_proto_goTypes = []interface{}{
(ShopType)(0), // 0: ShopType
(*UserShopData)(nil), // 1: UserShopData
(*DBShop)(nil), // 2: DBShop
nil, // 3: UserShopData.BuyEntry
(*UserShopGood)(nil), // 1: UserShopGood
(*UserShopData)(nil), // 2: UserShopData
(*DBShop)(nil), // 3: DBShop
nil, // 4: UserShopData.PreviewEntry
(*DB_Equipment)(nil), // 5: DB_Equipment
}
var file_shop_shop_db_proto_depIdxs = []int32{
3, // 0: UserShopData.buy:type_name -> UserShopData.BuyEntry
1, // 0: UserShopData.Items:type_name -> UserShopGood
4, // 1: UserShopData.preview:type_name -> UserShopData.PreviewEntry
1, // 2: DBShop.goldShop:type_name -> UserShopData
1, // 3: DBShop.diamondShop:type_name -> UserShopData
1, // 4: DBShop.pvpShop:type_name -> UserShopData
1, // 5: DBShop.pveShop:type_name -> UserShopData
1, // 6: DBShop.allianceShop:type_name -> UserShopData
1, // 7: DBShop.heroShop:type_name -> UserShopData
1, // 8: DBShop.smithyShop:type_name -> UserShopData
2, // 2: DBShop.goldShop:type_name -> UserShopData
2, // 3: DBShop.diamondShop:type_name -> UserShopData
2, // 4: DBShop.pvpShop:type_name -> UserShopData
2, // 5: DBShop.pveShop:type_name -> UserShopData
2, // 6: DBShop.allianceShop:type_name -> UserShopData
2, // 7: DBShop.heroShop:type_name -> UserShopData
2, // 8: DBShop.smithyShop:type_name -> UserShopData
5, // 9: UserShopData.PreviewEntry.value:type_name -> DB_Equipment
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
@ -417,7 +471,7 @@ func file_shop_shop_db_proto_init() {
file_equipment_equipment_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_shop_shop_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserShopData); i {
switch v := v.(*UserShopGood); i {
case 0:
return &v.state
case 1:
@ -429,6 +483,18 @@ func file_shop_shop_db_proto_init() {
}
}
file_shop_shop_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserShopData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_shop_shop_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBShop); i {
case 0:
return &v.state

View File

@ -26,12 +26,13 @@ type ShopItem struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GoodsId int32 `protobuf:"varint,1,opt,name=GoodsId,proto3" json:"GoodsId"` //商品Id
Items []*UserAssets `protobuf:"bytes,2,rep,name=Items,proto3" json:"Items"` //货物
Consume []*UserAssets `protobuf:"bytes,3,rep,name=Consume,proto3" json:"Consume"` //消耗
Sale int32 `protobuf:"varint,4,opt,name=Sale,proto3" json:"Sale"` //打折
LeftBuyNum int32 `protobuf:"varint,5,opt,name=LeftBuyNum,proto3" json:"LeftBuyNum"` //还可购买次数
Preview *DB_Equipment `protobuf:"bytes,6,opt,name=preview,proto3" json:"preview"` //装备预览数据
Gid int32 `protobuf:"varint,1,opt,name=gid,proto3" json:"gid"` //商品id 唯一
GoodsId int32 `protobuf:"varint,2,opt,name=GoodsId,proto3" json:"GoodsId"` //商品配置id
Items []*UserAssets `protobuf:"bytes,3,rep,name=Items,proto3" json:"Items"` //货物
Consume []*UserAssets `protobuf:"bytes,4,rep,name=Consume,proto3" json:"Consume"` //消耗
Sale int32 `protobuf:"varint,5,opt,name=Sale,proto3" json:"Sale"` //打折
LeftBuyNum int32 `protobuf:"varint,6,opt,name=LeftBuyNum,proto3" json:"LeftBuyNum"` //还可购买次数
Preview *DB_Equipment `protobuf:"bytes,7,opt,name=preview,proto3" json:"preview"` //装备预览数据
}
func (x *ShopItem) Reset() {
@ -66,6 +67,13 @@ func (*ShopItem) Descriptor() ([]byte, []int) {
return file_shop_shop_msg_proto_rawDescGZIP(), []int{0}
}
func (x *ShopItem) GetGid() int32 {
if x != nil {
return x.Gid
}
return 0
}
func (x *ShopItem) GetGoodsId() int32 {
if x != nil {
return x.GoodsId
@ -259,7 +267,7 @@ type ShopBuyReq struct {
unknownFields protoimpl.UnknownFields
ShopType ShopType `protobuf:"varint,1,opt,name=ShopType,proto3,enum=ShopType" json:"ShopType"` //商店类型
GoodsId int32 `protobuf:"varint,2,opt,name=GoodsId,proto3" json:"GoodsId"` //商品Id
Gid int32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid"` //商品Id
BuyNum int32 `protobuf:"varint,3,opt,name=BuyNum,proto3" json:"BuyNum"` //商品购买数量
}
@ -302,9 +310,9 @@ func (x *ShopBuyReq) GetShopType() ShopType {
return ShopType_Null
}
func (x *ShopBuyReq) GetGoodsId() int32 {
func (x *ShopBuyReq) GetGid() int32 {
if x != nil {
return x.GoodsId
return x.Gid
}
return 0
}
@ -372,52 +380,52 @@ var file_shop_shop_msg_proto_rawDesc = []byte{
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x2f, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d,
0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x49, 0x74,
0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a,
0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x07, 0x43, 0x6f, 0x6e,
0x73, 0x75, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, 0x65, 0x66, 0x74,
0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4c, 0x65,
0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x76,
0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x5f, 0x45,
0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
0x77, 0x22, 0x5b, 0x0a, 0x0e, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73,
0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c,
0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49,
0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x22, 0x85,
0x02, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
0x73, 0x70, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x73, 0x54,
0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52,
0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x49, 0x73,
0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1f, 0x0a,
0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x53,
0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x2c,
0x0a, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c,
0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x0f,
0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x65, 0x66, 0x74, 0x66, 0x72,
0x65, 0x65, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01,
0x28, 0x05, 0x52, 0x12, 0x6c, 0x65, 0x66, 0x74, 0x66, 0x72, 0x65, 0x65, 0x72, 0x65, 0x66, 0x72,
0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x22, 0x65, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x70, 0x42, 0x75,
0x79, 0x52, 0x65, 0x71, 0x12, 0x25, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
0x65, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47,
0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f,
0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0x25, 0x0a,
0x0b, 0x53, 0x68, 0x6f, 0x70, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06,
0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73,
0x53, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d,
0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x67,
0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x05,
0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12,
0x25, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x07, 0x43,
0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, 0x65,
0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
0x4c, 0x65, 0x66, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x27, 0x0a, 0x07, 0x70, 0x72,
0x65, 0x76, 0x69, 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42,
0x5f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76,
0x69, 0x65, 0x77, 0x22, 0x5b, 0x0a, 0x0e, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52,
0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75,
0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68,
0x22, 0x85, 0x02, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05,
0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61,
0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f,
0x49, 0x73, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12,
0x1f, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09,
0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73,
0x12, 0x2c, 0x0a, 0x11, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65,
0x73, 0x68, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x53, 0x75, 0x72,
0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x28,
0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x65, 0x66, 0x74,
0x66, 0x72, 0x65, 0x65, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x18, 0x07,
0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x65, 0x66, 0x74, 0x66, 0x72, 0x65, 0x65, 0x72, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x75, 0x6d, 0x22, 0x5d, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x70,
0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x25, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x54,
0x79, 0x70, 0x65, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12,
0x16, 0x0a, 0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0x25, 0x0a, 0x0b, 0x53, 0x68, 0x6f, 0x70, 0x42,
0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63,
0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x42, 0x06,
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (