123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- package model
- import (
- "database/sql/driver"
- "fmt"
- jsoniter "github.com/json-iterator/go"
- )
- type PageResult struct {
- List any `json:"list"`
- Total int64 `json:"total"`
- }
- // PageInfo Paging common input parameter structure
- type PageInfo struct {
- Page int64 `json:"page" form:"page"` // 页码
- PageSize int64 `json:"pageSize" form:"pageSize"` // 每页大小
- Keyword string `json:"keyword" form:"keyword"` // 关键字
- }
- // ReqById Find by id structure
- type ReqById struct {
- Id int64 `json:"id" form:"id"` // 主键ID
- }
- // ReqByType Find by type structure
- type ReqByType struct {
- Type string `json:"type" form:"type"` // 类型
- }
- // ActPrize 活动奖励格式
- type ActPrize struct {
- Type int64 `json:"type"`
- Num int64 `json:"num"`
- Rtype int64 `json:"rtype"`
- Skin int64 `json:"skin"`
- IsTs int64 `json:"is_ts,omitempty"`
- }
- // PropPrize 除活动外的奖励格式
- type PropPrize struct {
- PropsId int64 `json:"propsId"`
- Num int64 `json:"num"`
- Skin int64 `json:"skin"`
- Rtype int64 `json:"rtype"`
- }
- type PropPrizes []PropPrize
- func (e *PropPrizes) Value() (driver.Value, error) {
- return jsoniter.Marshal(e)
- }
- // Scan 实现方法
- func (e *PropPrizes) Scan(input interface{}) error {
- return jsoniter.Unmarshal(input.([]byte), &e)
- }
- // StartEnd 范围
- type StartEnd struct {
- Start int64 `json:"start"`
- End int64 `json:"end"`
- }
- // LvRange 等级分组
- type LvRange struct {
- LvStart int64 `json:"lvStart"`
- LvEnd int64 `json:"lvEnd"`
- }
- // SpinsRange 体力分组
- type SpinsRange struct {
- SpinsStart int64 `json:"spinsStart"`
- SpinsEnd int64 `json:"spinsEnd"`
- }
- // VipPointRange Vip积分分组
- type VipPointRange struct {
- VipPointStart int64 `json:"vipPointStart"`
- VipPointEnd int64 `json:"vipPointEnd"`
- }
- // LostHourRange 流失小时分组
- type LostHourRange struct {
- LostHourStart int64 `json:"lostHourStart"`
- LostHourEnd int64 `json:"lostHourEnd"`
- }
- // StarRange 星星数分组
- type StarRange struct {
- StarStart int64 `json:"starStart"`
- StarEnd int64 `json:"starEnd"`
- }
- // CoinYRange Y值分组
- type CoinYRange struct {
- CoinYStart int64 `json:"coinYStart"`
- CoinYEnd int64 `json:"coinYEnd"`
- }
- // SsGroup 数数分组
- type SsGroup struct {
- Shushu []int64 `json:"shushu"`
- }
- // SlotWeightGroup 老虎机权重分组
- type SlotWeightGroup struct {
- SlotWeightGroup int64 `json:"slotWeightGroup"`
- }
- // OneLayerLvGroup 等级 一层分组
- type OneLayerLvGroup struct {
- Id int64 `json:"id"`
- LvRange
- }
- // OneLayerSsGroup 数数 一层分组
- type OneLayerSsGroup struct {
- Id int64 `json:"id"`
- SsGroup
- }
- // TwoLayerLvSpins 等级=>体力 两层分组
- type TwoLayerLvSpins struct {
- Id int64 `json:"id"`
- LvRange
- SpinsRange
- }
- // TwoLayerLvSsGroup 等级=>数数 两层分组
- type TwoLayerLvSsGroup struct {
- Id int64 `json:"id"`
- LvRange
- SsGroup
- }
- // ThreeLayer 等级=>体力=>数数 三层分组
- type ThreeLayer struct {
- Id int64 `json:"id"`
- LvRange
- SpinsRange
- SsGroup
- }
- type PrizeShow struct {
- PropsId int64 `json:"propsId"`
- Num int64 `json:"num"`
- Skin int64 `json:"skin"`
- JokerCardExpireTime int64 `json:"jokerCardExpireTime"`
- Cards []CardInfo `json:"cards"`
- ChestProps *ChestProps `json:"chestProps,omitempty"`
- SkinResourceId int64 `json:"skinResourceId"`
- }
- type CardInfo struct {
- Id int64 `json:"id"`
- IsNew bool `json:"isNew"`
- }
- type ChestProps struct {
- Skin int64 `json:"skin"`
- CardNum int64 `json:"cardNum"`
- JokerCardNum int64 `json:"jokerCardNum"`
- CoinsNum []int64 `json:"coinsNum"`
- SpinsNum []int64 `json:"spinsNum"`
- PetExp []int64 `json:"petExp"`
- PetFood int64 `json:"petFood"`
- SkinResourceId int64 `json:"skinResourceId"` //道具皮肤资源id
- LastRewardPid int64 `json:"lastRewardPid"` //最终大奖类型
- Props []*PrizeShow `json:"props"` //额外奖励道具
- }
- type Option struct {
- Value int64 `json:"value"`
- Label string `json:"label"`
- }
- type Options []Option
- type Option2 struct {
- Value string `json:"value"`
- Label string `json:"label"`
- }
- type Options2 []Option2
- type CollectFullConf struct {
- CollectBaseConf
- OneHit int64 `json:"one_hit"`
- TwoHit int64 `json:"two_hit"`
- ThreeHit int64 `json:"three_hit"`
- ConfType int64 `json:"confType"`
- }
- type CollectBaseConf struct {
- StealBreak int64 `json:"steal_break"` // 普通偷
- StealSuccess int64 `json:"steal_success"` // 完美偷
- AttackSuccess int64 `json:"attack_success"` // 打成功
- AttackBreak int64 `json:"attack_break"` // 打到盾
- }
- type ItemTitle struct {
- Item string `db:"item" json:"item"` // 类别
- Title string `db:"title" json:"title"` // 参数名 KEY
- }
- func (i *ItemTitle) String() string {
- return i.Item + "-" + i.Title
- }
- type Lang struct {
- ZH string `json:"ZH"` // 中文
- EN string `json:"EN"` // 英文
- TW string `json:"TW"` // 繁体
- FR string `json:"FR"` // 法语
- PT string `json:"PT"` // 葡萄牙语
- DE string `json:"DE"` // 德语
- ES string `json:"ES"` // 西班牙语
- TH string `json:"TH"` // 泰语
- ID string `json:"ID"` // 印尼语
- VI string `json:"VI"` // 越南语
- NO string `json:"NO"` // 挪威语
- RO string `json:"RO"` // 罗马尼亚
- MY string `json:"MY"` // 马来西亚
- IT string `json:"IT"` // 意大利
- PL string `json:"PL"` // 波兰
- }
- type EmailRepo struct {
- Id int64 `json:"id" db:"id"`
- Uid int64 `json:"uid" db:"uid"`
- Msgid int64 `json:"msgid" db:"msgid"`
- Got int64 `json:"got" db:"got"`
- Rewards any `json:"rewards" db:"rewards"`
- Expire int64 `json:"expire" db:"expire"`
- CreateTime int64 `json:"create_time" db:"create_time"`
- }
- func (*EmailRepo) TableName(uid int64) string {
- dbIdx := uid % 100
- return fmt.Sprintf("crazygod_user_sysmail.user_sysmail_%v", dbIdx)
- }
|