package msg

import "leafstalk/covenant/model"

// 扭蛋信息
type GachaInfo struct {
	PlayerId int64 `json:"userId"`
}

type ResponseGachaInfo struct {
	ErrCode int            `json:"errCode"`
	Msg     string         `json:"msg,omitempty"`
	Data    *GachaInfoData `json:"data"`
}

type GachaStatus struct {
	FreeRemainTime int64 `json:"freeRemainTime"` // 免费寻宝剩余时间
	GachaCount     int64 `json:"gachaCount"`     // 扭蛋次数
	ProcessReward  int64 `json:"processReward"`  // 已领取的最大进度奖励次数
	LuckNum        int64 `json:"luckNum"`        // 幸运值
}

type GachaInfoData struct {
	ActivityUId int64                   `json:"activityUId"` // 活动id
	RemainTime  int64                   `json:"remainTime"`  // 活动剩余时间
	Days        int64                   `json:"days"`        // 活动进行到第几天
	Gacha       *GachaStatus            `json:"gacha"`       // 寻宝状态
	Supply      *model.SupplyPrivilege2 `json:"supply"`      // 补给状态
	Pray        map[int64]int64         `json:"pray"`        // 兑换状态
	Gift        map[int64]int64         `json:"gift"`        // 礼包状态
}

// 扭蛋
type Gacha struct {
	PlayerId int64 `json:"userId"`
	Num      int64 `json:"num"`
	Free     int64 `json:"free"` //1:免费，0:不免费
}

type ResponseGacha struct {
	ErrCode int        `json:"errCode"`
	Msg     string     `json:"msg,omitempty"`
	Data    *GachaData `json:"data"`
}

type GachaData struct {
	Bundle    *model.DropedBundle `json:"bundle"`
	Cost      map[int64]int64     `json:"cost"`
	RewardIds []int64             `json:"rewardIds"`
	Gacha     *GachaStatus        `json:"gacha"`
}

// 扭蛋进度奖励
type GachaProcessReward struct {
	PlayerId int64 `json:"userId"`
}

type GachaProcessRewardData struct {
	Bundle *model.DropedBundle `json:"bundle"`
	Gacha  *GachaStatus        `json:"gacha"`
}

type ResponseGachaProcessReward struct {
	ErrCode int                     `json:"errCode"`
	Msg     string                  `json:"msg,omitempty"`
	Data    *GachaProcessRewardData `json:"data"`
}

// 扭蛋补给
type GachaSupply struct {
	PlayerId int64 `json:"userId"`
}

type GachaSupplyData struct {
	Bundle *model.DropedBundle     `json:"bundle"`
	Supply *model.SupplyPrivilege2 `json:"supply"` // 补给状态
}

type ResponseGachaSupply struct {
	ErrCode int              `json:"errCode"`
	Msg     string           `json:"msg,omitempty"`
	Data    *GachaSupplyData `json:"data"`
}

// 扭蛋祈福
type GachaPray struct {
	PlayerId int64 `json:"userId"`
}

type GachaPrayData struct {
	Bundle  *model.DropedBundle `json:"bundle"`
	Cost    map[int64]int64     `json:"cost"`
	DrawUid int64               `json:"drawUid"`
	Pray    map[int64]int64     `json:"pray"` // 兑换状态
}

type ResponseGachaPray struct {
	ErrCode int            `json:"errCode"`
	Msg     string         `json:"msg,omitempty"`
	Data    *GachaPrayData `json:"data"`
}

// 礼包购买
type GachaBuyGift struct {
	PlayerId int64 `json:"userId"`
	Num      int64 `json:"num"`
	Uid      int64 `json:"uid"`   // 客户端不用传
	Index    int64 `json:"index"` // 客户端不用传
}

type GachaBuyGiftData struct {
	Bundle *model.DropedBundle `json:"bundle"`
	Cost   map[int64]int64     `json:"cost"`
	Gift   map[int64]int64     `json:"gift"` // 礼包状态
}

type ResponseGachaBuyGift struct {
	ErrCode int               `json:"errCode"`
	Msg     string            `json:"msg,omitempty"`
	Data    *GachaBuyGiftData `json:"data"`
}
