package v1

import (
	"kami/api/commonApi"
	"kami/internal/model/entity"

	"github.com/gogf/gf/v2/frame/g"
)

type TMallGameAccountRecord struct {
	Count int `json:"count" description:"账户数量" v:"required#账户数量不为空;min:0,max:100#创建账户数量应大于0"`
}

type TMallGameAccountCreateReq struct {
	g.Meta `path:"/recharge/tMallGame/account/create" tags:"天猫游戏账户" method:"post" summary:"创建游戏账户"`
	TMallGameAccountRecord
}

type TMallGameAccountCreateRes struct{}

type TMallGameAccountListReq struct {
	g.Meta        `path:"/recharge/tMallGame/account/list" tags:"天猫游戏账户" method:"get" summary:"获取游戏账户列表"`
	AccountNumber string `json:"accountNumber" description:"账户账号"`
	commonApi.CommonPageReq
}

type TMallGameAccountListRes struct {
	commonApi.CommonPageRes[entity.V1RechargeTMallAccount]
}

type TMallGameAccountToggleReq struct {
	g.Meta `path:"/recharge/tMallGame/account/toggle" tags:"天猫游戏账户" method:"post" summary:"改变游戏账户状态"`
	commonApi.CommonStrId
}

type TMallGameAccountToggleRes struct{}

type TMallGameAccountDeleteReq struct {
	g.Meta `path:"/recharge/tMallGame/account/delete" tags:"天猫游戏账户" method:"delete" summary:"删除游戏账户"`
	commonApi.CommonStrId
}

type TMallGameAccountDeleteRes struct{}

type TMallGameAccountGetOneRandomReq struct {
	g.Meta    `path:"/recharge/tMallGame/account/getOneByRandom" tags:"天猫游戏账户" method:"get" summary:"随机获取一个游戏账户"`
	TimeStamp int    `json:"timeStamp" description:"时间戳"`
	OrderNo   string `json:"orderNo" description:"订单号"`
}

type TMallGameAccountGetOneRandomRes struct {
	AccountNumber string `json:"accountNumber" orm:"account_number" description:"账户"`
}

type TMallGameAccountAuthorizeGetKeyReq struct {
	g.Meta `path:"/recharge/tMallGame/account/auth/getAuthorizeKey" tags:"天猫游戏账户" method:"get" summary:"获取授权appKey"`
}

type TMallGameAccountAuthorizeGetKeyRes struct {
	Code        string `json:"code" description:"授权码"`
	RedirectUri string `json:"redirectUri" description:"回调地址"`
}

type TMallGameAccountTMallAuthStatusReq struct {
	g.Meta `path:"/recharge/tMallGame/account/auth/getTMallAuthStatus" tags:"天猫游戏账户" method:"get" summary:"检查天猫授权状态"`
}

type TMallGameAccountTMallAuthStatusRes struct {
	Status    bool   `json:"status" description:"授权状态"`
	ExpiredAt string `json:"expiredAt" description:"过期时间"`
}
