package v1

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

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

type OriginalJDAccountDeleteReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/delete" tags:"京东充值卡账户" method:"delete" summary:"删除京东充值卡"`
	commonApi.CommonStrId
}

type OriginalJDAccountDeleteRes struct{}

type OriginalJDAccountListReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/getList" tags:"京东充值卡账户" method:"get" summary:"获取京东充值卡列表"`
	commonApi.CommonPageReq
	Name     string `json:"name" description:"账户名称"`
	NickName string `json:"nickName" description:"用户昵称"`
	Cookie   string `json:"cookie"`
}

type OriginalJDAccountListRecord struct {
	entity.V1CardRedeemAccountInfo
	UploadUser struct {
		Id       string `json:"id"`
		Username string `json:"username"`
		Nickname string `json:"nickname"`
	} `json:"uploadUser"`
}

type OriginalJDAccountListRes struct {
	commonApi.CommonPageRes[OriginalJDAccountListRecord]
}

type OriginalJDAccountRecord struct {
	Cookie         string `json:"cookie" v:"required#状态不能为空" description:"cookie不能为空"`
	Name           string `json:"name" description:"别名"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值限制"`
	MaxCountLimit  int    `json:"maxCountLimit" description:"最大充值次数"`
	Remark         string `json:"remark" description:"备注"`
	Status         int    `json:"status" description:"状态"`
}

type OriginalJDAccountCreateReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/create" tags:"京东充值卡账户" method:"post" summary:"创建京东账户"`
	OriginalJDAccountRecord
}

type OriginalJDAccountCreateRes struct{}

type OriginalJDAccountCookieCheckReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/checkCookie" tags:"京东充值卡账户" method:"post" summary:"检测cookie是否可用"`
	Cookie string `json:"cookie" v:"required#cookie不能为空" description:"cookie"`
}

type OriginalJDAccountCookieCheckRes struct {
	Username    string  `json:"username" dc:"用户名"`
	Nickname    string  `json:"nickname" dc:"昵称"`
	Balance     float64 `json:"balance" dc:"余额"`
	IsExist     bool    `json:"isExist" dc:"是否存在系统中"`
	IsAvailable bool    `json:"isAvailable" dc:"是否可用"`
}

type OriginalJDAccountUpdateReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/update" tags:"京东充值卡账户" method:"put" summary:"修改京东账户"`
	commonApi.CommonStrId
	Status         int    `json:"status" description:"状态"`
	Name           string `json:"name" description:"别名"`
	Remark         string `json:"remark" description:"备注"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值限制"`
}

type OriginalJDAccountUpdateRes struct {
}

type OriginalJDAccountWalletListReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/getWalletList" tags:"京东充值卡账户" method:"get" summary:"获取京东账户流水"`
	commonApi.CommonPageReq
	AccountId string `json:"accountId" v:"required#缺失ID"`
}

type OriginalJDAccountWalletListRes struct {
	commonApi.CommonPageRes[*entity.V1CardRedeemAccountHistory]
}

type OriginalJDAccountUpdateStatusReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/updateStatus" tags:"京东充值卡账户" method:"put" summary:"修改京东账户状态"`
	commonApi.CommonStrId
	Status consts.RedeemAccountStatus `json:"status" v:"required#状态不能为空" description:"状态"`
}

type OriginalJDAccountUpdateStatusRes struct {
}

type OriginalJDAccountRefreshStatusReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/refreshStatus" tags:"京东充值卡账户" method:"put" summary:"刷新账号充值状态"`
	commonApi.CommonStrId
}

type OriginalJDAccountRefreshStatusRes struct {
}

type OriginalDownloadTemplateReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/downloadTemplate" tags:"京东充值卡账户" method:"get" summary:"下载导入模板"`
}

type OriginalDownloadTemplateRes struct {
	g.Meta `mime:"application/vnd.ms-excel"`
}

type OriginalJDAccountCookieBatchCheckReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/check" tags:"京东充值卡账户" method:"post" summary:"检查上传礼品卡是否正常"`
	File   *ghttp.UploadFile `v:"required#文件不能为空" json:"file" type:"file" description:"选择上传文件"`
}

type OriginalJDAccountCookieBatchInfo struct {
	OriginalJDAccountCookieCheckRes
	Name           string `json:"name" dc:"别名"`
	Cookie         string `json:"cookie" dc:"cookie"`
	MaxAmountLimit int    `json:"maxAmountLimit" description:"最大充值限制"`
	MaxCountLimit  int    `json:"maxCountLimit" description:"最大充值次数"`
}

type OriginalJDAccountCookieBatchCheckRes struct {
	Msg  string                              `json:"msg" description:"导入结果"`
	List []*OriginalJDAccountCookieBatchInfo `json:"list" description:"导入结果"`
}
type OriginalJDAccountCookieBatchAddReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/batchAdd" tags:"京东充值卡账户" method:"post" summary:"检查礼品卡是否正常"`
	List   []*OriginalJDAccountCookieBatchInfo `json:"list" description:"导入结果"`
}

type OriginalJDAccountCookieBatchAddRes struct {
}

type OriginalDownloadReq struct {
	g.Meta `path:"/cardInfo/originalJDCard/account/download" tags:"京东充值卡账户" method:"get" summary:"下载充值账户"`
}

type OriginalDownloadRes struct {
	g.Meta `mime:"application/vnd.ms-excel"`
}
