package msg import ( "encoding/json" "leafstalk/covenant/model" ) // const ( // PayMethodForbid = 0 // 禁止 // PayMethodNormal = 1 // 正常 // PayMethodClientService = 2 // 客服 // ) // const ( // PhoneAndroid = 1 // 安卓 // PhoneIos = 2 // 苹果 // ) // GetShops 获取商店商品 type GetShops struct { PlayerId int64 `json:"userId"` ClientPlat string `json:"clientPlat"` PlayerLevel int64 `json:"-"` UnlockDiscountGoods map[int64]struct{} `json:"-"` // 解锁的特惠商店商品id OwnedExchangeGoods map[int64]struct{} `json:"-"` // 已经拥有的兑换商店商品id } type GetShopsData struct { StoreDiscount map[int64]int64 `json:"storeDiscount"` // 特惠商店商品信息 {礼包id:购买次数} StoreDaily *StoreDailyDetail `json:"storeDaily"` // 每日商店商品信息 {槽位id} StoreGold map[int64]int64 `json:"storeGold"` // 金币商店商品信息 {礼包id:购买次数} StoreDiamond map[int64]int64 `json:"storeDiamond"` // 钻石商店商品信息 {礼包id:购买次数} StoreExchange map[int64]*StoreExchangeDetail `json:"storeExchange"` // 兑换商店商品信息 } type StoreExchangeDetail struct { BuyNum int64 `json:"buyNum"` // 购买次数 Owned int64 `json:"owned"` // 0:未拥有 1:已拥有 } type StoreDailyDetail struct { RefreshCountdown int64 `json:"refreshCountdown"` // 下次自动刷新倒计时 RefreshFreeNum int64 `json:"refreshFreeNum"` // 免费刷新次数 RefreshCoinNum int64 `json:"refreshCoinNum"` // 金币刷新次数 RefreshAdNum int64 `json:"refreshAdNum"` // 广告刷新次数 Goods map[int64]*model.DailyGood `json:"goods"` // 商品列表 {槽位id:{}} } type ResponseGetShops struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *GetShopsData `json:"data"` } // RefreshStore 刷新商店 const ( RefreshStoreTypeFree = 1 // 1:免费刷新 RefreshStoreTypeGold = 2 // 2:金币刷新 RefreshStoreTypeAd = 3 // 3:广告刷新 RefreshStoreTypeAuto = 4 // 4:自动刷新 ) type RefreshStore struct { PlayerId int64 `json:"userId"` Type int64 `json:"type"` PlayerLevel int64 `json:"-"` } type RefreshStoreData struct { Cost map[int64]int64 `json:"cost"` // 消耗 ShopsData *GetShopsData `json:"shopsData"` } type ResponseRefreshStore struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *RefreshStoreData `json:"data"` } // StoreBuyItem 商店内购买道具 const ( // 商店类型 StoreTypeDiscount = 1 // 1:特惠商店 StoreTypeDaily = 2 // 2:每日商店 StoreTypeGold = 3 // 3:金币商店 StoreTypeDiamond = 4 // 4:钻石商店 StoreTypeExchange = 5 // 5:兑换商店 ) type StoreBuyItem struct { PlayerId int64 `json:"userId"` ClientPlat string `json:"clientPlat"` StoreType int64 `json:"storeType"` // 商店类型 1:特惠商店 2:每日商店 3:金币商店 4:钻石商店 5:兑换商店 GoodsId int64 `json:"goodsId"` // 每日商店传槽位id,其余商店都是商品id BuyNum int64 `json:"buyNum"` // 购买次数 UnlockDiscountGoods map[int64]struct{} `json:"-"` // 解锁的特惠商店商品id OwnedExchangeGoods map[int64]struct{} `json:"-"` // 已经拥有的兑换商店商品id PlayerLevel int64 `json:"-"` } func (d *StoreBuyItem) String() string { b, _ := json.Marshal(d) return string(b) } type StoreBuyItemData struct { Cost map[int64]int64 `json:"cost"` // 消耗 Bundles *model.DropedBundle `json:"bundles"` // 得到 ShopsData *GetShopsData `json:"shopsData"` } type ResponseStoreBuyItem struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *StoreBuyItemData `json:"data"` } //type StoreSummary struct { // PlayerId int64 `json:"userId"` // ClientPlat string `json:"clientPlat"` //} // //type ResponseStoreSummary struct { // ErrCode int `json:"errCode"` // Msg string `json:"msg,omitempty"` // Data *StoreSummaryData `json:"data"` //} // //type StoreSummaryData struct { // Buys map[int64]int `json:"dailyBuys"` //已购商品 // Refresh map[int64]*model.RefreshGoods `json:"refresh"` //商品ID列表 //} // BuyItem gou type BuyItem struct { PlayerId int64 `json:"userId"` PayType int64 `json:"payType"` GoodsId int64 `json:"id"` Num int64 `json:"num"` ClientPlat string `json:"clientPlat"` } type ResponseBuyItem struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int `json:"data"` } // PayMethod int `json:"payMethod"` //1:正常虚拟支付 2:微信游戏外支付 3:抖音游戏内苹果机支付 // 创建订单 type NewOrder struct { PlayerId int64 `json:"userId"` GoodsId int64 `json:"goodsId"` Phone int64 `json:"phone"` // 1: 安卓; 2: 苹果 ClientPlat string `json:"clientPlat"` OpenId string `json:"openId"` //下面服务端用,客户端不用 SessionKey string `json:"sessionKey"` Level int64 `json:"level"` GdtVid string `json:"gdtVid"` ADSrc string `json:"adsrc"` } type ResponseNewOrder struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *NewOrderData `json:"data"` } type NewOrderData struct { OrderID string `json:"orderID"` PayMethod int `json:"payMethod"` //0: 禁止; 1: 正常; 2: 客服; SignData string `json:"signData"` //微信直购用 Sign string `json:"sign"` //微信直购用 UserSign string `json:"userSign"` //用户态签名 微信直购用 // Url string `json:"callUrl"` } type MidasPayItem struct { Mode string `json:"mode"` OfferId string `json:"offerId"` BuyQuantity int `json:"buyQuantity"` Env int `json:"env"` // 0:正式 1:沙箱 CurrencyType string `json:"currencyType"` ZoneId string `json:"zoneId"` ProductId string `json:"productId"` GoodsPrice int64 `json:"goodsPrice"` OutTradeNo string `json:"outTradeNo"` Attach string `json:"attach"` } // 检查商品购买限制 type CheckGoodsBuyLimit struct { PlayerId int64 `json:"playerId"` GoodsId int64 `json:"goodsId"` OutTradeNo string `json:"outTradeNo"` PayMethod int `json:"payMethod"` Platform string `json:"platform"` UseType int64 `json:"useType"` } type ResponseCheckGoodsBuyLimit struct { *CheckGoodsBuyLimit Result int `json:"result"` // 0:通过 其他:未通过的原因 } // 取消订单 type CancleOrder struct { PlayerID int64 `json:"userId"` OrderID string `json:"orderID"` Reason int64 `json:"reason"` ClientPlat string `json:"clientPlat"` } type ResponseCancleOrder struct { ErrCode int `json:"errCode"` Data string `json:"data"` } // type QueryOrder struct { // PlayerId int64 `json:"userId"` // OrderId string `json:"orderID"` // Num int64 `json:"num"` // // MidasPay int `json:"midasPay"` // } // type ResponseQueryOrderResult struct { // ErrCode int `json:"errCode"` // Msg string `json:"msg,omitempty"` // Data PayWaitData `json:"data"` // } // type PayWaitData struct { // Num int64 `json:"num"` // Cd int64 `json:"cd"` // } // type ResponseQueryOrder struct { // ErrCode int `json:"errCode"` // Msg string `json:"msg,omitempty"` // Data int64 `json:"data"` // } // type ResponseQueryOrder struct { // ErrCode int `json:"errCode"` // //Data *PayBuyData `json:"data"` // } type AndroidPayedNotify struct { GoodsID int64 `json:"goodsId"` OrderID string `json:"orderID"` } // 支付购买 type PayBuy struct { PlayerId int64 `json:"userId"` OutTradeNo string `json:"outTradeNo"` PayMethod int64 `json:"payMethod"` // 1: 游戏内支付; 2: 客服; Num int64 `json:"num"` //发送本消息次数 ClientPlat string `json:"clientPlat"` } type ResponsePayBuy struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *PayBuyData `json:"data"` } type PayBuyData struct { PayId int64 `json:"payId"` //计费点ID OutTradeNo string `json:"outTradeNo"` Type int64 `json:"type"` //1:等待 2:成功 3:取消 Bundles *model.DropedBundle `json:"bundles,omitempty"` CD int64 `json:"cd,omitempty"` } // type ResponsePayBuyWait struct { // ErrCode int `json:"errCode"` // Msg string `json:"msg,omitempty"` // Data int64 `json:"data"` // } // type PayBuyData struct { // GoodsId int64 `json:"goodsId"` // Diamond int `json:"diamond"` // Materials []*model.DropMaterial `json:"materials"` // Equipments []*model.DropEquipment `json:"equipments"` // Buffs *VipBuffData `json:"buffs"` // } // ItemBuy 游戏内通过货币购买道具 type ItemBuy struct { PlayerID int64 `json:"userId"` ItemID int64 `json:"itemId"` // 道具id Num int64 `json:"num"` // 购买数量 } type ItemBuyData struct { Cost map[int64]int64 `json:"cost"` // 消耗 Gets map[int64]int64 `json:"gets"` // 得到 } type ResponseItemBuy struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *ItemBuyData `json:"data"` } type ServerPayNotify struct { Plat string `json:"plat"` // OutOrderNo string `json:"outOrderNo"` // 游戏厂商下单传入的订单号 OpenId string `json:"openId"` // 美团侧玩家角色号 Price int64 `json:"price"` // 美团侧收到的游戏下单金额,单位:分. GoodsId string `json:"goodsId"` //购买的商品 } // ios 支付 默认 关闭(0),5级 type GmIosPay struct { MsgId string `json:"msgId"` IosPayOpenLevel int64 `json:"iosPay"` OperatorId int64 `json:"operatorId"` } type ResponseGmIosPay struct { ErrCode int `json:"errCode"` MsgId string `json:"msgId"` }