package v1

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

// GetSettingsReq 获取骆驼模块设置
type GetSettingsReq struct {
	g.Meta `path:"/jd-v2/settings/get" tags:"JD V2 Settings" method:"get" summary:"获取骆驼模块设置"`
}

type GetSettingsRes struct {
	g.Meta `mime:"application/json"`
	CamelOilSettings
}

// UpdateSettingsReq 更新骆驼模块设置
type UpdateSettingsReq struct {
	g.Meta `path:"/jd-v2/settings/update" tags:"JD V2 Settings" method:"post" summary:"更新骆驼模块设置"`
	CamelOilSettings
}

type UpdateSettingsRes struct {
	g.Meta `mime:"application/json"`
}

// DenominationSetting 单个面额设置
type DenominationSetting struct {
	Denomination int `json:"denomination" description:"面额值，如100、200、500等"`
	Capacity     int `json:"capacity" description:"该面额预拉取订单库存值（统一的库存阈值）"`
}

// CamelOilSettings 骆驼模块设置
type CamelOilSettings struct {
	// 豪猪平台相关设置
	UseHaozhuPlatform bool   `json:"useHaozhuPlatform" description:"是否从豪猪平台获取手机号登录"`
	HaozhuUsername    string `json:"haozhuUsername" description:"豪猪平台用户名"`
	HaozhuPassword    string `json:"haozhuPassword" description:"豪猪平台密码"`

	// 账号登录数量设置
	LoginAccountCount int `json:"loginAccountCount" description:"要登录的手机号数量"`

	// 提前拉单并发设置
	PrefetchConcurrencyAccounts int `json:"prefetchConcurrencyAccounts" description:"提前拉单并发的账号数量"`

	// 单账号并发设置
	SingleAccountConcurrency int `json:"singleAccountConcurrency" description:"单个账号的并发数量"`

	// 面额相关设置
	TargetDenominations []DenominationSetting `json:"targetDenominations" description:"要获取的面额和对应库存设置列表"`
}
