上传每日礼包商城和支付系统
This commit is contained in:
parent
23bd2c4202
commit
19ca86b154
275
bin/json/game_paypackage.json
Normal file
275
bin/json/game_paypackage.json
Normal file
@ -0,0 +1,275 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"refreshtime": 1,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_1",
|
||||
"text": "每日礼包"
|
||||
},
|
||||
"packagetype": "0",
|
||||
"buy_num": 1,
|
||||
"packagename": {
|
||||
"key": "paypackage_daily_1",
|
||||
"text": "每日礼包1"
|
||||
},
|
||||
"costitem": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 0
|
||||
}
|
||||
],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50001",
|
||||
"n": 5
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50002",
|
||||
"n": 5
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50003",
|
||||
"n": 5
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50004",
|
||||
"n": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"refreshtime": 1,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_1",
|
||||
"text": "每日礼包"
|
||||
},
|
||||
"packagetype": "10",
|
||||
"buy_num": 2,
|
||||
"packagename": {
|
||||
"key": "paypackage_daily_2",
|
||||
"text": "每日礼包2"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50005",
|
||||
"n": 5
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50006",
|
||||
"n": 5
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "50003",
|
||||
"n": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"refreshtime": 1,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_1",
|
||||
"text": "每日礼包"
|
||||
},
|
||||
"packagetype": "11",
|
||||
"buy_num": 2,
|
||||
"packagename": {
|
||||
"key": "paypackage_daily_3",
|
||||
"text": "每日礼包3"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60001",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"refreshtime": 7,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_7",
|
||||
"text": "每周礼包"
|
||||
},
|
||||
"packagetype": "12",
|
||||
"buy_num": 3,
|
||||
"packagename": {
|
||||
"key": "paypackage_weekly_1",
|
||||
"text": "每周礼包1"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"refreshtime": 7,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_7",
|
||||
"text": "每周礼包"
|
||||
},
|
||||
"packagetype": "13",
|
||||
"buy_num": 3,
|
||||
"packagename": {
|
||||
"key": "paypackage_weekly_2",
|
||||
"text": "每周礼包2"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"refreshtime": 7,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_7",
|
||||
"text": "每周礼包"
|
||||
},
|
||||
"packagetype": "14",
|
||||
"buy_num": 3,
|
||||
"packagename": {
|
||||
"key": "paypackage_weekly_3",
|
||||
"text": "每周礼包3"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"refreshtime": 7,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_7",
|
||||
"text": "每周礼包"
|
||||
},
|
||||
"packagetype": "15",
|
||||
"buy_num": 3,
|
||||
"packagename": {
|
||||
"key": "paypackage_weekly_4",
|
||||
"text": "每周礼包4"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"refreshtime": 7,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_7",
|
||||
"text": "每周礼包"
|
||||
},
|
||||
"packagetype": "16",
|
||||
"buy_num": 3,
|
||||
"packagename": {
|
||||
"key": "paypackage_weekly_5",
|
||||
"text": "每周礼包5"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"refreshtime": 30,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_30",
|
||||
"text": "每月礼包"
|
||||
},
|
||||
"packagetype": "17",
|
||||
"buy_num": 1,
|
||||
"packagename": {
|
||||
"key": "paypackage_mouthly_1",
|
||||
"text": "每月礼包1"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60003",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"refreshtime": 30,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_30",
|
||||
"text": "每月礼包"
|
||||
},
|
||||
"packagetype": "18",
|
||||
"buy_num": 1,
|
||||
"packagename": {
|
||||
"key": "paypackage_mouthly_2",
|
||||
"text": "每月礼包2"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60003",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"refreshtime": 30,
|
||||
"pagename": {
|
||||
"key": "paypackage_type_30",
|
||||
"text": "每月礼包"
|
||||
},
|
||||
"packagetype": "19",
|
||||
"buy_num": 1,
|
||||
"packagename": {
|
||||
"key": "paypackage_mouthly_3",
|
||||
"text": "每月礼包3"
|
||||
},
|
||||
"costitem": [],
|
||||
"item": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "60003",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -181,6 +181,8 @@ const (
|
||||
TablePay = "payorder"
|
||||
///充值数据表
|
||||
TablePayUser = "payuser"
|
||||
///充值数据表 每日礼包
|
||||
TablePayDaily = "paydaily"
|
||||
// 巨怪列车收益记录
|
||||
TableTrollRecord = "trollrecord"
|
||||
)
|
||||
|
49
modules/pay/api_dailybuy.go
Normal file
49
modules/pay/api_dailybuy.go
Normal file
@ -0,0 +1,49 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) DailyBuyCheck(session comm.IUserSession, req *pb.PayDailyBuyReq) (code pb.ErrorCode) {
|
||||
if req.Id == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///获取系统公告
|
||||
func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
info *pb.DBPayDaily
|
||||
conf *cfg.GamePayPackageData
|
||||
err error
|
||||
)
|
||||
if code = this.DailyBuyCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
if conf, err = this.module.configure.getPayPackageData(req.Id); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if info, err = this.module.modelDaily.queryUserDaily(session.GetUserId()); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if info.Items[conf.Id] != nil {
|
||||
if info.Items[conf.Id].Buyunm <= 0 {
|
||||
code = pb.ErrorCode_PayBuyNumNotEnough
|
||||
return
|
||||
}
|
||||
}
|
||||
if code = this.module.modelDaily.delivery(session.GetUserId(), conf.Packagetype); code == pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "dailybuy", &pb.PayDailyBuyResp{Isucc: true})
|
||||
return
|
||||
}
|
@ -3,6 +3,8 @@ package pay
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
@ -16,13 +18,28 @@ func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.PayInfoReq) (c
|
||||
///获取系统公告
|
||||
func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
info *pb.DBPayUser
|
||||
info *pb.DBPayDaily
|
||||
conf *cfg.GamePayPackageData
|
||||
err error
|
||||
)
|
||||
if code = this.InfoCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
if info, err = this.module.modelUser.queryUserData(session.GetUserId()); err != nil {
|
||||
if info, err = this.module.modelDaily.queryUserDaily(session.GetUserId()); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
for _, v := range info.Items {
|
||||
if time.Now().Sub(time.Unix(v.Lastrefresh, 0)).Hours() > 24 {
|
||||
if conf, err = this.module.configure.getPayPackageData(v.Id); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
v.Buyunm = conf.BuyNum
|
||||
v.Lastrefresh = time.Now().Unix()
|
||||
}
|
||||
}
|
||||
if err = this.module.modelDaily.updateUserDaily(info); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
|
||||
const (
|
||||
game_recharge = "game_recharge.json"
|
||||
game_paypackage = "game_paypackage.json"
|
||||
)
|
||||
|
||||
///背包配置管理组件
|
||||
@ -22,6 +23,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Pay)
|
||||
this.LoadConfigure(game_recharge, cfg.NewGameRecharge)
|
||||
this.LoadConfigure(game_paypackage, cfg.NewGamePayPackage)
|
||||
return
|
||||
}
|
||||
|
||||
@ -43,3 +45,42 @@ func (this *configureComp) getGameRecharge(id string) (result *cfg.GameRechargeD
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//获取手动加入频道 任务限制
|
||||
func (this *configureComp) getPayPackageData(id int32) (result *cfg.GamePayPackageData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_paypackage); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
} else {
|
||||
if result, ok = v.(*cfg.GamePayPackage).GetDataMap()[id]; !ok {
|
||||
err = fmt.Errorf("getGameRecharge on found %d", id)
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//获取手动加入频道 任务限制
|
||||
func (this *configureComp) getPayPackageDataByPid(pid string) (result *cfg.GamePayPackageData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
)
|
||||
if v, err = this.GetConfigure(game_paypackage); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
} else {
|
||||
for _, v := range v.(*cfg.GamePayPackage).GetDataMap() {
|
||||
if v.Packagetype == pid {
|
||||
result = v
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
err = fmt.Errorf("getPayPackageDataByPid no found %s", pid)
|
||||
return
|
||||
}
|
||||
|
84
modules/pay/modelDaily.go
Normal file
84
modules/pay/modelDaily.go
Normal file
@ -0,0 +1,84 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
///每日礼包
|
||||
type modelDailyComp struct {
|
||||
modules.MCompModel
|
||||
module *Pay
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *modelDailyComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) {
|
||||
this.MCompModel.Init(service, module, comp, opt)
|
||||
this.module = module.(*Pay)
|
||||
this.TableName = comm.TablePayDaily
|
||||
//创建uid索引
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
//查询用户重置数据
|
||||
func (this *modelDailyComp) queryUserDaily(uId string) (result *pb.DBPayDaily, err error) {
|
||||
result = &pb.DBPayDaily{}
|
||||
if err = this.Get(uId, result); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//添加用户订单数据
|
||||
func (this *modelDailyComp) updateUserDaily(info *pb.DBPayDaily) (err error) {
|
||||
if err = this.Change(info.Uid, map[string]interface{}{
|
||||
"items": info.Items,
|
||||
}); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//每日礼包发货
|
||||
func (this *modelDailyComp) delivery(uid, pid string) (code pb.ErrorCode) {
|
||||
var (
|
||||
info *pb.DBPayDaily
|
||||
conf *cfg.GamePayPackageData
|
||||
err error
|
||||
)
|
||||
if conf, err = this.module.configure.getPayPackageDataByPid(pid); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if info, err = this.queryUserDaily(uid); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if info.Items[conf.Id] == nil {
|
||||
info.Items[conf.Id] = &pb.PayDailyItem{
|
||||
Id: conf.Id,
|
||||
Buyunm: conf.BuyNum,
|
||||
Lastrefresh: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
info.Items[conf.Id].Buyunm--
|
||||
if err = this.updateUserDaily(info); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
///论坛 数据组件
|
||||
type modelUserComp struct {
|
||||
modules.MCompModel
|
||||
module *Pay
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *modelUserComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) {
|
||||
this.MCompModel.Init(service, module, comp, opt)
|
||||
this.module = module.(*Pay)
|
||||
this.TableName = comm.TablePayUser
|
||||
//创建uid索引
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
//查询用户重置数据
|
||||
func (this *modelUserComp) queryUserData(uId string) (result *pb.DBPayUser, err error) {
|
||||
result = &pb.DBPayUser{}
|
||||
if err = this.Get(uId, result); err != nil && err != mgo.MongodbNil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
}
|
||||
if err == mgo.MongodbNil {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
@ -27,7 +27,7 @@ type Pay struct {
|
||||
service base.IRPCXService
|
||||
api *apiComp
|
||||
modelPay *modelPayComp
|
||||
modelUser *modelUserComp
|
||||
modelDaily *modelDailyComp
|
||||
configure *configureComp
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ func (this *Pay) OnInstallComp() {
|
||||
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.modelPay = this.RegisterComp(new(modelPayComp)).(*modelPayComp)
|
||||
this.modelUser = this.RegisterComp(new(modelUserComp)).(*modelUserComp)
|
||||
this.modelDaily = this.RegisterComp(new(modelDailyComp)).(*modelDailyComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
@ -63,7 +63,6 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
|
||||
this.Debug("Rpc_ModulePayDelivery", log.Field{Key: "args", Value: args.String()})
|
||||
var (
|
||||
conf *cfg.GameRechargeData
|
||||
user *pb.DBPayUser
|
||||
res []*cfg.Gameatn
|
||||
session comm.IUserSession
|
||||
online bool
|
||||
@ -74,16 +73,6 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
|
||||
return
|
||||
}
|
||||
|
||||
if user, err = this.modelUser.queryUserData(args.Uid); err != nil {
|
||||
reply.Code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if user.Goods[args.Productid] > 0 {
|
||||
res = conf.Vipexp
|
||||
} else {
|
||||
res = conf.DiamondNumDouble
|
||||
}
|
||||
|
||||
if session, online = this.GetUserSession(args.Uid); online {
|
||||
if reply.Code = this.DispenseRes(session, res, true); reply.Code != pb.ErrorCode_Success {
|
||||
return
|
||||
@ -112,6 +101,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
|
||||
case 1:
|
||||
break
|
||||
case 2:
|
||||
reply.Code = this.modelDaily.delivery(args.Uid, args.Productid)
|
||||
break
|
||||
}
|
||||
return
|
||||
|
@ -248,6 +248,8 @@ const (
|
||||
// horoscope
|
||||
ErrorCode_HoroscopeNotTurnedOn ErrorCode = 3401 //未开启
|
||||
ErrorCode_HoroscopeRestCDNoEnd ErrorCode = 3402 //重置cd未结束
|
||||
// pay
|
||||
ErrorCode_PayBuyNumNotEnough ErrorCode = 35001 //每日礼包购买次数不足
|
||||
)
|
||||
|
||||
// Enum value maps for ErrorCode.
|
||||
@ -455,6 +457,7 @@ var (
|
||||
3305: "TrollRepeatedReward",
|
||||
3401: "HoroscopeNotTurnedOn",
|
||||
3402: "HoroscopeRestCDNoEnd",
|
||||
35001: "PayBuyNumNotEnough",
|
||||
}
|
||||
ErrorCode_value = map[string]int32{
|
||||
"Success": 0,
|
||||
@ -659,6 +662,7 @@ var (
|
||||
"TrollRepeatedReward": 3305,
|
||||
"HoroscopeNotTurnedOn": 3401,
|
||||
"HoroscopeRestCDNoEnd": 3402,
|
||||
"PayBuyNumNotEnough": 35001,
|
||||
}
|
||||
)
|
||||
|
||||
@ -693,7 +697,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, 0xd8, 0x23, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x6f, 0x2a, 0xf2, 0x23, 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,
|
||||
@ -978,8 +982,10 @@ var file_errorcode_proto_rawDesc = []byte{
|
||||
0x61, 0x72, 0x64, 0x10, 0xe9, 0x19, 0x12, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63,
|
||||
0x6f, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x54, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x10, 0xc9,
|
||||
0x1a, 0x12, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65,
|
||||
0x73, 0x74, 0x43, 0x44, 0x4e, 0x6f, 0x45, 0x6e, 0x64, 0x10, 0xca, 0x1a, 0x42, 0x06, 0x5a, 0x04,
|
||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x73, 0x74, 0x43, 0x44, 0x4e, 0x6f, 0x45, 0x6e, 0x64, 0x10, 0xca, 0x1a, 0x12, 0x18, 0x0a, 0x12,
|
||||
0x50, 0x61, 0x79, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75,
|
||||
0x67, 0x68, 0x10, 0xb9, 0x91, 0x02, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
164
pb/pay_db.pb.go
164
pb/pay_db.pb.go
@ -92,18 +92,20 @@ func (x *DBPayOrder) GetCtime() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
//用户重置数据表
|
||||
type DBPayUser struct {
|
||||
//每日商城商品数据
|
||||
type PayDailyItem struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //用户id
|
||||
Goods map[string]int32 `protobuf:"bytes,2,rep,name=goods,proto3" json:"goods" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //商品购买次数
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
|
||||
Isfirst bool `protobuf:"varint,2,opt,name=isfirst,proto3" json:"isfirst"`
|
||||
Buyunm int32 `protobuf:"varint,3,opt,name=buyunm,proto3" json:"buyunm"`
|
||||
Lastrefresh int64 `protobuf:"varint,4,opt,name=lastrefresh,proto3" json:"lastrefresh"`
|
||||
}
|
||||
|
||||
func (x *DBPayUser) Reset() {
|
||||
*x = DBPayUser{}
|
||||
func (x *PayDailyItem) Reset() {
|
||||
*x = PayDailyItem{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_db_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -111,13 +113,13 @@ func (x *DBPayUser) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBPayUser) String() string {
|
||||
func (x *PayDailyItem) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBPayUser) ProtoMessage() {}
|
||||
func (*PayDailyItem) ProtoMessage() {}
|
||||
|
||||
func (x *DBPayUser) ProtoReflect() protoreflect.Message {
|
||||
func (x *PayDailyItem) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_db_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -129,21 +131,91 @@ func (x *DBPayUser) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DBPayUser.ProtoReflect.Descriptor instead.
|
||||
func (*DBPayUser) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use PayDailyItem.ProtoReflect.Descriptor instead.
|
||||
func (*PayDailyItem) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *DBPayUser) GetUid() string {
|
||||
func (x *PayDailyItem) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PayDailyItem) GetIsfirst() bool {
|
||||
if x != nil {
|
||||
return x.Isfirst
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *PayDailyItem) GetBuyunm() int32 {
|
||||
if x != nil {
|
||||
return x.Buyunm
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PayDailyItem) GetLastrefresh() int64 {
|
||||
if x != nil {
|
||||
return x.Lastrefresh
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
//用户每日礼包
|
||||
type DBPayDaily struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //用户id
|
||||
Items map[int32]*PayDailyItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //商品购买次数
|
||||
}
|
||||
|
||||
func (x *DBPayDaily) Reset() {
|
||||
*x = DBPayDaily{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_db_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBPayDaily) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBPayDaily) ProtoMessage() {}
|
||||
|
||||
func (x *DBPayDaily) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_db_proto_msgTypes[2]
|
||||
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 DBPayDaily.ProtoReflect.Descriptor instead.
|
||||
func (*DBPayDaily) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_db_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DBPayDaily) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBPayUser) GetGoods() map[string]int32 {
|
||||
func (x *DBPayDaily) GetItems() map[int32]*PayDailyItem {
|
||||
if x != nil {
|
||||
return x.Goods
|
||||
return x.Items
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -159,16 +231,24 @@ var file_pay_pay_db_proto_rawDesc = []byte{
|
||||
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x22, 0x84, 0x01, 0x0a, 0x09, 0x44, 0x42, 0x50, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
|
||||
0x12, 0x2b, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x15, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x6f, 0x6f, 0x64,
|
||||
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x1a, 0x38, 0x0a,
|
||||
0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x22, 0x72, 0x0a, 0x0c, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x07, 0x69, 0x73, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75,
|
||||
0x79, 0x75, 0x6e, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, 0x79, 0x75,
|
||||
0x6e, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73,
|
||||
0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x66,
|
||||
0x72, 0x65, 0x73, 0x68, 0x22, 0x95, 0x01, 0x0a, 0x0a, 0x44, 0x42, 0x50, 0x61, 0x79, 0x44, 0x61,
|
||||
0x69, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c,
|
||||
0x79, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69, 0x74,
|
||||
0x65, 0x6d, 0x73, 0x1a, 0x47, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 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, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04,
|
||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -183,19 +263,21 @@ func file_pay_pay_db_proto_rawDescGZIP() []byte {
|
||||
return file_pay_pay_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pay_pay_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_pay_pay_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_pay_pay_db_proto_goTypes = []interface{}{
|
||||
(*DBPayOrder)(nil), // 0: DBPayOrder
|
||||
(*DBPayUser)(nil), // 1: DBPayUser
|
||||
nil, // 2: DBPayUser.GoodsEntry
|
||||
(*PayDailyItem)(nil), // 1: PayDailyItem
|
||||
(*DBPayDaily)(nil), // 2: DBPayDaily
|
||||
nil, // 3: DBPayDaily.ItemsEntry
|
||||
}
|
||||
var file_pay_pay_db_proto_depIdxs = []int32{
|
||||
2, // 0: DBPayUser.goods:type_name -> DBPayUser.GoodsEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
3, // 0: DBPayDaily.items:type_name -> DBPayDaily.ItemsEntry
|
||||
1, // 1: DBPayDaily.ItemsEntry.value:type_name -> PayDailyItem
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pay_pay_db_proto_init() }
|
||||
@ -217,7 +299,19 @@ func file_pay_pay_db_proto_init() {
|
||||
}
|
||||
}
|
||||
file_pay_pay_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBPayUser); i {
|
||||
switch v := v.(*PayDailyItem); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pay_pay_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBPayDaily); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -235,7 +329,7 @@ func file_pay_pay_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pay_pay_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
189
pb/pay_msg.pb.go
189
pb/pay_msg.pb.go
@ -64,7 +64,7 @@ type PayInfoResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Info *DBPayUser `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
|
||||
Info *DBPayDaily `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
|
||||
}
|
||||
|
||||
func (x *PayInfoResp) Reset() {
|
||||
@ -99,13 +99,108 @@ func (*PayInfoResp) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *PayInfoResp) GetInfo() *DBPayUser {
|
||||
func (x *PayInfoResp) GetInfo() *DBPayDaily {
|
||||
if x != nil {
|
||||
return x.Info
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//购买每日礼包
|
||||
type PayDailyBuyReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyReq) Reset() {
|
||||
*x = PayDailyBuyReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PayDailyBuyReq) ProtoMessage() {}
|
||||
|
||||
func (x *PayDailyBuyReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[2]
|
||||
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 PayDailyBuyReq.ProtoReflect.Descriptor instead.
|
||||
func (*PayDailyBuyReq) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyReq) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PayDailyBuyResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Isucc bool `protobuf:"varint,1,opt,name=isucc,proto3" json:"isucc"`
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyResp) Reset() {
|
||||
*x = PayDailyBuyResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PayDailyBuyResp) ProtoMessage() {}
|
||||
|
||||
func (x *PayDailyBuyResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[3]
|
||||
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 PayDailyBuyResp.ProtoReflect.Descriptor instead.
|
||||
func (*PayDailyBuyResp) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *PayDailyBuyResp) GetIsucc() bool {
|
||||
if x != nil {
|
||||
return x.Isucc
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
///支付系统发货请求
|
||||
type PayDeliveryReq struct {
|
||||
state protoimpl.MessageState
|
||||
@ -120,7 +215,7 @@ type PayDeliveryReq struct {
|
||||
func (x *PayDeliveryReq) Reset() {
|
||||
*x = PayDeliveryReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[2]
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -133,7 +228,7 @@ func (x *PayDeliveryReq) String() string {
|
||||
func (*PayDeliveryReq) ProtoMessage() {}
|
||||
|
||||
func (x *PayDeliveryReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[2]
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -146,7 +241,7 @@ func (x *PayDeliveryReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PayDeliveryReq.ProtoReflect.Descriptor instead.
|
||||
func (*PayDeliveryReq) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{2}
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *PayDeliveryReq) GetUid() string {
|
||||
@ -183,7 +278,7 @@ type PayDeliveryResp struct {
|
||||
func (x *PayDeliveryResp) Reset() {
|
||||
*x = PayDeliveryResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[3]
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -196,7 +291,7 @@ func (x *PayDeliveryResp) String() string {
|
||||
func (*PayDeliveryResp) ProtoMessage() {}
|
||||
|
||||
func (x *PayDeliveryResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[3]
|
||||
mi := &file_pay_pay_msg_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -209,7 +304,7 @@ func (x *PayDeliveryResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PayDeliveryResp.ProtoReflect.Descriptor instead.
|
||||
func (*PayDeliveryResp) Descriptor() ([]byte, []int) {
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{3}
|
||||
return file_pay_pay_msg_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *PayDeliveryResp) GetCode() ErrorCode {
|
||||
@ -233,21 +328,25 @@ var file_pay_pay_msg_proto_rawDesc = []byte{
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x70, 0x61, 0x79, 0x2f, 0x70, 0x61, 0x79, 0x5f, 0x64, 0x62, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0c, 0x0a, 0x0a, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52,
|
||||
0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x69,
|
||||
0x6e, 0x66, 0x6f, 0x22, 0x5a, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65,
|
||||
0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69,
|
||||
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x22,
|
||||
0x43, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65,
|
||||
0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x6d, 0x73, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6f, 0x52, 0x65, 0x71, 0x22, 0x2e, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52,
|
||||
0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x52, 0x04,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x22, 0x20, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79,
|
||||
0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69,
|
||||
0x6c, 0x79, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x75,
|
||||
0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x75, 0x63, 0x63, 0x22,
|
||||
0x5a, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65,
|
||||
0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x64, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x50,
|
||||
0x61, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e,
|
||||
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67,
|
||||
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -262,18 +361,20 @@ func file_pay_pay_msg_proto_rawDescGZIP() []byte {
|
||||
return file_pay_pay_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pay_pay_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_pay_pay_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_pay_pay_msg_proto_goTypes = []interface{}{
|
||||
(*PayInfoReq)(nil), // 0: PayInfoReq
|
||||
(*PayInfoResp)(nil), // 1: PayInfoResp
|
||||
(*PayDeliveryReq)(nil), // 2: PayDeliveryReq
|
||||
(*PayDeliveryResp)(nil), // 3: PayDeliveryResp
|
||||
(*DBPayUser)(nil), // 4: DBPayUser
|
||||
(ErrorCode)(0), // 5: ErrorCode
|
||||
(*PayDailyBuyReq)(nil), // 2: PayDailyBuyReq
|
||||
(*PayDailyBuyResp)(nil), // 3: PayDailyBuyResp
|
||||
(*PayDeliveryReq)(nil), // 4: PayDeliveryReq
|
||||
(*PayDeliveryResp)(nil), // 5: PayDeliveryResp
|
||||
(*DBPayDaily)(nil), // 6: DBPayDaily
|
||||
(ErrorCode)(0), // 7: ErrorCode
|
||||
}
|
||||
var file_pay_pay_msg_proto_depIdxs = []int32{
|
||||
4, // 0: PayInfoResp.info:type_name -> DBPayUser
|
||||
5, // 1: PayDeliveryResp.code:type_name -> ErrorCode
|
||||
6, // 0: PayInfoResp.info:type_name -> DBPayDaily
|
||||
7, // 1: PayDeliveryResp.code:type_name -> ErrorCode
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
@ -314,7 +415,7 @@ func file_pay_pay_msg_proto_init() {
|
||||
}
|
||||
}
|
||||
file_pay_pay_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayDeliveryReq); i {
|
||||
switch v := v.(*PayDailyBuyReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@ -326,6 +427,30 @@ func file_pay_pay_msg_proto_init() {
|
||||
}
|
||||
}
|
||||
file_pay_pay_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayDailyBuyResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pay_pay_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayDeliveryReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pay_pay_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PayDeliveryResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -344,7 +469,7 @@ func file_pay_pay_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pay_pay_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
42
sys/configure/structs/Game.PayPackage.go
Normal file
42
sys/configure/structs/Game.PayPackage.go
Normal file
@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
type GamePayPackage struct {
|
||||
_dataMap map[int32]*GamePayPackageData
|
||||
_dataList []*GamePayPackageData
|
||||
}
|
||||
|
||||
func NewGamePayPackage(_buf []map[string]interface{}) (*GamePayPackage, error) {
|
||||
_dataList := make([]*GamePayPackageData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GamePayPackageData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGamePayPackageData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Id] = _v
|
||||
}
|
||||
}
|
||||
return &GamePayPackage{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GamePayPackage) GetDataMap() map[int32]*GamePayPackageData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GamePayPackage) GetDataList() []*GamePayPackageData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GamePayPackage) Get(key int32) *GamePayPackageData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
75
sys/configure/structs/Game.PayPackageData.go
Normal file
75
sys/configure/structs/Game.PayPackageData.go
Normal file
@ -0,0 +1,75 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
import "errors"
|
||||
|
||||
type GamePayPackageData struct {
|
||||
Id int32
|
||||
Refreshtime int32
|
||||
Pagename string
|
||||
Packagetype string
|
||||
BuyNum int32
|
||||
Packagename string
|
||||
Costitem []*Gameatn
|
||||
Item []*Gameatn
|
||||
}
|
||||
|
||||
const TypeId_GamePayPackageData = 860897476
|
||||
|
||||
func (*GamePayPackageData) GetTypeId() int32 {
|
||||
return 860897476
|
||||
}
|
||||
|
||||
func (_v *GamePayPackageData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["refreshtime"].(float64); !_ok_ { err = errors.New("refreshtime error"); return }; _v.Refreshtime = int32(_tempNum_) }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["pagename"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Pagename error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Pagename, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{ var _ok_ bool; if _v.Packagetype, _ok_ = _buf["packagetype"].(string); !_ok_ { err = errors.New("packagetype error"); return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["buy_num"].(float64); !_ok_ { err = errors.New("buy_num error"); return }; _v.BuyNum = int32(_tempNum_) }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["packagename"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Packagename error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Packagename, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["costitem"].([]interface{}); !_ok_ { err = errors.New("costitem error"); return }
|
||||
|
||||
_v.Costitem = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Costitem = append(_v.Costitem, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["item"].([]interface{}); !_ok_ { err = errors.New("item error"); return }
|
||||
|
||||
_v.Item = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Item = append(_v.Item, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGamePayPackageData(_buf map[string]interface{}) (*GamePayPackageData, error) {
|
||||
v := &GamePayPackageData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user