// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2

package types

import "encoding/json"

type ActivateOrderRequest struct {
	OrderNo string `json:"order_no" validate:"required"`
}

type RefundOrderRequest struct {
	Id     int64  `json:"id" validate:"required"`
	Reason string `json:"reason,omitempty" validate:"omitempty,max=500"`
}

type Ads struct {
	Id          int    `json:"id"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	Content     string `json:"content"`
	Description string `json:"description"`
	TargetURL   string `json:"target_url"`
	StartTime   int64  `json:"start_time"`
	EndTime     int64  `json:"end_time"`
	Status      int    `json:"status"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
}

type AlipayNotifyResponse struct {
	ReturnCode string `json:"return_code"`
}

type Announcement struct {
	Id        int64  `json:"id"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	Show      *bool  `json:"show"`
	Pinned    *bool  `json:"pinned"`
	Popup     *bool  `json:"popup"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type AnyTLS struct {
	Port           int            `json:"port" validate:"required"`
	SecurityConfig SecurityConfig `json:"security_config"`
}

type AppUserSubcbribe struct {
	Id          int64                   `json:"id"`
	Name        string                  `json:"name"`
	Upload      int64                   `json:"upload"`
	Traffic     int64                   `json:"traffic"`
	Download    int64                   `json:"download"`
	DeviceLimit int64                   `json:"device_limit"`
	StartTime   string                  `json:"start_time"`
	ExpireTime  string                  `json:"expire_time"`
	List        []AppUserSubscbribeNode `json:"list"`
}

type AppUserSubscbribeNode struct {
	Id           int64    `json:"id"`
	Name         string   `json:"name"`
	Uuid         string   `json:"uuid"`
	Protocol     string   `json:"protocol"`
	RelayMode    string   `json:"relay_mode"`
	RelayNode    string   `json:"relay_node"`
	ServerAddr   string   `json:"server_addr"`
	SpeedLimit   int      `json:"speed_limit"`
	Tags         []string `json:"tags"`
	Traffic      int64    `json:"traffic"`
	TrafficRatio float64  `json:"traffic_ratio"`
	Upload       int64    `json:"upload"`
	Config       string   `json:"config"`
	Country      string   `json:"country"`
	City         string   `json:"city"`
	Latitude     string   `json:"latitude"`
	Longitude    string   `json:"longitude"`
	CreatedAt    int64    `json:"created_at"`
	Download     int64    `json:"download"`
}

type AppleLoginCallbackRequest struct {
	Code    string `form:"code"`
	IDToken string `form:"id_token"`
	State   string `form:"state"`
}

type Application struct {
	Id            int64  `json:"id"`
	Icon          string `json:"icon"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	SubscribeType string `json:"subscribe_type"`
}

type ApplicationPlatform struct {
	IOS     []*ApplicationVersion `json:"ios,omitempty"`
	MacOS   []*ApplicationVersion `json:"macos,omitempty"`
	Linux   []*ApplicationVersion `json:"linux,omitempty"`
	Android []*ApplicationVersion `json:"android,omitempty"`
	Windows []*ApplicationVersion `json:"windows,omitempty"`
	Harmony []*ApplicationVersion `json:"harmony,omitempty"`
}

type ApplicationResponse struct {
	Applications []ApplicationResponseInfo `json:"applications"`
}

type ApplicationResponseInfo struct {
	Id            int64               `json:"id"`
	Name          string              `json:"name"`
	Icon          string              `json:"icon"`
	Description   string              `json:"description"`
	SubscribeType string              `json:"subscribe_type"`
	Platform      ApplicationPlatform `json:"platform"`
}

type ApplicationVersion struct {
	Id          int64  `json:"id"`
	Url         string `json:"url"`
	Version     string `json:"version" validate:"required"`
	Description string `json:"description"`
	IsDefault   bool   `json:"is_default"`
}

type AttachAppleTransactionByIdRequest struct {
	OrderNo       string `json:"order_no" validate:"required"`
	TransactionId string `json:"transaction_id" validate:"required"`
	Sandbox       *bool  `json:"sandbox,omitempty"`
}

type AttachAppleTransactionRequest struct {
	OrderNo              string `json:"order_no" validate:"required"`
	SignedTransactionJWS string `json:"signed_transaction_jws" validate:"required"`
	SubscribeId          int64  `json:"subscribe_id,omitempty"`
	DurationDays         int64  `json:"duration_days,omitempty"`
	Tier                 string `json:"tier,omitempty"`
}

type AttachAppleTransactionResponse struct {
	ExpiresAt       int64  `json:"expires_at"`
	Tier            string `json:"tier"`
	ExistingOrderNo string `json:"existing_order_no,omitempty"`
}

type AuthConfig struct {
	Mobile   MobileAuthenticateConfig `json:"mobile"`
	Email    EmailAuthticateConfig    `json:"email"`
	Device   DeviceAuthticateConfig   `json:"device"`
	Register PubilcRegisterConfig     `json:"register"`
}

type AuthMethodConfig struct {
	Id      int64       `json:"id"`
	Method  string      `json:"method"`
	Config  interface{} `json:"config"`
	Enabled bool        `json:"enabled"`
}

type BalanceLog struct {
	Type      uint16 `json:"type"`
	UserId    int64  `json:"user_id"`
	Amount    int64  `json:"amount"`
	OrderNo   string `json:"order_no,omitempty"`
	Balance   int64  `json:"balance"`
	Timestamp int64  `json:"timestamp"`
}

type BatchDeleteCouponRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchDeleteDocumentRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchDeleteRedemptionCodeRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchDeleteSubscribeGroupRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchDeleteSubscribeRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchDeleteUserRequest struct {
	Ids []int64 `json:"ids" validate:"required"`
}

type BatchSendEmailTask struct {
	Id                int64  `json:"id"`
	Subject           string `json:"subject"`
	Content           string `json:"content"`
	Recipients        string `json:"recipients"`
	Scope             int8   `json:"scope"`
	RegisterStartTime int64  `json:"register_start_time"`
	RegisterEndTime   int64  `json:"register_end_time"`
	Additional        string `json:"additional"`
	Scheduled         int64  `json:"scheduled"`
	Interval          uint8  `json:"interval"`
	Limit             uint64 `json:"limit"`
	Status            uint8  `json:"status"`
	Errors            string `json:"errors"`
	Total             uint64 `json:"total"`
	Current           uint64 `json:"current"`
	CreatedAt         int64  `json:"created_at"`
	UpdatedAt         int64  `json:"updated_at"`
}

type BindEmailWithVerificationRequest struct {
	Email string `json:"email" form:"email" validate:"required,email"`
	Code  string `json:"code" form:"code" validate:"required"`
}

type BindEmailWithVerificationResponse struct {
	Success      bool   `json:"success"`
	Message      string `json:"message"`
	Token        string `json:"token,omitempty"`
	UserId       int64  `json:"user_id"`
	FamilyJoined bool   `json:"family_joined,omitempty"`
	FamilyId     int64  `json:"family_id,omitempty"`
	OwnerUserId  int64  `json:"owner_user_id,omitempty"`
}

type BindInviteCodeRequest struct {
	InviteCode string `json:"invite_code" form:"invite_code" validate:"required"`
}

type BindOAuthCallbackRequest struct {
	Method   string      `json:"method"`
	Callback interface{} `json:"callback"`
}

type BindOAuthRequest struct {
	Method   string `json:"method"`
	Redirect string `json:"redirect"`
}

type BindOAuthResponse struct {
	Redirect string `json:"redirect"`
}

type BindTelegramResponse struct {
	Url       string `json:"url"`
	ExpiredAt int64  `json:"expired_at"`
}

type CheckUserRequest struct {
	Email string `form:"email" validate:"required"`
}

type CheckUserResponse struct {
	Exist bool `json:"exist"`
}

type CheckVerificationCodeRequest struct {
	Method  string `json:"method" validate:"required,oneof=email mobile"`
	Account string `json:"account" validate:"required"`
	Code    string `json:"code" validate:"required"`
	Type    uint8  `json:"type" validate:"required"`
}

type CheckVerificationCodeRespone struct {
	Status bool `json:"status"`
	Exist  bool `json:"exist"`
}

type CheckoutOrderRequest struct {
	OrderNo   string `json:"orderNo"`
	ReturnUrl string `json:"returnUrl,omitempty"`
}

type CheckoutOrderResponse struct {
	Type        string         `json:"type"`
	CheckoutUrl string         `json:"checkout_url,omitempty"`
	Stripe      *StripePayment `json:"stripe,omitempty"`
	ProductIds  []string       `json:"product_ids,omitempty"`
}

type CloseOrderRequest struct {
	OrderNo string `json:"orderNo" validate:"required"`
}

type CommissionLog struct {
	Type      uint16 `json:"type"`
	UserId    int64  `json:"user_id"`
	Amount    int64  `json:"amount"`
	OrderNo   string `json:"order_no"`
	Timestamp int64  `json:"timestamp"`
}

type CommissionWithdrawRequest struct {
	Amount  int64  `json:"amount"`
	Content string `json:"content"`
}

type ConnectionRecords struct {
	CurrentContinuousDays   int64 `json:"current_continuous_days"`
	HistoryContinuousDays   int64 `json:"history_continuous_days"`
	LongestSingleConnection int64 `json:"longest_single_connection"`
}

type ContactRequest struct {
	Name         string `json:"name" validate:"required,max=100"`
	Email        string `json:"email" validate:"required,email"`
	OtherContact string `json:"other_contact" validate:"max=200"`
	Notes        string `json:"notes" validate:"max=2000"`
}

type Coupon struct {
	Id         int64   `json:"id"`
	Name       string  `json:"name"`
	Code       string  `json:"code"`
	Count      int64   `json:"count"`
	Type       uint8   `json:"type"`
	Discount   int64   `json:"discount"`
	StartTime  int64   `json:"start_time"`
	ExpireTime int64   `json:"expire_time"`
	UserLimit  int64   `json:"user_limit"`
	Subscribe  []int64 `json:"subscribe"`
	UsedCount  int64   `json:"used_count"`
	Enable     bool    `json:"enable"`
	CreatedAt  int64   `json:"created_at"`
	UpdatedAt  int64   `json:"updated_at"`
}

type CreateAdsRequest struct {
	Title       string `json:"title"`
	Type        string `json:"type"`
	Content     string `json:"content"`
	Description string `json:"description"`
	TargetURL   string `json:"target_url"`
	StartTime   int64  `json:"start_time"`
	EndTime     int64  `json:"end_time"`
	Status      int    `json:"status"`
}

type CreateAnnouncementRequest struct {
	Title   string `json:"title" validate:"required"`
	Content string `json:"content" validate:"required"`
}

type CreateBatchSendEmailTaskRequest struct {
	Subject           string `json:"subject"`
	Content           string `json:"content"`
	Scope             int8   `json:"scope"`
	RegisterStartTime int64  `json:"register_start_time,omitempty"`
	RegisterEndTime   int64  `json:"register_end_time,omitempty"`
	Additional        string `json:"additional,omitempty"`
	Scheduled         int64  `json:"scheduled,omitempty"`
	Interval          uint8  `json:"interval,omitempty"`
	Limit             uint64 `json:"limit,omitempty"`
}

type CreateCouponRequest struct {
	Name       string  `json:"name" validate:"required"`
	Code       string  `json:"code,omitempty"`
	Count      int64   `json:"count,omitempty"`
	Type       uint8   `json:"type" validate:"required"`
	Discount   int64   `json:"discount" validate:"required"`
	StartTime  int64   `json:"start_time" validate:"required"`
	ExpireTime int64   `json:"expire_time" validate:"required"`
	UserLimit  int64   `json:"user_limit,omitempty"`
	Subscribe  []int64 `json:"subscribe,omitempty"`
	UsedCount  int64   `json:"used_count,omitempty"`
	Enable     *bool   `json:"enable,omitempty"`
}

type CreateDocumentRequest struct {
	Title   string   `json:"title" validate:"required"`
	Content string   `json:"content" validate:"required"`
	Tags    []string `json:"tags,omitempty" `
	Show    *bool    `json:"show"`
}

type CreateNodeGroupRequest struct {
	Name                string `json:"name" validate:"required"`
	Description         string `json:"description"`
	Sort                int    `json:"sort"`
	ForCalculation      *bool  `json:"for_calculation"`
	IsExpiredGroup      *bool  `json:"is_expired_group"`
	ExpiredDaysLimit    *int   `json:"expired_days_limit"`
	MaxTrafficGBExpired *int64 `json:"max_traffic_gb_expired,omitempty"`
	SpeedLimit          *int   `json:"speed_limit"`
	MinTrafficGB        *int64 `json:"min_traffic_gb,omitempty"`
	MaxTrafficGB        *int64 `json:"max_traffic_gb,omitempty"`
}

type CreateNodeRequest struct {
	Name         string   `json:"name"`
	Tags         []string `json:"tags,omitempty"`
	Port         uint16   `json:"port"`
	Address      string   `json:"address"`
	ServerId     int64    `json:"server_id"`
	Protocol     string   `json:"protocol"`
	Enabled      *bool    `json:"enabled"`
	NodeGroupIds []int64  `json:"node_group_ids,omitempty"`
}

type CreateOrderRequest struct {
	UserId         int64  `json:"user_id" validate:"required"`
	Type           uint8  `json:"type" validate:"required"`
	Quantity       int64  `json:"quantity,omitempty" validate:"omitempty,lte=1000"`
	Price          int64  `json:"price" validate:"required,gte=0,lte=2000000000"`
	Amount         int64  `json:"amount" validate:"required,gte=0,lte=2147483647"`
	Discount       int64  `json:"discount,omitempty" validate:"omitempty,gte=0,lte=2000000000"`
	Coupon         string `json:"coupon,omitempty"`
	CouponDiscount int64  `json:"coupon_discount,omitempty" validate:"omitempty,gte=0,lte=2000000000"`
	Commission     int64  `json:"commission" validate:"gte=0,lte=2000000000"`
	FeeAmount      int64  `json:"fee_amount" validate:"required,gte=0,lte=2000000000"`
	PaymentId      int64  `json:"payment_id" validate:"required"`
	TradeNo        string `json:"trade_no,omitempty"`
	Status         uint8  `json:"status,omitempty"`
	SubscribeId    int64  `json:"subscribe_id,omitempty"`
}

type CreatePaymentMethodRequest struct {
	Name        string      `json:"name" validate:"required"`
	Platform    string      `json:"platform" validate:"required"`
	Description string      `json:"description"`
	Icon        string      `json:"icon,omitempty"`
	Domain      string      `json:"domain,omitempty"`
	Config      interface{} `json:"config" validate:"required"`
	FeeMode     uint        `json:"fee_mode"`
	FeePercent  int64       `json:"fee_percent,omitempty"`
	FeeAmount   int64       `json:"fee_amount,omitempty"`
	Enable      *bool       `json:"enable" validate:"required"`
}

type CreateQuotaTaskRequest struct {
	Subscribers  []int64 `json:"subscribers"`
	IsActive     *bool   `json:"is_active"`
	StartTime    int64   `json:"start_time"`
	EndTime      int64   `json:"end_time"`
	ResetTraffic bool    `json:"reset_traffic"`
	Days         uint64  `json:"days"`
	GiftType     uint8   `json:"gift_type"`
	GiftValue    uint64  `json:"gift_value"`
}

type CreateRedemptionCodeRequest struct {
	TotalCount    int64  `json:"total_count" validate:"required"`
	SubscribePlan int64  `json:"subscribe_plan" validate:"required"`
	UnitTime      string `json:"unit_time" validate:"required,oneof=day month quarter half_year year"`
	Quantity      int64  `json:"quantity" validate:"required"`
	BatchCount    int64  `json:"batch_count" validate:"required,min=1"`
}

type CreateServerRequest struct {
	Name      string     `json:"name"`
	Country   string     `json:"country,omitempty"`
	City      string     `json:"city,omitempty"`
	Address   string     `json:"address"`
	Sort      int        `json:"sort,omitempty"`
	Protocols []Protocol `json:"protocols"`
}

type CreateSubscribeApplicationRequest struct {
	Name              string       `json:"name"`
	Description       string       `json:"description,omitempty"`
	Icon              string       `json:"icon,omitempty"`
	Scheme            string       `json:"scheme,omitempty"`
	UserAgent         string       `json:"user_agent"`
	IsDefault         bool         `json:"is_default"`
	SubscribeTemplate string       `json:"template"`
	OutputFormat      string       `json:"output_format"`
	DownloadLink      DownloadLink `json:"download_link"`
}

type CreateSubscribeGroupRequest struct {
	Name        string `json:"name" validate:"required"`
	Description string `json:"description"`
}

type CreateSubscribeRequest struct {
	Name              string              `json:"name" validate:"required"`
	Language          string              `json:"language"`
	Description       string              `json:"description"`
	UnitPrice         int64               `json:"unit_price"`
	UnitTime          string              `json:"unit_time"`
	Discount          []SubscribeDiscount `json:"discount"`
	Replacement       int64               `json:"replacement"`
	Inventory         int64               `json:"inventory"`
	Traffic           int64               `json:"traffic"`
	SpeedLimit        int64               `json:"speed_limit"`
	DeviceLimit       int64               `json:"device_limit"`
	Quota             int64               `json:"quota"`
	NewUserOnly       *bool               `json:"new_user_only"`
	Nodes             []int64             `json:"nodes"`
	NodeTags          []string            `json:"node_tags"`
	NodeGroupIds      []int64             `json:"node_group_ids,omitempty"`
	NodeGroupId       int64               `json:"node_group_id"`
	TrafficLimit      []TrafficLimit      `json:"traffic_limit"`
	Show              *bool               `json:"show"`
	Sell              *bool               `json:"sell"`
	DeductionRatio    int64               `json:"deduction_ratio"`
	AllowDeduction    *bool               `json:"allow_deduction"`
	ResetCycle        int64               `json:"reset_cycle"`
	RenewalReset      *bool               `json:"renewal_reset"`
	ShowOriginalPrice bool                `json:"show_original_price"`
	AutoCreateGroup   bool                `json:"auto_create_group"`
}

type CreateTicketFollowRequest struct {
	TicketId int64  `json:"ticket_id" validate:"required"`
	From     string `json:"from" validate:"required"`
	Type     uint8  `json:"type" validate:"required"`
	Content  string `json:"content" validate:"required"`
}

type CreateUserAuthMethodRequest struct {
	UserId         int64  `json:"user_id"`
	AuthType       string `json:"auth_type"`
	AuthIdentifier string `json:"auth_identifier"`
}

type CreateUserRequest struct {
	Email              string `json:"email"`
	Telephone          string `json:"telephone"`
	TelephoneAreaCode  string `json:"telephone_area_code"`
	Password           string `json:"password"`
	ProductId          int64  `json:"product_id"`
	Duration           int64  `json:"duration"`
	ReferralPercentage uint8  `json:"referral_percentage"`
	OnlyFirstPurchase  bool   `json:"only_first_purchase"`
	RefererUser        string `json:"referer_user"`
	ReferCode          string `json:"refer_code"`
	Balance            int64  `json:"balance"`
	Commission         int64  `json:"commission"`
	GiftAmount         int64  `json:"gift_amount"`
	IsAdmin            bool   `json:"is_admin"`
}

type CreateUserSubscribeRequest struct {
	UserId      int64 `json:"user_id"`
	ExpiredAt   int64 `json:"expired_at"`
	Traffic     int64 `json:"traffic"`
	SubscribeId int64 `json:"subscribe_id"`
}

type CreateUserTicketFollowRequest struct {
	TicketId int64  `json:"ticket_id"`
	From     string `json:"from"`
	Type     uint8  `json:"type"`
	Content  string `json:"content"`
}

type CreateUserTicketRequest struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

type Currency struct {
	CurrencyUnit   string `json:"currency_unit"`
	CurrencySymbol string `json:"currency_symbol"`
}

type CurrencyConfig struct {
	AccessKey      string `json:"access_key"`
	CurrencyUnit   string `json:"currency_unit"`
	CurrencySymbol string `json:"currency_symbol"`
}

type DailyTrafficStats struct {
	Date     string `json:"date"`
	Upload   int64  `json:"upload"`
	Download int64  `json:"download"`
	Total    int64  `json:"total"`
}

type DeleteAccountRequest struct {
	Email string `json:"email" validate:"required,email"`
	Code  string `json:"code" validate:"required"`
}

type DeleteAccountResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	UserId  int64  `json:"user_id"`
	Code    int64  `json:"code"`
}

type DeleteAdsRequest struct {
	Id int64 `json:"id"`
}

type DeleteAnnouncementRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteCouponRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteDocumentRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteNodeGroupRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteNodeRequest struct {
	Id int64 `json:"id"`
}

type DeletePaymentMethodRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteRedemptionCodeRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteServerRequest struct {
	Id int64 `json:"id"`
}

type DeleteSubscribeApplicationRequest struct {
	Id int64 `json:"id"`
}

type DeleteSubscribeGroupRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteSubscribeRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type DeleteUserAuthMethodRequest struct {
	UserId   int64  `json:"user_id"`
	AuthType string `json:"auth_type"`
}

type DeleteUserDeivceRequest struct {
	Id int64 `json:"id"`
}

type DeleteUserSubscribeRequest struct {
	UserSubscribeId int64 `json:"user_subscribe_id" validate:"required,gt=0"`
}

type DeviceAuthticateConfig struct {
	Enable         bool `json:"enable"`
	ShowAds        bool `json:"show_ads"`
	EnableSecurity bool `json:"enable_security"`
	OnlyRealDevice bool `json:"only_real_device"`
}

type DeviceLoginRequest struct {
	Identifier  string `json:"identifier" validate:"required"`
	IP          string `header:"X-Original-Forwarded-For"`
	UserAgent   string `json:"user_agent" validate:"required"`
	CfToken     string `json:"cf_token,optional"`
	ShortCode   string `json:"short_code,optional"`
	BasePayload string `json:"base_payload,optional"`
}

type DissolveFamilyRequest struct {
	FamilyId int64  `json:"family_id" validate:"required,gt=0"`
	Reason   string `json:"reason,omitempty"`
}

type Document struct {
	Id        int64    `json:"id"`
	Title     string   `json:"title"`
	Content   string   `json:"content"`
	Tags      []string `json:"tags"`
	Show      bool     `json:"show"`
	CreatedAt int64    `json:"created_at"`
	UpdatedAt int64    `json:"updated_at"`
}

type DownloadLink struct {
	IOS     string `json:"ios,omitempty"`
	Android string `json:"android,omitempty"`
	Windows string `json:"windows,omitempty"`
	Mac     string `json:"mac,omitempty"`
	Linux   string `json:"linux,omitempty"`
	Harmony string `json:"harmony,omitempty"`
}

type EPayNotifyRequest struct {
	Pid         int64  `json:"pid"          form:"pid"`
	TradeNo     string `json:"trade_no"     form:"trade_no"`
	OutTradeNo  string `json:"out_trade_no" form:"out_trade_no"`
	Type        string `json:"type"         form:"type"`
	Name        string `json:"name"         form:"name"`
	Money       string `json:"money"        form:"money"`
	TradeStatus string `json:"trade_status" form:"trade_status"`
	Param       string `json:"param"        form:"param"`
	Sign        string `json:"sign"         form:"sign"`
	SignType    string `json:"sign_type"    form:"sign_type"`
}

type EmailAuthticateConfig struct {
	Enable             bool   `json:"enable"`
	EnableVerify       bool   `json:"enable_verify"`
	EnableDomainSuffix bool   `json:"enable_domain_suffix"`
	DomainSuffixList   string `json:"domain_suffix_list"`
}

type EmailLoginRequest struct {
	Identifier string `json:"identifier" form:"identifier"`
	Email      string `json:"email" form:"email" validate:"required,email"`
	Code       string `json:"code" form:"code" validate:"required"`
	Invite     string `json:"invite,optional" form:"invite"`
	IP         string `header:"X-Original-Forwarded-For"`
	UserAgent  string `header:"User-Agent"`
	LoginType  string `header:"Login-Type"`
	CfToken    string `json:"cf_token,optional" form:"cf_token"`
}

type ErrorLogMessage struct {
	Id         int64  `json:"id"`
	Platform   string `json:"platform"`
	AppVersion string `json:"app_version"`
	OsName     string `json:"os_name"`
	OsVersion  string `json:"os_version"`
	DeviceId   string `json:"device_id"`
	UserId     int64  `json:"user_id"`
	SessionId  string `json:"session_id"`
	Level      uint8  `json:"level"`
	ErrorCode  string `json:"error_code"`
	Message    string `json:"message"`
	CreatedAt  int64  `json:"created_at"`
}

type ExportGroupResultRequest struct {
	HistoryId *int64 `form:"history_id,omitempty"`
}

type FamilyDetail struct {
	Summary FamilySummary      `json:"summary"`
	Members []FamilyMemberItem `json:"members"`
}

type FamilyMemberItem struct {
	UserId     int64  `json:"user_id"`
	Identifier string `json:"identifier"`
	AuthType   string `json:"auth_type"`
	DeviceNo   string `json:"device_no"`
	DeviceType string `json:"device_type"`
	Role       uint8  `json:"role"`
	RoleName   string `json:"role_name"`
	Status     uint8  `json:"status"`
	StatusName string `json:"status_name"`
	JoinSource string `json:"join_source"`
	JoinedAt   int64  `json:"joined_at"`
	LeftAt     int64  `json:"left_at,omitempty"`
}

type FamilySummary struct {
	FamilyId          int64  `json:"family_id"`
	OwnerUserId       int64  `json:"owner_user_id"`
	OwnerIdentifier   string `json:"owner_identifier"`
	OwnerAuthType     string `json:"owner_auth_type"`
	Status            string `json:"status"`
	ActiveMemberCount int64  `json:"active_member_count"`
	MaxMembers        int64  `json:"max_members"`
	CreatedAt         int64  `json:"created_at"`
	UpdatedAt         int64  `json:"updated_at"`
}

type FileUploadRequest struct {
	BizType string `form:"biz_type" validate:"required"`
}

type FileUploadResponse struct {
	FileId      string `json:"file_id"`
	FileName    string `json:"file_name"`
	ObjectKey   string `json:"object_key"`
	Size        int64  `json:"size"`
	ContentType string `json:"content_type"`
	Etag        string `json:"etag"`
	Status      string `json:"status"`
}

type FileUploadCompleteRequest struct {
	FileId string `json:"file_id" validate:"required"`
}

type FileUploadCompleteResponse struct {
	FileId      string `json:"file_id"`
	ObjectKey   string `json:"object_key"`
	Size        int64  `json:"size"`
	ContentType string `json:"content_type"`
	Etag        string `json:"etag"`
	Status      string `json:"status"`
}

type FileUploadInitRequest struct {
	BizType     string `json:"biz_type" validate:"required"`
	FileName    string `json:"file_name" validate:"required"`
	ContentType string `json:"content_type" validate:"required"`
	Size        int64  `json:"size" validate:"required"`
	Sha256      string `json:"sha256"`
}

type FileUploadInitResponse struct {
	FileId    string            `json:"file_id"`
	ObjectKey string            `json:"object_key"`
	UploadURL string            `json:"upload_url"`
	Method    string            `json:"method"`
	Headers   map[string]string `json:"headers"`
	ExpiredAt int64             `json:"expired_at"`
}

type FilterBalanceLogRequest struct {
	FilterLogParams
	UserId int64 `form:"user_id,optional"`
}

type FilterBalanceLogResponse struct {
	Total int64        `json:"total"`
	List  []BalanceLog `json:"list"`
}

type FilterCommissionLogRequest struct {
	FilterLogParams
	UserId int64 `form:"user_id,optional"`
}

type FilterCommissionLogResponse struct {
	Total int64           `json:"total"`
	List  []CommissionLog `json:"list"`
}

type FilterOrderRefundLogRequest struct {
	FilterLogParams
	OrderId int64 `form:"order_id,optional"`
	UserId  int64 `form:"user_id,optional"`
}

type FilterOrderRefundLogResponse struct {
	Total int64            `json:"total"`
	List  []OrderRefundLog `json:"list"`
}

type FilterEmailLogResponse struct {
	Total int64        `json:"total"`
	List  []MessageLog `json:"list"`
}

type FilterGiftLogRequest struct {
	FilterLogParams
	UserId int64 `form:"user_id,optional"`
}

type FilterGiftLogResponse struct {
	Total int64     `json:"total"`
	List  []GiftLog `json:"list"`
}

type FilterLogParams struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Date   string `form:"date,optional"`
	Search string `form:"search,optional"`
}

type FilterLoginLogRequest struct {
	FilterLogParams
	UserId int64 `form:"user_id,optional"`
}

type FilterLoginLogResponse struct {
	Total int64      `json:"total"`
	List  []LoginLog `json:"list"`
}

type FilterMobileLogResponse struct {
	Total int64        `json:"total"`
	List  []MessageLog `json:"list"`
}

type FilterNodeListRequest struct {
	Page        int    `form:"page"`
	Size        int    `form:"size"`
	Search      string `form:"search,omitempty"`
	NodeGroupId *int64 `form:"node_group_id,omitempty"`
}

type FilterNodeListResponse struct {
	Total int64  `json:"total"`
	List  []Node `json:"list"`
}

type FilterRegisterLogRequest struct {
	FilterLogParams
	UserId int64 `form:"user_id,optional"`
}

type FilterRegisterLogResponse struct {
	Total int64         `json:"total"`
	List  []RegisterLog `json:"list"`
}

type FilterResetSubscribeLogRequest struct {
	FilterLogParams
	UserSubscribeId int64 `form:"user_subscribe_id,optional"`
}

type FilterResetSubscribeLogResponse struct {
	Total int64               `json:"total"`
	List  []ResetSubscribeLog `json:"list"`
}

type FilterServerListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Search string `form:"search,omitempty"`
}

type FilterServerListResponse struct {
	Total int64    `json:"total"`
	List  []Server `json:"list"`
}

type FilterServerTrafficLogRequest struct {
	FilterLogParams
	ServerId int64 `form:"server_id,optional"`
}

type FilterServerTrafficLogResponse struct {
	Total int64              `json:"total"`
	List  []ServerTrafficLog `json:"list"`
}

type FilterSubscribeLogRequest struct {
	FilterLogParams
	UserId          int64 `form:"user_id,optional"`
	UserSubscribeId int64 `form:"user_subscribe_id,optional"`
}

type FilterSubscribeLogResponse struct {
	Total int64          `json:"total"`
	List  []SubscribeLog `json:"list"`
}

type FilterSubscribeTrafficRequest struct {
	FilterLogParams
	UserId          int64 `form:"user_id,optional"`
	UserSubscribeId int64 `form:"user_subscribe_id,optional"`
}

type FilterSubscribeTrafficResponse struct {
	Total int64                     `json:"total"`
	List  []UserSubscribeTrafficLog `json:"list"`
}

type FilterTrafficLogDetailsRequest struct {
	FilterLogParams
	ServerId    int64 `form:"server_id,optional"`
	SubscribeId int64 `form:"subscribe_id,optional"`
	UserId      int64 `form:"user_id,optional"`
}

type FilterTrafficLogDetailsResponse struct {
	Total int64               `json:"total"`
	List  []TrafficLogDetails `json:"list"`
}

type Follow struct {
	Id        int64  `json:"id"`
	TicketId  int64  `json:"ticket_id"`
	From      string `json:"from"`
	Type      uint8  `json:"type"`
	Content   string `json:"content"`
	CreatedAt int64  `json:"created_at"`
}

type GenerateCaptchaResponse struct {
	Id         string `json:"id"`
	Image      string `json:"image"`
	Type       string `json:"type"`
	BlockImage string `json:"block_image,omitempty"`
}

type GetAdsDetailRequest struct {
	Id int64 `form:"id"`
}

type GetAdsListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Status *int   `form:"status,omitempty"`
	Search string `form:"search,omitempty"`
}

type GetAdsListResponse struct {
	Total int64 `json:"total"`
	List  []Ads `json:"list"`
}

type GetAdsRequest struct {
	Device   string `form:"device"`
	Position string `form:"position"`
}

type GetAdsResponse struct {
	List []Ads `json:"list"`
}

type GetAgentDownloadsRequest struct {
}

type GetAgentDownloadsResponse struct {
	Total          int64             `json:"total"`
	Platforms      PlatformDownloads `json:"platforms"`
	ComparisonRate string            `json:"comparison_rate,omitempty"`
}

type GetAgentRealtimeRequest struct {
}

type GetAgentRealtimeResponse struct {
	Total          int64  `json:"total"`
	Clicks         int64  `json:"clicks"`
	Views          int64  `json:"views"`
	Installs       int64  `json:"installs"`
	PaidCount      int64  `json:"paid_count"`
	GrowthRate     string `json:"growth_rate"`
	PaidGrowthRate string `json:"paid_growth_rate"`
}

type GetAnnouncementListRequest struct {
	Page   int64  `form:"page"`
	Size   int64  `form:"size"`
	Show   *bool  `form:"show,omitempty"`
	Pinned *bool  `form:"pinned,omitempty"`
	Popup  *bool  `form:"popup,omitempty"`
	Search string `form:"search,omitempty"`
}

type GetAnnouncementListResponse struct {
	Total int64          `json:"total"`
	List  []Announcement `json:"list"`
}

type GetAnnouncementRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetAppleStatusResponse struct {
	Active    bool   `json:"active"`
	ExpiresAt int64  `json:"expires_at"`
	Tier      string `json:"tier"`
}

type GetAuthMethodConfigRequest struct {
	Method string `form:"method"`
}

type GetAuthMethodListResponse struct {
	List []AuthMethodConfig `json:"list"`
}

type GetAvailablePaymentMethodsResponse struct {
	List []PaymentMethod `json:"list"`
}

type GetBatchSendEmailTaskListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Scope  *int8  `form:"scope,omitempty"`
	Status *uint8 `form:"status,omitempty"`
}

type GetBatchSendEmailTaskListResponse struct {
	Total int64                `json:"total"`
	List  []BatchSendEmailTask `json:"list"`
}

type GetBatchSendEmailTaskStatusRequest struct {
	Id int64 `json:"id"`
}

type GetBatchSendEmailTaskStatusResponse struct {
	Status  uint8  `json:"status"`
	Current int64  `json:"current"`
	Total   int64  `json:"total"`
	Errors  string `json:"errors"`
}

type GetCouponListRequest struct {
	Page      int64  `form:"page" validate:"required"`
	Size      int64  `form:"size" validate:"required"`
	Subscribe int64  `form:"subscribe,omitempty"`
	Search    string `form:"search,omitempty"`
}

type GetCouponListResponse struct {
	Total int64    `json:"total"`
	List  []Coupon `json:"list"`
}

type GetDetailRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetDeviceListResponse struct {
	List  []UserDevice `json:"list"`
	Total int64        `json:"total"`
}

type GetDeviceOnlineStatsResponse struct {
	WeeklyStats       []WeeklyStat      `json:"weekly_stats"`
	ConnectionRecords ConnectionRecords `json:"connection_records"`
}

type GetDocumentDetailRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type GetDocumentListRequest struct {
	Page   int64  `form:"page" validate:"required"`
	Size   int64  `form:"size" validate:"required"`
	Tag    string `form:"tag,omitempty"`
	Search string `form:"search,omitempty"`
}

type GetDocumentListResponse struct {
	Total int64      `json:"total"`
	List  []Document `json:"list"`
}

type GetDownloadLinkRequest struct {
	InviteCode string `form:"invite_code,optional"`
	Platform   string `form:"platform" validate:"required,oneof=windows mac ios android"`
}

type GetDownloadLinkResponse struct {
	Url string `json:"url"`
}

type GetErrorLogMessageDetailResponse struct {
	Id         int64  `json:"id"`
	Platform   string `json:"platform"`
	AppVersion string `json:"app_version"`
	OsName     string `json:"os_name"`
	OsVersion  string `json:"os_version"`
	DeviceId   string `json:"device_id"`
	UserId     int64  `json:"user_id"`
	SessionId  string `json:"session_id"`
	Level      uint8  `json:"level"`
	ErrorCode  string `json:"error_code"`
	Message    string `json:"message"`
	Stack      string `json:"stack"`
	ClientIP   string `json:"client_ip"`
	UserAgent  string `json:"user_agent"`
	Locale     string `json:"locale"`
	OccurredAt int64  `json:"occurred_at"`
	CreatedAt  int64  `json:"created_at"`
}

type GetErrorLogMessageListRequest struct {
	Page      int    `form:"page"`
	Size      int    `form:"size"`
	Platform  string `form:"platform,optional"`
	Level     uint8  `form:"level,optional"`
	UserId    int64  `form:"user_id,optional"`
	DeviceId  string `form:"device_id,optional"`
	ErrorCode string `form:"error_code,optional"`
	Keyword   string `form:"keyword,optional"`
	Start     int64  `form:"start,optional"`
	End       int64  `form:"end,optional"`
}

type GetErrorLogMessageListResponse struct {
	Total int64             `json:"total"`
	List  []ErrorLogMessage `json:"list"`
}

type GetFamilyDetailRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetFamilyListRequest struct {
	Page        int    `form:"page"`
	Size        int    `form:"size"`
	Keyword     string `form:"keyword,omitempty"`
	Status      string `form:"status,omitempty"`
	OwnerUserId *int64 `form:"owner_user_id,omitempty"`
	FamilyId    *int64 `form:"family_id,omitempty"`
	UserId      *int64 `form:"user_id,omitempty"`
}

type GetFamilyListResponse struct {
	List  []FamilySummary `json:"list"`
	Total int64           `json:"total"`
}

type GetGlobalConfigResponse struct {
	Site         SiteConfig             `json:"site"`
	Verify       VeifyConfig            `json:"verify"`
	Auth         AuthConfig             `json:"auth"`
	Invite       InviteConfig           `json:"invite"`
	Currency     Currency               `json:"currency"`
	Subscribe    SubscribeConfig        `json:"subscribe"`
	Signature    SignatureConfig        `json:"signature"`
	VerifyCode   PubilcVerifyCodeConfig `json:"verify_code"`
	OAuthMethods []string               `json:"oauth_methods"`
	WebAd        bool                   `json:"web_ad"`
}

type GetGroupConfigRequest struct {
	Keys []string `form:"keys,omitempty"`
}

type GetGroupConfigResponse struct {
	Enabled bool                   `json:"enabled"`
	Mode    string                 `json:"mode"`
	Config  map[string]interface{} `json:"config"`
	State   RecalculationState     `json:"state"`
}

type GetGroupHistoryDetailRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetGroupHistoryDetailResponse struct {
	GroupHistoryDetail
}

type GetGroupHistoryRequest struct {
	Page        int    `form:"page"`
	Size        int    `form:"size"`
	GroupMode   string `form:"group_mode,omitempty"`
	TriggerType string `form:"trigger_type,omitempty"`
}

type GetGroupHistoryResponse struct {
	Total int64          `json:"total"`
	List  []GroupHistory `json:"list"`
}

type GetInviteSalesRequest struct {
	Page      int   `form:"page"`
	Size      int   `form:"size"`
	StartTime int64 `form:"start_time"`
	EndTime   int64 `form:"end_time"`
}

type GetInviteSalesResponse struct {
	Total int64             `json:"total"`
	List  []InvitedUserSale `json:"list"`
}

type GetLoginLogRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type GetLoginLogResponse struct {
	List  []UserLoginLog `json:"list"`
	Total int64          `json:"total"`
}

type GetMessageLogListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Type   uint8  `form:"type"`
	Search string `form:"search,optional"`
}

type GetMessageLogListResponse struct {
	Total int64        `json:"total"`
	List  []MessageLog `json:"list"`
}

type GetNodeGroupListRequest struct {
	Page    int    `form:"page"`
	Size    int    `form:"size"`
	GroupId string `form:"group_id,omitempty"`
}

type GetNodeGroupListResponse struct {
	Total int64       `json:"total"`
	List  []NodeGroup `json:"list"`
}

type GetNodeMultiplierResponse struct {
	Periods []TimePeriod `json:"periods"`
}

type GetOAuthMethodsResponse struct {
	Methods []UserAuthMethod `json:"methods"`
}

type GetOrderListRequest struct {
	Page        int64  `form:"page" validate:"required"`
	Size        int64  `form:"size" validate:"required"`
	UserId      int64  `form:"user_id,omitempty"`
	Status      uint8  `form:"status,omitempty"`
	SubscribeId int64  `form:"subscribe_id,omitempty"`
	Search      string `form:"search,omitempty"`
}

type GetOrderListResponse struct {
	Total int64   `json:"total"`
	List  []Order `json:"list"`
}

type GetPaymentMethodListRequest struct {
	Page     int    `form:"page"`
	Size     int    `form:"size"`
	Platform string `form:"platform,omitempty"`
	Search   string `form:"search,omitempty"`
	Enable   *bool  `form:"enable,omitempty"`
}

type GetPaymentMethodListResponse struct {
	Total int64                 `json:"total"`
	List  []PaymentMethodDetail `json:"list"`
}

type GetPreSendEmailCountRequest struct {
	Scope             int8  `json:"scope"`
	RegisterStartTime int64 `json:"register_start_time,omitempty"`
	RegisterEndTime   int64 `json:"register_end_time,omitempty"`
}

type GetPreSendEmailCountResponse struct {
	Count int64 `json:"count"`
}

type GetRedemptionCodeListRequest struct {
	Page          int64  `form:"page" validate:"required"`
	Size          int64  `form:"size" validate:"required"`
	SubscribePlan int64  `form:"subscribe_plan,omitempty"`
	UnitTime      string `form:"unit_time,omitempty"`
	Code          string `form:"code,omitempty"`
}

type GetRedemptionCodeListResponse struct {
	Total int64            `json:"total"`
	List  []RedemptionCode `json:"list"`
}

type GetRedemptionRecordListRequest struct {
	Page   int64 `form:"page" validate:"required"`
	Size   int64 `form:"size" validate:"required"`
	UserId int64 `form:"user_id,omitempty"`
	CodeId int64 `form:"code_id,omitempty"`
}

type GetRedemptionRecordListResponse struct {
	Total int64              `json:"total"`
	List  []RedemptionRecord `json:"list"`
}

type GetServerConfigRequest struct {
	ServerCommon
}

type GetServerConfigResponse struct {
	Basic    ServerBasic `json:"basic"`
	Protocol string      `json:"protocol"`
	Config   interface{} `json:"config"`
}

type GetServerProtocolsRequest struct {
	Id int64 `form:"id"`
}

type GetServerProtocolsResponse struct {
	Protocols []Protocol `json:"protocols"`
}

type GetServerUserListRequest struct {
	ServerCommon
}

type GetServerUserListResponse struct {
	Users []ServerUser `json:"users"`
}

type GetStatResponse struct {
	User     int64    `json:"user"`
	Node     int64    `json:"node"`
	Country  int64    `json:"country"`
	Protocol []string `json:"protocol"`
}

type GetSubscribeApplicationListRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type GetSubscribeApplicationListResponse struct {
	Total int64                  `json:"total"`
	List  []SubscribeApplication `json:"list"`
}

type GetSubscribeClientResponse struct {
	Total int64             `json:"total"`
	List  []SubscribeClient `json:"list"`
}

type GetSubscribeDetailsRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetSubscribeGroupListResponse struct {
	List  []SubscribeGroup `json:"list"`
	Total int64            `json:"total"`
}

type GetSubscribeGroupMappingRequest struct {
}

type GetSubscribeGroupMappingResponse struct {
	List []SubscribeGroupMappingItem `json:"list"`
}

type GetSubscribeListRequest struct {
	Page        int64  `form:"page" validate:"required"`
	Size        int64  `form:"size" validate:"required"`
	Language    string `form:"language,omitempty"`
	Search      string `form:"search,omitempty"`
	NodeGroupId int64  `form:"node_group_id,omitempty"`
}

type GetSubscribeListResponse struct {
	List  []SubscribeItem `json:"list"`
	Total int64           `json:"total"`
}

type GetSubscribeLogRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type GetSubscribeLogResponse struct {
	List  []UserSubscribeLog `json:"list"`
	Total int64              `json:"total"`
}

type GetSubscribeStatusRequest struct {
	Email string `form:"email" json:"email" validate:"omitempty,email"`
}

type GetSubscribeStatusResponse struct {
	DeviceStatus bool `json:"device_status"`
	EmailStatus  bool `json:"email_status"`
}

type GetSubscriptionRequest struct {
	Language string `form:"language"`
}

type GetSubscriptionResponse struct {
	List []Subscribe `json:"list"`
}

type GetTicketListRequest struct {
	Page   int64  `form:"page"`
	Size   int64  `form:"size"`
	UserId int64  `form:"user_id,omitempty"`
	Status *uint8 `form:"status,omitempty"`
	Search string `form:"search,omitempty"`
}

type GetTicketListResponse struct {
	Total int64    `json:"total"`
	List  []Ticket `json:"list"`
}

type GetTicketRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetTosResponse struct {
	TosContent string `json:"tos_content"`
}

type GetUserAuthMethodRequest struct {
	UserId int64 `json:"user_id"`
}

type GetUserAuthMethodResponse struct {
	AuthMethods []UserAuthMethod `json:"auth_methods"`
}

type GetUserInviteStatsRequest struct {
}

type GetUserInviteStatsResponse struct {
	FriendlyCount int64 `json:"friendly_count"`
	HistoryCount  int64 `json:"history_count"`
}

type GetUserListRequest struct {
	Page              int    `form:"page"`
	Size              int    `form:"size"`
	Search            string `form:"search,omitempty"`
	UserId            *int64 `form:"user_id,omitempty"`
	Unscoped          bool   `form:"unscoped,omitempty"`
	SubscribeId       *int64 `form:"subscribe_id,omitempty"`
	UserSubscribeId   *int64 `form:"user_subscribe_id,omitempty"`
	ShortCode         string `form:"short_code,omitempty"`
	DeviceId          *int64 `form:"device_id,omitempty"`
	FamilyJoined      *bool  `form:"family_joined,omitempty"`
	FamilyStatus      string `form:"family_status,omitempty"`
	FamilyOwnerUserId *int64 `form:"family_owner_user_id,omitempty"`
	FamilyId          *int64 `form:"family_id,omitempty"`
	SortOrder         string `form:"sort_order,omitempty"`
}

type GetUserListResponse struct {
	Total int64  `json:"total"`
	List  []User `json:"list"`
}

type GetUserLoginLogsRequest struct {
	Page   int   `form:"page"`
	Size   int   `form:"size"`
	UserId int64 `form:"user_id"`
}

type GetUserLoginLogsResponse struct {
	List  []UserLoginLog `json:"list"`
	Total int64          `json:"total"`
}

type GetUserSubscribeByIdRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetUserSubscribeDevicesRequest struct {
	Page        int   `form:"page"`
	Size        int   `form:"size"`
	UserId      int64 `form:"user_id"`
	SubscribeId int64 `form:"subscribe_id"`
}

type GetUserSubscribeDevicesResponse struct {
	List  []UserDevice `json:"list"`
	Total int64        `json:"total"`
}

type GetUserSubscribeListRequest struct {
	Page   int   `form:"page"`
	Size   int   `form:"size"`
	UserId int64 `form:"user_id"`
}

type GetUserSubscribeListResponse struct {
	List  []UserSubscribe `json:"list"`
	Total int64           `json:"total"`
}

type GetUserSubscribeLogsRequest struct {
	Page        int   `form:"page"`
	Size        int   `form:"size"`
	UserId      int64 `form:"user_id"`
	SubscribeId int64 `form:"subscribe_id,omitempty"`
}

type GetUserSubscribeLogsResponse struct {
	List  []UserSubscribeLog `json:"list"`
	Total int64              `json:"total"`
}

type GetUserSubscribeResetTrafficLogsRequest struct {
	Page            int   `form:"page"`
	Size            int   `form:"size"`
	UserSubscribeId int64 `form:"user_subscribe_id"`
}

type GetUserSubscribeResetTrafficLogsResponse struct {
	List  []ResetSubscribeTrafficLog `json:"list"`
	Total int64                      `json:"total"`
}

type GetUserSubscribeTrafficLogsRequest struct {
	Page        int   `form:"page"`
	Size        int   `form:"size"`
	UserId      int64 `form:"user_id"`
	SubscribeId int64 `form:"subscribe_id"`
	StartTime   int64 `form:"start_time"`
	EndTime     int64 `form:"end_time"`
}

type GetUserSubscribeTrafficLogsResponse struct {
	List  []TrafficLog `json:"list"`
	Total int64        `json:"total"`
}

type GetUserTicketDetailRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetUserTicketListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Status *uint8 `form:"status,omitempty"`
	Search string `form:"search,omitempty"`
}

type GetUserTicketListResponse struct {
	Total int64    `json:"total"`
	List  []Ticket `json:"list"`
}

type GetUserTrafficStatsRequest struct {
	UserSubscribeId string `form:"user_subscribe_id" validate:"required"`
	Days            int    `form:"days" validate:"required,oneof=7 30"`
}

type GetUserTrafficStatsResponse struct {
	List          []DailyTrafficStats `json:"list"`
	TotalUpload   int64               `json:"total_upload"`
	TotalDownload int64               `json:"total_download"`
	TotalTraffic  int64               `json:"total_traffic"`
}

type GiftLog struct {
	Type        uint16 `json:"type"`
	UserId      int64  `json:"user_id"`
	OrderNo     string `json:"order_no"`
	SubscribeId int64  `json:"subscribe_id"`
	Amount      int64  `json:"amount"`
	Balance     int64  `json:"balance"`
	Remark      string `json:"remark,omitempty"`
	Timestamp   int64  `json:"timestamp"`
}

type GoogleLoginCallbackRequest struct {
	Code  string `form:"code"`
	State string `form:"state"`
}

type GroupHistory struct {
	Id           int64  `json:"id"`
	GroupMode    string `json:"group_mode"`
	TriggerType  string `json:"trigger_type"`
	TotalUsers   int    `json:"total_users"`
	SuccessCount int    `json:"success_count"`
	FailedCount  int    `json:"failed_count"`
	StartTime    *int64 `json:"start_time,omitempty"`
	EndTime      *int64 `json:"end_time,omitempty"`
	Operator     string `json:"operator,omitempty"`
	ErrorLog     string `json:"error_log,omitempty"`
	CreatedAt    int64  `json:"created_at"`
}

type GroupHistoryDetail struct {
	GroupHistory
	ConfigSnapshot map[string]interface{} `json:"config_snapshot,omitempty"`
}

type HasMigrateSeverNodeResponse struct {
	HasMigrate bool `json:"has_migrate"`
}

type HeartbeatResponse struct {
	Status    bool   `json:"status"`
	Message   string `json:"message,omitempty"`
	Timestamp int64  `json:"timestamp,omitempty"`
}

type Hysteria2 struct {
	Port           int            `json:"port" validate:"required"`
	HopPorts       string         `json:"hop_ports" validate:"required"`
	HopInterval    int            `json:"hop_interval" validate:"required"`
	ObfsPassword   string         `json:"obfs_password" validate:"required"`
	SecurityConfig SecurityConfig `json:"security_config"`
}

type InviteConfig struct {
	ForcedInvite       bool  `json:"forced_invite"`
	ReferralPercentage int64 `json:"referral_percentage"`
	OnlyFirstPurchase  bool  `json:"only_first_purchase"`
	GiftDays           int64 `json:"gift_days"`
}

type InvitedUserSale struct {
	Amount      float64 `json:"amount"`
	UpdatedAt   int64   `json:"updated_at"`
	UserHash    string  `json:"user_hash"`
	ProductName string  `json:"product_name"`
}

type KickOfflineRequest struct {
	Id int64 `json:"id"`
}

type LegacyCheckVerificationCodeRequest struct {
	Method  string `json:"method" form:"method" validate:"omitempty,oneof=email mobile"`
	Account string `json:"account" form:"account"`
	Email   string `json:"email" form:"email"`
	Code    string `json:"code" form:"code" validate:"required"`
	Type    uint8  `json:"type" form:"type" validate:"required"`
}

type LegacyCheckVerificationCodeResponse struct {
	Status bool `json:"status"`
	Exist  bool `json:"exist"`
}

type LogResponse struct {
	List interface{} `json:"list"`
}

type LogSetting struct {
	AutoClear *bool `json:"auto_clear"`
	ClearDays int64 `json:"clear_days"`
}

type LoginLog struct {
	UserId    int64  `json:"user_id"`
	Method    string `json:"method"`
	LoginIP   string `json:"login_ip"`
	UserAgent string `json:"user_agent"`
	Success   bool   `json:"success"`
	Timestamp int64  `json:"timestamp"`
}

type LoginResponse struct {
	Token string `json:"token"`
}

type MessageLog struct {
	Id        int64       `json:"id"`
	Type      uint8       `json:"type"`
	Platform  string      `json:"platform"`
	To        string      `json:"to"`
	Subject   string      `json:"subject"`
	Content   interface{} `json:"content"`
	Status    uint8       `json:"status"`
	CreatedAt int64       `json:"created_at"`
}

type MigrateServerNodeResponse struct {
	Succee  uint64 `json:"succee"`
	Fail    uint64 `json:"fail"`
	Message string `json:"message,omitempty"`
}

type MobileAuthenticateConfig struct {
	Enable          bool     `json:"enable"`
	EnableWhitelist bool     `json:"enable_whitelist"`
	Whitelist       []string `json:"whitelist"`
}

type ModuleConfig struct {
	Secret         string `json:"secret"`          // 通讯密钥
	ServiceName    string `json:"service_name"`    // 服务名称
	ServiceVersion string `json:"service_version"` // 服务版本
}

type Node struct {
	Id           int64    `json:"id"`
	Name         string   `json:"name"`
	Tags         []string `json:"tags"`
	Port         uint16   `json:"port"`
	Address      string   `json:"address"`
	ServerId     int64    `json:"server_id"`
	Protocol     string   `json:"protocol"`
	Enabled      *bool    `json:"enabled"`
	Sort         int      `json:"sort,omitempty"`
	NodeGroupId  int64    `json:"node_group_id,omitempty"`
	NodeGroupIds []int64  `json:"node_group_ids,omitempty"`
	CreatedAt    int64    `json:"created_at"`
	UpdatedAt    int64    `json:"updated_at"`
}

type NodeConfig struct {
	NodeSecret             string         `json:"node_secret"`
	NodePullInterval       int64          `json:"node_pull_interval"`
	NodePushInterval       int64          `json:"node_push_interval"`
	TrafficReportThreshold int64          `json:"traffic_report_threshold"`
	IPStrategy             string         `json:"ip_strategy"`
	DNS                    []NodeDNS      `json:"dns"`
	Block                  []string       `json:"block"`
	Outbound               []NodeOutbound `json:"outbound"`
}

type NodeDNS struct {
	Proto   string   `json:"proto"`
	Address string   `json:"address"`
	Domains []string `json:"domains"`
}

type NodeGroup struct {
	Id                  int64  `json:"id"`
	Name                string `json:"name"`
	Description         string `json:"description"`
	Sort                int    `json:"sort"`
	ForCalculation      bool   `json:"for_calculation"`
	IsExpiredGroup      bool   `json:"is_expired_group"`
	ExpiredDaysLimit    int    `json:"expired_days_limit"`
	MaxTrafficGBExpired int64  `json:"max_traffic_gb_expired,omitempty"`
	SpeedLimit          int    `json:"speed_limit"`
	MinTrafficGB        int64  `json:"min_traffic_gb,omitempty"`
	MaxTrafficGB        int64  `json:"max_traffic_gb,omitempty"`
	NodeCount           int64  `json:"node_count,omitempty"`
	CreatedAt           int64  `json:"created_at"`
	UpdatedAt           int64  `json:"updated_at"`
}

type NodeGroupItem struct {
	Id    int64  `json:"id"`
	Name  string `json:"name"`
	Nodes []Node `json:"nodes"`
}

type NodeOutbound struct {
	Name     string   `json:"name"`
	Protocol string   `json:"protocol"`
	Address  string   `json:"address"`
	Port     int64    `json:"port"`
	Password string   `json:"password"`
	Rules    []string `json:"rules"`
}

type NodeRelay struct {
	Host   string `json:"host"`
	Port   int    `json:"port"`
	Prefix string `json:"prefix"`
}

type OAthLoginRequest struct {
	Method   string `json:"method" validate:"required"` // google, facebook, apple, telegram, github etc.
	Redirect string `json:"redirect"`
}

type OAuthLoginGetTokenRequest struct {
	Method   string      `json:"method" validate:"required"` // google, facebook, apple, telegram, github etc.
	Callback interface{} `json:"callback" validate:"required"`
}

type OAuthLoginResponse struct {
	Redirect string `json:"redirect"`
}

type OnlineUser struct {
	SID int64  `json:"uid"`
	IP  string `json:"ip"`
}

type OnlineUsersRequest struct {
	ServerCommon
	Users []OnlineUser `json:"users"`
}

type Order struct {
	Id             int64         `json:"id"`
	UserId         int64         `json:"user_id"`
	OrderNo        string        `json:"order_no"`
	Type           uint8         `json:"type"`
	Quantity       int64         `json:"quantity"`
	Price          int64         `json:"price"`
	Amount         int64         `json:"amount"`
	GiftAmount     int64         `json:"gift_amount"`
	Discount       int64         `json:"discount"`
	Coupon         string        `json:"coupon"`
	CouponDiscount int64         `json:"coupon_discount"`
	Commission     int64         `json:"commission,omitempty"`
	Payment        PaymentMethod `json:"payment"`
	FeeAmount      int64         `json:"fee_amount"`
	TradeNo        string        `json:"trade_no"`
	Status         uint8         `json:"status"`
	StatusName     string        `json:"status_name,omitempty"`
	SubscribeId    int64         `json:"subscribe_id"`
	CreatedAt      int64         `json:"created_at"`
	UpdatedAt      int64         `json:"updated_at"`
}

type OrderDetail struct {
	Id             int64         `json:"id"`
	UserId         int64         `json:"user_id"`
	OrderNo        string        `json:"order_no"`
	Type           uint8         `json:"type"`
	Quantity       int64         `json:"quantity"`
	Price          int64         `json:"price"`
	Amount         int64         `json:"amount"`
	GiftAmount     int64         `json:"gift_amount"`
	Discount       int64         `json:"discount"`
	Coupon         string        `json:"coupon"`
	CouponDiscount int64         `json:"coupon_discount"`
	Commission     int64         `json:"commission,omitempty"`
	Payment        PaymentMethod `json:"payment"`
	Method         string        `json:"method"`
	FeeAmount      int64         `json:"fee_amount"`
	TradeNo        string        `json:"trade_no"`
	Status         uint8         `json:"status"`
	StatusName     string        `json:"status_name,omitempty"`
	SubscribeId    int64         `json:"subscribe_id"`
	Subscribe      Subscribe     `json:"subscribe"`
	CreatedAt      int64         `json:"created_at"`
	UpdatedAt      int64         `json:"updated_at"`
}

type OrderRefundLog struct {
	OrderId                int64  `json:"order_id"`
	OrderNo                string `json:"order_no"`
	OperatorUserId         int64  `json:"operator_user_id"`
	OperatorAuthIdentifier string `json:"operator_auth_identifier,omitempty"`
	TargetUserId           int64  `json:"target_user_id"`
	UserSubscribeId        int64  `json:"user_subscribe_id"`
	RefererUserId          int64  `json:"referer_user_id,omitempty"`
	CommissionAmount       int64  `json:"commission_amount"`
	Reason                 string `json:"reason,omitempty"`
	OrderStatusBefore      uint8  `json:"order_status_before"`
	OrderStatusAfter       uint8  `json:"order_status_after"`
	SubscribeStatusBefore  uint8  `json:"subscribe_status_before"`
	SubscribeStatusAfter   uint8  `json:"subscribe_status_after"`
	SubscribeExpireBefore  int64  `json:"subscribe_expire_before"`
	SubscribeExpireAfter   int64  `json:"subscribe_expire_after"`
	CommissionBefore       int64  `json:"commission_before"`
	CommissionAfter        int64  `json:"commission_after"`
	Timestamp              int64  `json:"timestamp"`
}

type OrdersStatistics struct {
	Date               string             `json:"date,omitempty"`
	AmountTotal        int64              `json:"amount_total"`
	NewOrderAmount     int64              `json:"new_order_amount"`
	RenewalOrderAmount int64              `json:"renewal_order_amount"`
	List               []OrdersStatistics `json:"list,omitempty"`
}

type PaymentConfig struct {
	Id          int64       `json:"id" validate:"required"`
	Name        string      `json:"name" validate:"required"`
	Platform    string      `json:"platform" validate:"required"`
	Description string      `json:"description"`
	Icon        string      `json:"icon,omitempty"`
	Domain      string      `json:"domain,omitempty"`
	Config      interface{} `json:"config" validate:"required"`
	FeeMode     uint        `json:"fee_mode"`
	FeePercent  int64       `json:"fee_percent,omitempty"`
	FeeAmount   int64       `json:"fee_amount,omitempty"`
	Enable      *bool       `json:"enable" validate:"required"`
}

type PaymentMethod struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Platform    string `json:"platform"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	FeeMode     uint   `json:"fee_mode"`
	FeePercent  int64  `json:"fee_percent"`
	FeeAmount   int64  `json:"fee_amount"`
}

type PaymentMethodDetail struct {
	Id          int64       `json:"id"`
	Name        string      `json:"name"`
	Platform    string      `json:"platform"`
	Description string      `json:"description"`
	Icon        string      `json:"icon"`
	Domain      string      `json:"domain"`
	Config      interface{} `json:"config"`
	FeeMode     uint        `json:"fee_mode"`
	FeePercent  int64       `json:"fee_percent"`
	FeeAmount   int64       `json:"fee_amount"`
	Enable      bool        `json:"enable"`
	NotifyURL   string      `json:"notify_url"`
}

type PlatformDownloads struct {
	IOS     int64 `json:"ios"`
	Android int64 `json:"android"`
	Windows int64 `json:"windows"`
	Mac     int64 `json:"mac"`
}

type PlatformInfo struct {
	Platform                 string            `json:"platform"`
	PlatformUrl              string            `json:"platform_url"`
	PlatformFieldDescription map[string]string `json:"platform_field_description"`
}

type PlatformResponse struct {
	List []PlatformInfo `json:"list"`
}

type PortalPurchaseRequest struct {
	AuthType       string `json:"auth_type"`
	Identifier     string `json:"identifier"`
	Password       string `json:"password,omitempty"`
	Payment        int64  `json:"payment"`
	SubscribeId    int64  `json:"subscribe_id"`
	Quantity       int64  `json:"quantity"`
	Coupon         string `json:"coupon,omitempty"`
	InviteCode     string `json:"invite_code,omitempty"`
	TurnstileToken string `json:"turnstile_token,omitempty"`
}

type PortalPurchaseResponse struct {
	OrderNo string `json:"order_no"`
}

type PreOrderResponse struct {
	Price          int64  `json:"price"`
	Amount         int64  `json:"amount"`
	Discount       int64  `json:"discount"`
	GiftAmount     int64  `json:"gift_amount"`
	Coupon         string `json:"coupon"`
	CouponDiscount int64  `json:"coupon_discount"`
	FeeAmount      int64  `json:"fee_amount"`
}

type PrePurchaseOrderRequest struct {
	Payment     int64  `json:"payment,omitempty"`
	SubscribeId int64  `json:"subscribe_id"`
	Quantity    int64  `json:"quantity"`
	Coupon      string `json:"coupon,omitempty"`
}

type PrePurchaseOrderResponse struct {
	Price          int64  `json:"price"`
	Amount         int64  `json:"amount"`
	Discount       int64  `json:"discount"`
	Coupon         string `json:"coupon"`
	CouponDiscount int64  `json:"coupon_discount"`
	FeeAmount      int64  `json:"fee_amount"`
}

type PreRenewalOrderResponse struct {
	OrderNo string `json:"orderNo"`
}

type PreUnsubscribeRequest struct {
	Id int64 `json:"id"`
}

type PreUnsubscribeResponse struct {
	DeductionAmount int64 `json:"deduction_amount"`
}

type PreViewNodeMultiplierResponse struct {
	CurrentTime string  `json:"current_time"`
	Ratio       float32 `json:"ratio"`
}

type PreviewSubscribeTemplateRequest struct {
	Id int64 `form:"id"`
}

type PreviewSubscribeTemplateResponse struct {
	Template string `json:"template"` // 预览的模板内容
}

type PreviewUserNodesRequest struct {
	UserId int64 `form:"user_id" validate:"required"`
}

type PreviewUserNodesResponse struct {
	UserId     int64           `json:"user_id"`
	NodeGroups []NodeGroupItem `json:"node_groups"`
}

type PrivacyPolicyConfig struct {
	PrivacyPolicy string `json:"privacy_policy"`
}

type Protocol struct {
	Type                    string  `json:"type"`
	Port                    uint16  `json:"port"`
	Enable                  bool    `json:"enable"`
	Security                string  `json:"security,omitempty"`
	SNI                     string  `json:"sni,omitempty"`
	AllowInsecure           bool    `json:"allow_insecure,omitempty"`
	Fingerprint             string  `json:"fingerprint,omitempty"`
	RealityServerAddr       string  `json:"reality_server_addr,omitempty"`
	RealityServerPort       int     `json:"reality_server_port,omitempty"`
	RealityPrivateKey       string  `json:"reality_private_key,omitempty"`
	RealityPublicKey        string  `json:"reality_public_key,omitempty"`
	RealityShortId          string  `json:"reality_short_id,omitempty"`
	Transport               string  `json:"transport,omitempty"`
	Host                    string  `json:"host,omitempty"`
	Path                    string  `json:"path,omitempty"`
	ServiceName             string  `json:"service_name,omitempty"`
	Cipher                  string  `json:"cipher,omitempty"`
	ServerKey               string  `json:"server_key,omitempty"`
	Flow                    string  `json:"flow,omitempty"`
	HopPorts                string  `json:"hop_ports,omitempty"`
	HopInterval             int     `json:"hop_interval,omitempty"`
	ObfsPassword            string  `json:"obfs_password,omitempty"`
	DisableSNI              bool    `json:"disable_sni,omitempty"`
	ReduceRtt               bool    `json:"reduce_rtt,omitempty"`
	UDPRelayMode            string  `json:"udp_relay_mode,omitempty"`
	CongestionController    string  `json:"congestion_controller,omitempty"`
	Multiplex               string  `json:"multiplex,omitempty"`                 // mux, eg: off/low/medium/high
	PaddingScheme           string  `json:"padding_scheme,omitempty"`            // padding scheme
	UpMbps                  int     `json:"up_mbps,omitempty"`                   // upload speed limit
	DownMbps                int     `json:"down_mbps,omitempty"`                 // download speed limit
	Obfs                    string  `json:"obfs,omitempty"`                      // obfs, 'none', 'http', 'tls'
	ObfsHost                string  `json:"obfs_host,omitempty"`                 // obfs host
	ObfsPath                string  `json:"obfs_path,omitempty"`                 // obfs path
	XhttpMode               string  `json:"xhttp_mode,omitempty"`                // xhttp mode
	XhttpExtra              string  `json:"xhttp_extra,omitempty"`               // xhttp extra path
	Encryption              string  `json:"encryption,omitempty"`                // encryption，'none', 'mlkem768x25519plus'
	EncryptionMode          string  `json:"encryption_mode,omitempty"`           // encryption mode，'native', 'xorpub', 'random'
	EncryptionRtt           string  `json:"encryption_rtt,omitempty"`            // encryption rtt，'0rtt', '1rtt'
	EncryptionTicket        string  `json:"encryption_ticket,omitempty"`         // encryption ticket
	EncryptionServerPadding string  `json:"encryption_server_padding,omitempty"` // encryption server padding
	EncryptionPrivateKey    string  `json:"encryption_private_key,omitempty"`    // encryption private key
	EncryptionClientPadding string  `json:"encryption_client_padding,omitempty"` // encryption client padding
	EncryptionPassword      string  `json:"encryption_password,omitempty"`       // encryption password
	Ratio                   float64 `json:"ratio,omitempty"`                     // Traffic ratio, default is 1
	CertMode                string  `json:"cert_mode,omitempty"`                 // Certificate mode, `none`｜`http`｜`dns`｜`self`
	CertDNSProvider         string  `json:"cert_dns_provider,omitempty"`         // DNS provider for certificate
	CertDNSEnv              string  `json:"cert_dns_env,omitempty"`              // Environment for DNS provider
}

type PubilcRegisterConfig struct {
	StopRegister            bool  `json:"stop_register"`
	EnableIpRegisterLimit   bool  `json:"enable_ip_register_limit"`
	IpRegisterLimit         int64 `json:"ip_register_limit"`
	IpRegisterLimitDuration int64 `json:"ip_register_limit_duration"`
}

type PubilcVerifyCodeConfig struct {
	VerifyCodeInterval int64 `json:"verify_code_interval"`
}

type PurchaseOrderRequest struct {
	SubscribeId int64  `json:"subscribe_id"`
	Quantity    int64  `json:"quantity" validate:"required,gt=0,lte=1000"`
	Payment     int64  `json:"payment,omitempty"`
	Coupon      string `json:"coupon,omitempty"`
}

type PurchaseOrderResponse struct {
	OrderNo         string `json:"order_no"`
	AppAccountToken string `json:"app_account_token"`
}

type QueryAnnouncementRequest struct {
	Page   int   `form:"page"`
	Size   int   `form:"size,default=15"`
	Pinned *bool `form:"pinned"`
	Popup  *bool `form:"popup"`
}

type QueryAnnouncementResponse struct {
	Total int64          `json:"total"`
	List  []Announcement `json:"announcements"`
}

type QueryDocumentDetailRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type QueryDocumentListResponse struct {
	Total int64      `json:"total"`
	List  []Document `json:"list"`
}

type QueryIPLocationRequest struct {
	IP string `form:"ip" validate:"required"`
}

type QueryIPLocationResponse struct {
	Country string `json:"country"`
	Region  string `json:"region,omitempty"`
	City    string `json:"city"`
}

type QueryNodeTagResponse struct {
	Tags []string `json:"tags"`
}

type QueryOrderDetailRequest struct {
	OrderNo string `form:"order_no" validate:"required"`
}

type QueryOrderListRequest struct {
	Page   int    `form:"page" validate:"required"`
	Size   int    `form:"size" validate:"required"`
	Status int    `form:"status,optional"`
	Search string `form:"search,optional"`
}

type QueryOrderListResponse struct {
	Total int64         `json:"total"`
	List  []OrderDetail `json:"list"`
}

type QueryPurchaseOrderRequest struct {
	AuthType   string `form:"auth_type"`
	Identifier string `form:"identifier"`
	OrderNo    string `form:"order_no"`
}

type QueryPurchaseOrderResponse struct {
	OrderNo        string        `json:"order_no"`
	Subscribe      Subscribe     `json:"subscribe"`
	Quantity       int64         `json:"quantity"`
	Price          int64         `json:"price"`
	Amount         int64         `json:"amount"`
	Discount       int64         `json:"discount"`
	Coupon         string        `json:"coupon"`
	CouponDiscount int64         `json:"coupon_discount"`
	FeeAmount      int64         `json:"fee_amount"`
	Payment        PaymentMethod `json:"payment"`
	Status         uint8         `json:"status"`
	CreatedAt      int64         `json:"created_at"`
	Token          string        `json:"token,omitempty"`
}

type QueryQuotaTaskListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	Status *uint8 `form:"status,omitempty"`
}

type QueryQuotaTaskListResponse struct {
	Total int64       `json:"total"`
	List  []QuotaTask `json:"list"`
}

type QueryQuotaTaskPreCountRequest struct {
	Subscribers []int64 `json:"subscribers"`
	IsActive    *bool   `json:"is_active"`
	StartTime   int64   `json:"start_time"`
	EndTime     int64   `json:"end_time"`
}

type QueryQuotaTaskPreCountResponse struct {
	Count int64 `json:"count"`
}

type QueryQuotaTaskStatusRequest struct {
	Id int64 `json:"id"`
}

type QueryQuotaTaskStatusResponse struct {
	Status  uint8  `json:"status"`
	Current int64  `json:"current"`
	Total   int64  `json:"total"`
	Errors  string `json:"errors"`
}

type QueryServerConfigRequest struct {
	ServerID  int64    `path:"server_id"`
	SecretKey string   `form:"secret_key"`
	Protocols []string `form:"protocols,omitempty"`
}

type QueryServerConfigResponse struct {
	TrafficReportThreshold int64          `json:"traffic_report_threshold"`
	IPStrategy             string         `json:"ip_strategy"`
	DNS                    []NodeDNS      `json:"dns"`
	Block                  []string       `json:"block"`
	Outbound               []NodeOutbound `json:"outbound"`
	Protocols              []Protocol     `json:"protocols"`
	Total                  int64          `json:"total"`
}

type QuerySubscribeGroupListResponse struct {
	List  []SubscribeGroup `json:"list"`
	Total int64            `json:"total"`
}

type QuerySubscribeListRequest struct {
	Language string `form:"language"`
}

type QuerySubscribeListResponse struct {
	List  []Subscribe `json:"list"`
	Total int64       `json:"total"`
}

type QueryUserAffiliateCountResponse struct {
	Registers       int64 `json:"registers"`
	TotalCommission int64 `json:"total_commission"`
}

type QueryUserAffiliateListRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type QueryUserAffiliateListResponse struct {
	List  []UserAffiliate `json:"list"`
	Total int64           `json:"total"`
}

type QueryUserBalanceLogListResponse struct {
	List  []BalanceLog `json:"list"`
	Total int64        `json:"total"`
}

type QueryUserCommissionLogListRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type QueryUserCommissionLogListResponse struct {
	List  []CommissionLog `json:"list"`
	Total int64           `json:"total"`
}

type QueryUserSubscribeListResponse struct {
	List  []UserSubscribe `json:"list"`
	Total int64           `json:"total"`
}

type QueryUserSubscribeNodeListResponse struct {
	List []UserSubscribeInfo `json:"list"`
}

type QueryWithdrawalLogListRequest struct {
	Page int `form:"page"`
	Size int `form:"size"`
}

type QueryWithdrawalLogListResponse struct {
	List  []WithdrawalLog `json:"list"`
	Total int64           `json:"total"`
}

type GetWithdrawalListRequest struct {
	Page   int    `form:"page"`
	Size   int    `form:"size"`
	UserId *int64 `form:"user_id,omitempty"`
	Status *uint8 `form:"status,omitempty"`
}

type GetWithdrawalListResponse struct {
	List  []WithdrawalLog `json:"list"`
	Total int64           `json:"total"`
}

type ApproveWithdrawalRequest struct {
	WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
}

type RejectWithdrawalRequest struct {
	WithdrawalId int64  `json:"withdrawal_id" validate:"required,gt=0"`
	Reason       string `json:"reason" validate:"required,max=500"`
}

type QuotaTask struct {
	Id           int64   `json:"id"`
	Subscribers  []int64 `json:"subscribers"`
	IsActive     *bool   `json:"is_active"`
	StartTime    int64   `json:"start_time"`
	EndTime      int64   `json:"end_time"`
	ResetTraffic bool    `json:"reset_traffic"`
	Days         uint64  `json:"days"`
	GiftType     uint8   `json:"gift_type"`
	GiftValue    uint64  `json:"gift_value"`
	Objects      []int64 `json:"objects"` // UserSubscribe IDs
	Status       uint8   `json:"status"`
	Total        int64   `json:"total"`
	Current      int64   `json:"current"`
	Errors       string  `json:"errors"`
	CreatedAt    int64   `json:"created_at"`
	UpdatedAt    int64   `json:"updated_at"`
}

type RecalculateGroupRequest struct {
	Mode        string `json:"mode" validate:"required"`
	TriggerType string `json:"trigger_type"` // "manual" or "scheduled"
}

type RecalculationState struct {
	State    string `json:"state"`
	Progress int    `json:"progress"`
	Total    int    `json:"total"`
}

type RechargeOrderRequest struct {
	Amount  int64 `json:"amount" validate:"required,gt=0,lte=2000000000"`
	Payment int64 `json:"payment"`
}

type RechargeOrderResponse struct {
	OrderNo string `json:"order_no"`
}

type RecoverOrderRequest struct {
	OrderNo string `json:"order_no" validate:"required"`
	Email   string `json:"email" validate:"required,email"`
	Code    string `json:"code" validate:"required"`
}

type RecoverOrderResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type RecoverySendCodeRequest struct {
	Email string `json:"email" validate:"required,email"`
}

type RedeemCodeRequest struct {
	Code string `json:"code" validate:"required"`
}

type RedeemCodeResponse struct {
	Message string `json:"message"`
}

type RedemptionCode struct {
	Id            int64  `json:"id"`
	Code          string `json:"code"`
	TotalCount    int64  `json:"total_count"`
	UsedCount     int64  `json:"used_count"`
	SubscribePlan int64  `json:"subscribe_plan"`
	UnitTime      string `json:"unit_time"`
	Quantity      int64  `json:"quantity"`
	Status        int64  `json:"status"`
	CreatedAt     int64  `json:"created_at"`
	UpdatedAt     int64  `json:"updated_at"`
}

type RedemptionRecord struct {
	Id               int64  `json:"id"`
	RedemptionCodeId int64  `json:"redemption_code_id"`
	UserId           int64  `json:"user_id"`
	SubscribeId      int64  `json:"subscribe_id"`
	UnitTime         string `json:"unit_time"`
	Quantity         int64  `json:"quantity"`
	RedeemedAt       int64  `json:"redeemed_at"`
	CreatedAt        int64  `json:"created_at"`
}

type RegisterConfig struct {
	StopRegister              bool   `json:"stop_register"`
	EnableTrial               bool   `json:"enable_trial"`
	EnableTrialEmailWhitelist bool   `json:"enable_trial_email_whitelist"`
	TrialSubscribe            int64  `json:"trial_subscribe"`
	TrialTime                 int64  `json:"trial_time"`
	TrialTimeUnit             string `json:"trial_time_unit"`
	TrialEmailDomainWhitelist string `json:"trial_email_domain_whitelist"`
	EnableIpRegisterLimit     bool   `json:"enable_ip_register_limit"`
	IpRegisterLimit           int64  `json:"ip_register_limit"`
	IpRegisterLimitDuration   int64  `json:"ip_register_limit_duration"`
	DeviceLimit               int64  `json:"device_limit"`
}

type RegisterLog struct {
	UserId     int64  `json:"user_id"`
	AuthMethod string `json:"auth_method"`
	Identifier string `json:"identifier"`
	RegisterIP string `json:"register_ip"`
	UserAgent  string `json:"user_agent"`
	Timestamp  int64  `json:"timestamp"`
}

type RemoveFamilyMemberRequest struct {
	FamilyId int64  `json:"family_id" validate:"required,gt=0"`
	UserId   int64  `json:"user_id" validate:"required,gt=0"`
	Reason   string `json:"reason,omitempty"`
}

type RenewalOrderRequest struct {
	UserSubscribeID int64  `json:"user_subscribe_id"`
	Quantity        int64  `json:"quantity" validate:"lte=1000"`
	Payment         int64  `json:"payment"`
	Coupon          string `json:"coupon,omitempty"`
}

type RenewalOrderResponse struct {
	OrderNo         string `json:"order_no"`
	AppAccountToken string `json:"app_account_token"`
}

type ReportLogMessageRequest struct {
	Platform   string      `json:"platform" validate:"required,max=32"`
	AppVersion string      `json:"app_version" validate:"required,max=64"`
	OsName     string      `json:"os_name" validate:"max=64"`
	OsVersion  string      `json:"os_version" validate:"max=64"`
	DeviceId   string      `json:"device_id" validate:"required,max=255"`
	UserId     int64       `json:"user_id"`
	SessionId  string      `json:"session_id" validate:"max=255"`
	Level      uint8       `json:"level"`
	ErrorCode  string      `json:"error_code" validate:"max=128"`
	Message    string      `json:"message" validate:"required,max=65535"`
	Stack      string      `json:"stack" validate:"max=1048576"`
	Context    interface{} `json:"context"`
	OccurredAt int64       `json:"occurred_at"`
}

type ReportLogMessageResponse struct {
	Id int64 `json:"id"`
}

type ResetAllSubscribeTokenResponse struct {
	Success bool `json:"success"`
}

type ResetGroupsRequest struct {
	Confirm bool `json:"confirm" validate:"required"`
}

type ResetPasswordRequest struct {
	Identifier  string `json:"identifier"`
	Email       string `json:"email" validate:"required"`
	Password    string `json:"password" validate:"required"`
	Code        string `json:"code,optional"`
	IP          string `header:"X-Original-Forwarded-For"`
	UserAgent   string `header:"User-Agent"`
	LoginType   string `header:"Login-Type"`
	CfToken     string `json:"cf_token,optional"`
	CaptchaId   string `json:"captcha_id,optional"`
	CaptchaCode string `json:"captcha_code,optional"`
	SliderToken string `json:"slider_token,optional"`
}

type ResetSortRequest struct {
	Sort []SortItem `json:"sort"`
}

type ResetSubscribeLog struct {
	Type            uint16 `json:"type"`
	UserId          int64  `json:"user_id"`
	UserSubscribeId int64  `json:"user_subscribe_id"`
	OrderNo         string `json:"order_no,omitempty"`
	Timestamp       int64  `json:"timestamp"`
}

type ResetSubscribeTrafficLog struct {
	Id              int64  `json:"id"`
	Type            uint16 `json:"type"`
	UserSubscribeId int64  `json:"user_subscribe_id"`
	OrderNo         string `json:"order_no,omitempty"`
	Timestamp       int64  `json:"timestamp"`
}

type ResetTrafficOrderRequest struct {
	UserSubscribeID int64 `json:"user_subscribe_id"`
	Payment         int64 `json:"payment"`
}

type ResetTrafficOrderResponse struct {
	OrderNo string `json:"order_no"`
}

type ResetUserSubscribeTokenRequest struct {
	UserSubscribeId int64 `json:"user_subscribe_id"`
}

type ResetUserSubscribeTrafficRequest struct {
	UserSubscribeId int64 `json:"user_subscribe_id"`
}

type RestoreAppleTransactionsRequest struct {
	Transactions []string `json:"transactions" validate:"required"`
}

type RevenueStatisticsResponse struct {
	Today   OrdersStatistics `json:"today"`
	Monthly OrdersStatistics `json:"monthly"`
	All     OrdersStatistics `json:"all"`
}

type SecurityConfig struct {
	SNI               string `json:"sni"`
	AllowInsecure     *bool  `json:"allow_insecure"`
	Fingerprint       string `json:"fingerprint"`
	RealityServerAddr string `json:"reality_server_addr"`
	RealityServerPort int    `json:"reality_server_port"`
	RealityPrivateKey string `json:"reality_private_key"`
	RealityPublicKey  string `json:"reality_public_key"`
	RealityShortId    string `json:"reality_short_id"`
}

type SendCodeRequest struct {
	Email string `json:"email" validate:"required"`
	Type  uint8  `json:"type" validate:"required"`
}

type SendCodeResponse struct {
	Code   string `json:"code,omitempty"`
	Status bool   `json:"status"`
}

type SendSmsCodeRequest struct {
	Type              uint8  `json:"type" validate:"required"`
	Telephone         string `json:"telephone" validate:"required"`
	TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
}

type Server struct {
	Id             int64        `json:"id"`
	Name           string       `json:"name"`
	Country        string       `json:"country"`
	City           string       `json:"city"`
	Address        string       `json:"address"`
	Sort           int          `json:"sort"`
	Protocols      []Protocol   `json:"protocols"`
	LastReportedAt int64        `json:"last_reported_at"`
	Status         ServerStatus `json:"status"`
	CreatedAt      int64        `json:"created_at"`
	UpdatedAt      int64        `json:"updated_at"`
}

type ServerBasic struct {
	PushInterval int64 `json:"push_interval"`
	PullInterval int64 `json:"pull_interval"`
}

type ServerCommon struct {
	Protocol  string `form:"protocol"`
	ServerId  int64  `form:"server_id"`
	SecretKey string `form:"secret_key"`
}

type ServerGroup struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
}

type ServerOnlineIP struct {
	IP       string `json:"ip"`
	Protocol string `json:"protocol"`
}

type ServerOnlineUser struct {
	IP          []ServerOnlineIP `json:"ip"`
	UserId      int64            `json:"user_id"`
	Subscribe   string           `json:"subscribe"`
	SubscribeId int64            `json:"subscribe_id"`
	Traffic     int64            `json:"traffic"`
	ExpiredAt   int64            `json:"expired_at"`
}

type ServerPushStatusRequest struct {
	ServerCommon
	Cpu       float64 `json:"cpu"`
	Mem       float64 `json:"mem"`
	Disk      float64 `json:"disk"`
	UpdatedAt int64   `json:"updated_at"`
}

type ServerPushUserTrafficRequest struct {
	ServerCommon
	Traffic []UserTraffic `json:"traffic"`
}

type ServerRuleGroup struct {
	Id        int64    `json:"id"`
	Icon      string   `json:"icon"`
	Name      string   `json:"name" validate:"required"`
	Type      string   `json:"type"`
	Tags      []string `json:"tags"`
	Rules     string   `json:"rules"`
	Enable    bool     `json:"enable"`
	Default   bool     `json:"default"`
	CreatedAt int64    `json:"created_at"`
	UpdatedAt int64    `json:"updated_at"`
}

type ServerStatus struct {
	Cpu      float64            `json:"cpu"`
	Mem      float64            `json:"mem"`
	Disk     float64            `json:"disk"`
	Protocol string             `json:"protocol"`
	Online   []ServerOnlineUser `json:"online"`
	Status   string             `json:"status"`
}

type ServerTotalDataResponse struct {
	OnlineUsers                   int64               `json:"online_users"`
	OnlineServers                 int64               `json:"online_servers"`
	OfflineServers                int64               `json:"offline_servers"`
	TodayUpload                   int64               `json:"today_upload"`
	TodayDownload                 int64               `json:"today_download"`
	MonthlyUpload                 int64               `json:"monthly_upload"`
	MonthlyDownload               int64               `json:"monthly_download"`
	UpdatedAt                     int64               `json:"updated_at"`
	ServerTrafficRankingToday     []ServerTrafficData `json:"server_traffic_ranking_today"`
	ServerTrafficRankingYesterday []ServerTrafficData `json:"server_traffic_ranking_yesterday"`
	UserTrafficRankingToday       []UserTrafficData   `json:"user_traffic_ranking_today"`
	UserTrafficRankingYesterday   []UserTrafficData   `json:"user_traffic_ranking_yesterday"`
}

type ServerTrafficData struct {
	ServerId int64  `json:"server_id"`
	Name     string `json:"name"`
	Upload   int64  `json:"upload"`
	Download int64  `json:"download"`
}

type ServerTrafficLog struct {
	ServerId int64  `json:"server_id"` // Server ID
	Upload   int64  `json:"upload"`    // Upload traffic in bytes
	Download int64  `json:"download"`  // Download traffic in bytes
	Total    int64  `json:"total"`     // Total traffic in bytes (Upload + Download)
	Date     string `json:"date"`      // Date in YYYY-MM-DD format
	Details  bool   `json:"details"`   // Whether to show detailed traffic
}

type ServerUser struct {
	Id          int64  `json:"id"`
	UUID        string `json:"uuid"`
	SpeedLimit  int64  `json:"speed_limit"`
	DeviceLimit int64  `json:"device_limit"`
}

type SetNodeMultiplierRequest struct {
	Periods []TimePeriod `json:"periods"`
}

type Shadowsocks struct {
	Method    string `json:"method" validate:"required"`
	Port      int    `json:"port" validate:"required"`
	ServerKey string `json:"server_key"`
}

type ShadowsocksProtocol struct {
	Port   int    `json:"port"`
	Method string `json:"method"`
}

type SignatureConfig struct {
	EnableSignature bool `json:"enable_signature"`
}

type SiteConfig struct {
	Host       string `json:"host"`
	SiteName   string `json:"site_name"`
	SiteDesc   string `json:"site_desc"`
	SiteLogo   string `json:"site_logo"`
	Keywords   string `json:"keywords"`
	CustomHTML string `json:"custom_html"`
	CustomData string `json:"custom_data"`
}

type SiteCustomDataContacts struct {
	Email     string `json:"email"`
	Telephone string `json:"telephone"`
	Address   string `json:"address"`
}

type SliderVerifyCaptchaRequest struct {
	Id    string `json:"id" validate:"required"`
	X     int    `json:"x" validate:"required"`
	Y     int    `json:"y" validate:"required"`
	Trail string `json:"trail"`
}

type SliderVerifyCaptchaResponse struct {
	Token string `json:"token"`
}

type SortItem struct {
	Id   int64 `json:"id" validate:"required"`
	Sort int64 `json:"sort" validate:"required"`
}

type StopBatchSendEmailTaskRequest struct {
	Id int64 `json:"id"`
}

type StripePayment struct {
	Method         string `json:"method"`
	ClientSecret   string `json:"client_secret"`
	PublishableKey string `json:"publishable_key"`
}

type Subscribe struct {
	Id                int64               `json:"id"`
	Name              string              `json:"name"`
	Language          string              `json:"language"`
	Description       string              `json:"description"`
	UnitPrice         int64               `json:"unit_price"`
	UnitTime          string              `json:"unit_time"`
	Discount          []SubscribeDiscount `json:"discount"`
	NodeCount         int64               `json:"node_count"`
	Replacement       int64               `json:"replacement"`
	Inventory         int64               `json:"inventory"`
	Traffic           int64               `json:"traffic"`
	SpeedLimit        int64               `json:"speed_limit"`
	DeviceLimit       int64               `json:"device_limit"`
	Quota             int64               `json:"quota"`
	NewUserOnly       bool                `json:"new_user_only"`
	Nodes             []int64             `json:"nodes"`
	NodeTags          []string            `json:"node_tags"`
	NodeGroupIds      []int64             `json:"node_group_ids,omitempty"`
	NodeGroupId       int64               `json:"node_group_id"`
	TrafficLimit      []TrafficLimit      `json:"traffic_limit"`
	Show              bool                `json:"show"`
	Sell              bool                `json:"sell"`
	Sort              int64               `json:"sort"`
	DeductionRatio    int64               `json:"deduction_ratio"`
	AllowDeduction    bool                `json:"allow_deduction"`
	ResetCycle        int64               `json:"reset_cycle"`
	RenewalReset      bool                `json:"renewal_reset"`
	ShowOriginalPrice bool                `json:"show_original_price"`
	CreatedAt         int64               `json:"created_at"`
	UpdatedAt         int64               `json:"updated_at"`
}

type SubscribeApplication struct {
	Id                int64        `json:"id"`
	Name              string       `json:"name"`
	Description       string       `json:"description,omitempty"`
	Icon              string       `json:"icon,omitempty"`
	Scheme            string       `json:"scheme,omitempty"`
	UserAgent         string       `json:"user_agent"`
	IsDefault         bool         `json:"is_default"`
	SubscribeTemplate string       `json:"template"`
	OutputFormat      string       `json:"output_format"`
	DownloadLink      DownloadLink `json:"download_link,omitempty"`
	CreatedAt         int64        `json:"created_at"`
	UpdatedAt         int64        `json:"updated_at"`
}

type SubscribeClient struct {
	Id           int64        `json:"id"`
	Name         string       `json:"name"`
	Description  string       `json:"description,omitempty"`
	Icon         string       `json:"icon,omitempty"`
	Scheme       string       `json:"scheme,omitempty"`
	IsDefault    bool         `json:"is_default"`
	DownloadLink DownloadLink `json:"download_link,omitempty"`
}

type SubscribeConfig struct {
	SingleModel     bool   `json:"single_model"`
	SubscribePath   string `json:"subscribe_path"`
	SubscribeDomain string `json:"subscribe_domain"`
	PanDomain       bool   `json:"pan_domain"`
	UserAgentLimit  bool   `json:"user_agent_limit"`
	UserAgentList   string `json:"user_agent_list"`
}

type SubscribeDiscount struct {
	Quantity    int64   `json:"quantity"`
	Discount    float64 `json:"discount"`
	NewUserOnly bool    `json:"new_user_only"`
	MapApple    string  `json:"map_apple"`
}

type SubscribeGroup struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
}

type SubscribeGroupMappingItem struct {
	SubscribeName string `json:"subscribe_name"`
	NodeGroupName string `json:"node_group_name"`
}

type SubscribeItem struct {
	Subscribe
	Sold int64 `json:"sold"`
}

type SubscribeLog struct {
	UserId          int64  `json:"user_id"`
	Token           string `json:"token"`
	UserAgent       string `json:"user_agent"`
	ClientIP        string `json:"client_ip"`
	UserSubscribeId int64  `json:"user_subscribe_id"`
	Timestamp       int64  `json:"timestamp"`
}

type SubscribeSortRequest struct {
	Sort []SortItem `json:"sort"`
}

type SubscribeType struct {
	SubscribeTypes []string `json:"subscribe_types"`
}

type TelegramConfig struct {
	TelegramBotToken      string `json:"telegram_bot_token"`
	TelegramGroupUrl      string `json:"telegram_group_url"`
	TelegramNotify        bool   `json:"telegram_notify"`
	TelegramWebHookDomain string `json:"telegram_web_hook_domain"`
}

type TelephoneCheckUserRequest struct {
	Telephone         string `form:"telephone" validate:"required"`
	TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
}

type TelephoneCheckUserResponse struct {
	Exist bool `json:"exist"`
}

type TelephoneLoginRequest struct {
	Identifier        string `json:"identifier"`
	Telephone         string `json:"telephone" validate:"required"`
	TelephoneCode     string `json:"telephone_code"`
	TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
	Password          string `json:"password"`
	IP                string `header:"X-Original-Forwarded-For"`
	UserAgent         string `header:"User-Agent"`
	LoginType         string `header:"Login-Type"`
	CfToken           string `json:"cf_token,optional"`
	CaptchaId         string `json:"captcha_id,optional"`
	CaptchaCode       string `json:"captcha_code,optional"`
	SliderToken       string `json:"slider_token,optional"`
}

type TelephoneRegisterRequest struct {
	Identifier        string `json:"identifier"`
	Telephone         string `json:"telephone" validate:"required"`
	TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
	Password          string `json:"password" validate:"required"`
	Invite            string `json:"invite,optional"`
	Code              string `json:"code,optional"`
	IP                string `header:"X-Original-Forwarded-For"`
	UserAgent         string `header:"User-Agent"`
	LoginType         string `header:"Login-Type,optional"`
	CfToken           string `json:"cf_token,optional"`
	CaptchaId         string `json:"captcha_id,optional"`
	CaptchaCode       string `json:"captcha_code,optional"`
	SliderToken       string `json:"slider_token,optional"`
}

type TelephoneResetPasswordRequest struct {
	Identifier        string `json:"identifier"`
	Telephone         string `json:"telephone" validate:"required"`
	TelephoneAreaCode string `json:"telephone_area_code" validate:"required"`
	Password          string `json:"password" validate:"required"`
	Code              string `json:"code,optional"`
	IP                string `header:"X-Original-Forwarded-For"`
	UserAgent         string `header:"User-Agent"`
	LoginType         string `header:"Login-Type,optional"`
	CfToken           string `json:"cf_token,optional"`
	CaptchaId         string `json:"captcha_id,optional"`
	CaptchaCode       string `json:"captcha_code,optional"`
	SliderToken       string `json:"slider_token,optional"`
}

type TestEmailSendRequest struct {
	Email string `json:"email" validate:"required"`
}

type TestSmsSendRequest struct {
	AreaCode  string `json:"area_code" validate:"required"`
	Telephone string `json:"telephone" validate:"required"`
}

type Ticket struct {
	Id          int64    `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	UserId      int64    `json:"user_id"`
	Follows     []Follow `json:"follow,omitempty"`
	Status      uint8    `json:"status"`
	CreatedAt   int64    `json:"created_at"`
	UpdatedAt   int64    `json:"updated_at"`
}

type TicketWaitRelpyResponse struct {
	Count int64 `json:"count"`
}

type TimePeriod struct {
	StartTime  string  `json:"start_time"`
	EndTime    string  `json:"end_time"`
	Multiplier float32 `json:"multiplier"`
}

type ToggleNodeStatusRequest struct {
	Id     int64 `json:"id"`
	Enable *bool `json:"enable"`
}

type ToggleRedemptionCodeStatusRequest struct {
	Id     int64 `json:"id" validate:"required"`
	Status int64 `json:"status" validate:"oneof=0 1"`
}

type ToggleUserSubscribeStatusRequest struct {
	UserSubscribeId int64 `json:"user_subscribe_id"`
}

type TosConfig struct {
	TosContent string `json:"tos_content"`
}

type TrafficLimit struct {
	StatType     string `json:"stat_type"`
	StatValue    int64  `json:"stat_value"`
	TrafficUsage int64  `json:"traffic_usage"`
	SpeedLimit   int64  `json:"speed_limit"`
}

type TrafficLog struct {
	Id          int64 `json:"id"`
	ServerId    int64 `json:"server_id"`
	UserId      int64 `json:"user_id"`
	SubscribeId int64 `json:"subscribe_id"`
	Download    int64 `json:"download"`
	Upload      int64 `json:"upload"`
	Timestamp   int64 `json:"timestamp"`
}

type TrafficLogDetails struct {
	Id          int64 `json:"id"`
	ServerId    int64 `json:"server_id"`
	UserId      int64 `json:"user_id"`
	SubscribeId int64 `json:"subscribe_id"`
	Download    int64 `json:"download"`
	Upload      int64 `json:"upload"`
	Timestamp   int64 `json:"timestamp"`
}

type TransportConfig struct {
	Path        string `json:"path"`
	Host        string `json:"host"`
	ServiceName string `json:"service_name"`
}

type Trojan struct {
	Port            int             `json:"port" validate:"required"`
	Transport       string          `json:"transport" validate:"required"`
	TransportConfig TransportConfig `json:"transport_config"`
	Security        string          `json:"security" validate:"required"`
	SecurityConfig  SecurityConfig  `json:"security_config"`
}

type TrojanProtocol struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	EnableTLS *bool  `json:"enable_tls"`
	TLSConfig string `json:"tls_config"`
	Network   string `json:"network"`
	Transport string `json:"transport"`
}

type Tuic struct {
	Port                 int            `json:"port" validate:"required"`
	DisableSNI           bool           `json:"disable_sni"`
	ReduceRtt            bool           `json:"reduce_rtt"`
	UDPRelayMode         string         `json:"udp_relay_mode"`
	CongestionController string         `json:"congestion_controller"`
	SecurityConfig       SecurityConfig `json:"security_config"`
}

type UnbindDeviceRequest struct {
	Id int64 `json:"id" validate:"required"`
}

type UnbindOAuthRequest struct {
	Method string `json:"method"`
}

type UnsubscribeRequest struct {
	Id int64 `json:"id"`
}

type UpdateAdsRequest struct {
	Id          int64  `json:"id"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	Content     string `json:"content"`
	Description string `json:"description"`
	TargetURL   string `json:"target_url"`
	StartTime   int64  `json:"start_time"`
	EndTime     int64  `json:"end_time"`
	Status      int    `json:"status"`
}

type UpdateAnnouncementEnableRequest struct {
	Id     int64 `json:"id" validate:"required"`
	Enable *bool `json:"enable" validate:"required"`
}

type UpdateAnnouncementRequest struct {
	Id      int64  `json:"id" validate:"required"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Show    *bool  `json:"show"`
	Pinned  *bool  `json:"pinned"`
	Popup   *bool  `json:"popup"`
}

type UpdateAuthMethodConfigRequest struct {
	Id      int64       `json:"id"`
	Method  string      `json:"method"`
	Config  interface{} `json:"config"`
	Enabled *bool       `json:"enabled"`
}

type UpdateBindEmailRequest struct {
	Email string `json:"email" validate:"required"`
}

type UpdateBindMobileRequest struct {
	AreaCode string `json:"area_code" validate:"required"`
	Mobile   string `json:"mobile" validate:"required"`
	Code     string `json:"code" validate:"required"`
}

type UpdateCouponRequest struct {
	Id         int64   `json:"id" validate:"required"`
	Name       string  `json:"name" validate:"required"`
	Code       string  `json:"code,omitempty"`
	Count      int64   `json:"count,omitempty"`
	Type       uint8   `json:"type" validate:"required"`
	Discount   int64   `json:"discount" validate:"required"`
	StartTime  int64   `json:"start_time" validate:"required"`
	ExpireTime int64   `json:"expire_time" validate:"required"`
	UserLimit  int64   `json:"user_limit,omitempty"`
	Subscribe  []int64 `json:"subscribe,omitempty"`
	UsedCount  int64   `json:"used_count,omitempty"`
	Enable     *bool   `json:"enable,omitempty"`
}

type UpdateDocumentRequest struct {
	Id      int64    `json:"id" validate:"required"`
	Title   string   `json:"title" validate:"required"`
	Content string   `json:"content" validate:"required"`
	Tags    []string `json:"tags,omitempty" `
	Show    *bool    `json:"show"`
}

type UpdateFamilyMaxMembersRequest struct {
	FamilyId   int64 `json:"family_id" validate:"required,gt=0"`
	MaxMembers int64 `json:"max_members" validate:"required,gt=0"`
}

type UpdateGroupConfigRequest struct {
	Enabled bool                   `json:"enabled"`
	Mode    string                 `json:"mode"`
	Config  map[string]interface{} `json:"config"`
}

type UpdateNodeGroupRequest struct {
	Id                  int64  `json:"id" validate:"required"`
	Name                string `json:"name"`
	Description         string `json:"description"`
	Sort                int    `json:"sort"`
	ForCalculation      *bool  `json:"for_calculation"`
	IsExpiredGroup      *bool  `json:"is_expired_group"`
	ExpiredDaysLimit    *int   `json:"expired_days_limit"`
	MaxTrafficGBExpired *int64 `json:"max_traffic_gb_expired,omitempty"`
	SpeedLimit          *int   `json:"speed_limit"`
	MinTrafficGB        *int64 `json:"min_traffic_gb,omitempty"`
	MaxTrafficGB        *int64 `json:"max_traffic_gb,omitempty"`
}

type UpdateNodeRequest struct {
	Id           int64    `json:"id"`
	Name         string   `json:"name"`
	Tags         []string `json:"tags,omitempty"`
	Port         uint16   `json:"port"`
	Address      string   `json:"address"`
	ServerId     int64    `json:"server_id"`
	Protocol     string   `json:"protocol"`
	Enabled      *bool    `json:"enabled"`
	NodeGroupIds []int64  `json:"node_group_ids,omitempty"`
}

type UpdateOrderStatusRequest struct {
	Id        int64  `json:"id" validate:"required"`
	Status    uint8  `json:"status" validate:"required"`
	PaymentId int64  `json:"payment_id,omitempty"`
	TradeNo   string `json:"trade_no,omitempty"`
}

type UpdatePaymentMethodRequest struct {
	Id          int64       `json:"id" validate:"required"`
	Name        string      `json:"name" validate:"required"`
	Platform    string      `json:"platform" validate:"required"`
	Description string      `json:"description"`
	Icon        string      `json:"icon,omitempty"`
	Domain      string      `json:"domain,omitempty"`
	Config      interface{} `json:"config" validate:"required"`
	FeeMode     uint        `json:"fee_mode"`
	FeePercent  int64       `json:"fee_percent,omitempty"`
	FeeAmount   int64       `json:"fee_amount,omitempty"`
	Enable      *bool       `json:"enable" validate:"required"`
}

type UpdateRedemptionCodeRequest struct {
	Id            int64  `json:"id" validate:"required"`
	TotalCount    int64  `json:"total_count,omitempty"`
	SubscribePlan int64  `json:"subscribe_plan,omitempty"`
	UnitTime      string `json:"unit_time,omitempty" validate:"omitempty,oneof=day month quarter half_year year"`
	Quantity      int64  `json:"quantity,omitempty"`
	Status        int64  `json:"status,omitempty" validate:"omitempty,oneof=0 1"`
}

type UpdateServerRequest struct {
	Id        int64      `json:"id"`
	Name      string     `json:"name"`
	Country   string     `json:"country,omitempty"`
	City      string     `json:"city,omitempty"`
	Address   string     `json:"address"`
	Sort      int        `json:"sort,omitempty"`
	Protocols []Protocol `json:"protocols"`
}

type UpdateSubscribeApplicationRequest struct {
	Id                int64        `json:"id"`
	Name              string       `json:"name"`
	Description       string       `json:"description,omitempty"`
	Icon              string       `json:"icon,omitempty"`
	Scheme            string       `json:"scheme,omitempty"`
	UserAgent         string       `json:"user_agent"`
	IsDefault         bool         `json:"is_default"`
	SubscribeTemplate string       `json:"template"`
	OutputFormat      string       `json:"output_format"`
	DownloadLink      DownloadLink `json:"download_link,omitempty"`
}

type UpdateSubscribeGroupRequest struct {
	Id          int64  `json:"id" validate:"required"`
	Name        string `json:"name" validate:"required"`
	Description string `json:"description"`
}

type UpdateSubscribeRequest struct {
	Id                int64               `json:"id" validate:"required"`
	Name              string              `json:"name" validate:"required"`
	Language          string              `json:"language"`
	Description       string              `json:"description"`
	UnitPrice         int64               `json:"unit_price"`
	UnitTime          string              `json:"unit_time"`
	Discount          []SubscribeDiscount `json:"discount"`
	Replacement       int64               `json:"replacement"`
	Inventory         int64               `json:"inventory"`
	Traffic           int64               `json:"traffic"`
	SpeedLimit        int64               `json:"speed_limit"`
	DeviceLimit       int64               `json:"device_limit"`
	Quota             int64               `json:"quota"`
	NewUserOnly       *bool               `json:"new_user_only"`
	Nodes             []int64             `json:"nodes"`
	NodeTags          []string            `json:"node_tags"`
	NodeGroupIds      []int64             `json:"node_group_ids,omitempty"`
	NodeGroupId       int64               `json:"node_group_id"`
	TrafficLimit      []TrafficLimit      `json:"traffic_limit"`
	Show              *bool               `json:"show"`
	Sell              *bool               `json:"sell"`
	Sort              int64               `json:"sort"`
	DeductionRatio    int64               `json:"deduction_ratio"`
	AllowDeduction    *bool               `json:"allow_deduction"`
	ResetCycle        int64               `json:"reset_cycle"`
	RenewalReset      *bool               `json:"renewal_reset"`
	ShowOriginalPrice bool                `json:"show_original_price"`
}

type UpdateTicketStatusRequest struct {
	Id     int64  `json:"id" validate:"required"`
	Status *uint8 `json:"status" validate:"required"`
}

type UpdateUserAuthMethodRequest struct {
	UserId         int64  `json:"user_id"`
	AuthType       string `json:"auth_type"`
	AuthIdentifier string `json:"auth_identifier"`
}

type UpdateUserBasiceInfoRequest struct {
	UserId             int64  `json:"user_id" validate:"required"`
	Password           string `json:"password"`
	Avatar             string `json:"avatar"`
	Balance            int64  `json:"balance"`
	Commission         int64  `json:"commission"`
	ReferralPercentage uint8  `json:"referral_percentage"`
	OnlyFirstPurchase  *bool  `json:"only_first_purchase"`
	GiftAmount         int64  `json:"gift_amount"`
	Telegram           int64  `json:"telegram"`
	ReferCode          string `json:"refer_code"`
	RefererId          int64  `json:"referer_id"`
	Enable             *bool  `json:"enable"`
	IsAdmin            *bool  `json:"is_admin"`
	Remark             string `json:"remark"`
}

type UpdateUserNotifyRequest struct {
	EnableBalanceNotify   *bool `json:"enable_balance_notify"`
	EnableLoginNotify     *bool `json:"enable_login_notify"`
	EnableSubscribeNotify *bool `json:"enable_subscribe_notify"`
	EnableTradeNotify     *bool `json:"enable_trade_notify"`
}

type UpdateUserNotifySettingRequest struct {
	UserId                int64 `json:"user_id" validate:"required"`
	EnableBalanceNotify   bool  `json:"enable_balance_notify"`
	EnableLoginNotify     bool  `json:"enable_login_notify"`
	EnableSubscribeNotify bool  `json:"enable_subscribe_notify"`
	EnableTradeNotify     bool  `json:"enable_trade_notify"`
}

type UpdateUserPasswordRequest struct {
	Password string `json:"password" validate:"required"`
}

type UpdateUserRulesRequest struct {
	Rules []string `json:"rules" validate:"required"`
}

type UpdateUserSubscribeNoteRequest struct {
	UserSubscribeId int64  `json:"user_subscribe_id" validate:"required"`
	Note            string `json:"note" validate:"max=500"`
}

type UpdateUserSubscribeRequest struct {
	UserSubscribeId int64 `json:"user_subscribe_id"`
	SubscribeId     int64 `json:"subscribe_id"`
	Traffic         int64 `json:"traffic"`
	ExpiredAt       int64 `json:"expired_at"`
	Upload          int64 `json:"upload"`
	Download        int64 `json:"download"`
}

type UpdateUserTicketStatusRequest struct {
	Id     int64  `json:"id" validate:"required"`
	Status *uint8 `json:"status" validate:"required"`
}

type User struct {
	Id                    int64            `json:"id"`
	Avatar                string           `json:"avatar"`
	Balance               int64            `json:"balance"`
	Commission            int64            `json:"commission"`
	ReferralPercentage    uint8            `json:"referral_percentage"`
	OnlyFirstPurchase     bool             `json:"only_first_purchase"`
	GiftAmount            int64            `json:"gift_amount"`
	Telegram              int64            `json:"telegram"`
	ReferCode             string           `json:"refer_code"`
	RefererId             int64            `json:"referer_id"`
	ShareLink             string           `json:"share_link,omitempty"`
	Enable                bool             `json:"enable"`
	IsAdmin               bool             `json:"is_admin,omitempty"`
	EnableBalanceNotify   bool             `json:"enable_balance_notify"`
	EnableLoginNotify     bool             `json:"enable_login_notify"`
	EnableSubscribeNotify bool             `json:"enable_subscribe_notify"`
	EnableTradeNotify     bool             `json:"enable_trade_notify"`
	UseStatus             bool             `json:"use_status"`
	AuthMethods           []UserAuthMethod `json:"auth_methods"`
	UserDevices           []UserDevice     `json:"user_devices"`
	Rules                 []string         `json:"rules"`
	LastLoginTime         int64            `json:"last_login_time,omitempty"`
	MemberStatus          string           `json:"member_status,omitempty"`
	CreatedAt             int64            `json:"created_at"`
	UpdatedAt             int64            `json:"updated_at"`
	DeletedAt             int64            `json:"deleted_at,omitempty"`
	IsDel                 bool             `json:"is_del,omitempty"`
	Remark                string           `json:"remark,omitempty"`
	PurchasedPackage      string           `json:"purchased_package,omitempty"`
	FamilyJoined          bool             `json:"family_joined,omitempty"`
	FamilyId              int64            `json:"family_id,omitempty"`
	FamilyRole            uint8            `json:"family_role,omitempty"`
	FamilyRoleName        string           `json:"family_role_name,omitempty"`
	FamilyOwnerUserId     int64            `json:"family_owner_user_id,omitempty"`
	FamilyStatus          string           `json:"family_status,omitempty"`
	FamilyMemberCount     int64            `json:"family_member_count,omitempty"`
	FamilyMaxMembers      int64            `json:"family_max_members,omitempty"`
}

type UserAffiliate struct {
	Avatar       string `json:"avatar"`
	Identifier   string `json:"identifier"`
	RegisteredAt int64  `json:"registered_at"`
	Enable       bool   `json:"enable"`
}

type UserAuthMethod struct {
	AuthType       string `json:"auth_type"`
	AuthIdentifier string `json:"auth_identifier"`
	Verified       bool   `json:"verified"`
}

type UserDevice struct {
	Id         int64  `json:"id"`
	Ip         string `json:"ip"`
	Identifier string `json:"identifier"`
	DeviceNo   string `json:"device_no"`
	UserAgent  string `json:"user_agent"`
	Online     bool   `json:"online"`
	Enabled    bool   `json:"enabled"`
	CreatedAt  int64  `json:"created_at"`
	UpdatedAt  int64  `json:"updated_at"`
}

type UserLoginLog struct {
	Id        int64  `json:"id"`
	UserId    int64  `json:"user_id"`
	LoginIP   string `json:"login_ip"`
	UserAgent string `json:"user_agent"`
	Success   bool   `json:"success"`
	Timestamp int64  `json:"timestamp"`
}

type UserLoginRequest struct {
	Identifier  string `json:"identifier"`
	Email       string `json:"email" validate:"required"`
	Password    string `json:"password" validate:"required"`
	IP          string `header:"X-Original-Forwarded-For"`
	UserAgent   string `header:"User-Agent"`
	LoginType   string `header:"Login-Type"`
	CfToken     string `json:"cf_token,optional"`
	CaptchaId   string `json:"captcha_id,optional"`
	CaptchaCode string `json:"captcha_code,optional"`
	SliderToken string `json:"slider_token,optional"`
}

type UserRegisterRequest struct {
	Identifier  string `json:"identifier"`
	Email       string `json:"email" validate:"required"`
	Password    string `json:"password" validate:"required"`
	Invite      string `json:"invite,optional"`
	Code        string `json:"code,optional"`
	IP          string `header:"X-Original-Forwarded-For"`
	UserAgent   string `header:"User-Agent"`
	LoginType   string `header:"Login-Type"`
	CfToken     string `json:"cf_token,optional"`
	CaptchaId   string `json:"captcha_id,optional"`
	CaptchaCode string `json:"captcha_code,optional"`
	SliderToken string `json:"slider_token,optional"`
}

type UserStatistics struct {
	Date              string           `json:"date,omitempty"`
	Register          int64            `json:"register"`
	NewOrderUsers     int64            `json:"new_order_users"`
	RenewalOrderUsers int64            `json:"renewal_order_users"`
	List              []UserStatistics `json:"list,omitempty"`
}

type UserStatisticsResponse struct {
	Today   UserStatistics `json:"today"`
	Monthly UserStatistics `json:"monthly"`
	All     UserStatistics `json:"all"`
}

type UserSubscribe struct {
	Id                     int64     `json:"id"`
	IdStr                  string    `json:"id_str"`
	UserId                 int64     `json:"user_id"`
	OrderId                int64     `json:"order_id"`
	SubscribeId            int64     `json:"subscribe_id"`
	Subscribe              Subscribe `json:"subscribe"`
	NodeGroupId            int64     `json:"node_group_id"`
	NodeGroupName          string    `json:"node_group_name"`
	StartTime              int64     `json:"start_time"`
	ExpireTime             int64     `json:"expire_time"`
	FinishedAt             int64     `json:"finished_at"`
	ResetTime              int64     `json:"reset_time"`
	Traffic                int64     `json:"traffic"`
	Download               int64     `json:"download"`
	Upload                 int64     `json:"upload"`
	Token                  string    `json:"token"`
	Status                 uint8     `json:"status"`
	EntitlementSource      string    `json:"entitlement_source"`
	EntitlementOwnerUserId int64     `json:"entitlement_owner_user_id"`
	ReadOnly               bool      `json:"read_only"`
	IsGift                 bool      `json:"is_gift"`
	Short                  string    `json:"short"`
	CreatedAt              int64     `json:"created_at"`
	UpdatedAt              int64     `json:"updated_at"`
}

type UserSubscribeDetail struct {
	Id             int64     `json:"id"`
	UserId         int64     `json:"user_id"`
	User           User      `json:"user"`
	OrderId        int64     `json:"order_id"`
	SubscribeId    int64     `json:"subscribe_id"`
	Subscribe      Subscribe `json:"subscribe"`
	NodeGroupId    int64     `json:"node_group_id"`
	NodeGroupName  string    `json:"node_group_name"`
	GroupLocked    bool      `json:"group_locked"`
	StartTime      int64     `json:"start_time"`
	ExpireTime     int64     `json:"expire_time"`
	ResetTime      int64     `json:"reset_time"`
	Traffic        int64     `json:"traffic"`
	Download       int64     `json:"download"`
	Upload         int64     `json:"upload"`
	Token          string    `json:"token"`
	Status         uint8     `json:"status"`
	EffectiveSpeed int64     `json:"effective_speed"`
	IsThrottled    bool      `json:"is_throttled"`
	ThrottleRule   string    `json:"throttle_rule,omitempty"`
	ThrottleStart  int64     `json:"throttle_start,omitempty"`
	ThrottleEnd    int64     `json:"throttle_end,omitempty"`
	CreatedAt      int64     `json:"created_at"`
	UpdatedAt      int64     `json:"updated_at"`
}

type UserSubscribeInfo struct {
	Id                     int64                    `json:"id"`
	UserId                 int64                    `json:"user_id"`
	OrderId                int64                    `json:"order_id"`
	SubscribeId            int64                    `json:"subscribe_id"`
	StartTime              int64                    `json:"start_time"`
	ExpireTime             int64                    `json:"expire_time"`
	FinishedAt             int64                    `json:"finished_at"`
	ResetTime              int64                    `json:"reset_time"`
	Traffic                int64                    `json:"traffic"`
	Download               int64                    `json:"download"`
	Upload                 int64                    `json:"upload"`
	Token                  string                   `json:"token"`
	Status                 uint8                    `json:"status"`
	EntitlementSource      string                   `json:"entitlement_source"`
	EntitlementOwnerUserId int64                    `json:"entitlement_owner_user_id"`
	ReadOnly               bool                     `json:"read_only"`
	CreatedAt              int64                    `json:"created_at"`
	UpdatedAt              int64                    `json:"updated_at"`
	IsTryOut               bool                     `json:"is_try_out"`
	Nodes                  []*UserSubscribeNodeInfo `json:"nodes"`
}

type UserSubscribeLog struct {
	Id              int64  `json:"id"`
	UserId          int64  `json:"user_id"`
	UserSubscribeId int64  `json:"user_subscribe_id"`
	Token           string `json:"token"`
	IP              string `json:"ip"`
	UserAgent       string `json:"user_agent"`
	Timestamp       int64  `json:"timestamp"`
}

type UserSubscribeNodeInfo struct {
	Id              int64    `json:"id"`
	Name            string   `json:"name"`
	Uuid            string   `json:"uuid"`
	Protocol        string   `json:"protocol"`
	Protocols       string   `json:"protocols"`
	Port            uint16   `json:"port"`
	Address         string   `json:"address"`
	Tags            []string `json:"tags"`
	Country         string   `json:"country"`
	City            string   `json:"city"`
	Longitude       string   `json:"longitude"`
	Latitude        string   `json:"latitude"`
	LatitudeCenter  string   `json:"latitude_center"`
	LongitudeCenter string   `json:"longitude_center"`
	CreatedAt       int64    `json:"created_at"`
}

type UserSubscribeTrafficLog struct {
	SubscribeId int64  `json:"subscribe_id"` // Subscribe ID
	UserId      int64  `json:"user_id"`      // User ID
	Upload      int64  `json:"upload"`       // Upload traffic in bytes
	Download    int64  `json:"download"`     // Download traffic in bytes
	Total       int64  `json:"total"`        // Total traffic in bytes (Upload + Download)
	Date        string `json:"date"`         // Date in YYYY-MM-DD format
	Details     bool   `json:"details"`      // Whether to show detailed traffic
}

type UserTraffic struct {
	SID      int64 `json:"uid"`
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
}

type UserTrafficData struct {
	SID      int64 `json:"sid"`
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
}

type VeifyConfig struct {
	CaptchaType                    string `json:"captcha_type"`
	TurnstileSiteKey               string `json:"turnstile_site_key"`
	EnableUserLoginCaptcha         bool   `json:"enable_user_login_captcha"`
	EnableUserRegisterCaptcha      bool   `json:"enable_user_register_captcha"`
	EnableAdminLoginCaptcha        bool   `json:"enable_admin_login_captcha"`
	EnableUserResetPasswordCaptcha bool   `json:"enable_user_reset_password_captcha"`
}

type VerifyCodeConfig struct {
	VerifyCodeExpireTime int64 `json:"verify_code_expire_time"`
	VerifyCodeLimit      int64 `json:"verify_code_limit"`
	VerifyCodeInterval   int64 `json:"verify_code_interval"`
}

type VerifyConfig struct {
	CaptchaType                    string `json:"captcha_type"` // local or turnstile
	TurnstileSiteKey               string `json:"turnstile_site_key"`
	TurnstileSecret                string `json:"turnstile_secret"`
	EnableUserLoginCaptcha         bool   `json:"enable_user_login_captcha"`          // User login captcha
	EnableUserRegisterCaptcha      bool   `json:"enable_user_register_captcha"`       // User register captcha
	EnableAdminLoginCaptcha        bool   `json:"enable_admin_login_captcha"`         // Admin login captcha
	EnableUserResetPasswordCaptcha bool   `json:"enable_user_reset_password_captcha"` // User reset password captcha
}

type VerifyEmailRequest struct {
	Email string `json:"email" validate:"required"`
	Code  string `json:"code" validate:"required"`
}

type VersionResponse struct {
	Version string `json:"version"`
}

type Vless struct {
	Port            int             `json:"port" validate:"required"`
	Flow            string          `json:"flow" validate:"required"`
	Transport       string          `json:"transport" validate:"required"`
	TransportConfig TransportConfig `json:"transport_config"`
	Security        string          `json:"security" validate:"required"`
	SecurityConfig  SecurityConfig  `json:"security_config"`
}

type VlessProtocol struct {
	Host           string `json:"host"`
	Port           int    `json:"port"`
	Network        string `json:"network"`
	Transport      string `json:"transport"`
	Security       string `json:"security"`
	SecurityConfig string `json:"security_config"`
	XTLS           string `json:"xtls"`
}

type Vmess struct {
	Port            int             `json:"port" validate:"required"`
	Transport       string          `json:"transport" validate:"required"`
	TransportConfig TransportConfig `json:"transport_config"`
	Security        string          `json:"security" validate:"required"`
	SecurityConfig  SecurityConfig  `json:"security_config"`
}

type VmessProtocol struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	EnableTLS *bool  `json:"enable_tls"`
	TLSConfig string `json:"tls_config"`
	Network   string `json:"network"`
	Transport string `json:"transport"`
}

type WeeklyStat struct {
	Day     int     `json:"day"`
	DayName string  `json:"day_name"`
	Hours   float64 `json:"hours"`
}

type WithdrawalLog struct {
	Id        int64  `json:"id"`
	UserId    int64  `json:"user_id"`
	Amount    int64  `json:"amount"`
	Content   string `json:"content"`
	Status    uint8  `json:"status"`
	Reason    string `json:"reason,omitempty"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type GetAdminUserInviteStatsRequest struct {
	UserId int64 `form:"user_id" validate:"required"`
}

type GetAdminUserInviteStatsResponse struct {
	InviteCount        int64 `json:"invite_count"`
	TotalCommission    int64 `json:"total_commission"`
	CurrentCommission  int64 `json:"current_commission"`
	ReferralPercentage uint8 `json:"referral_percentage"`
	OnlyFirstPurchase  bool  `json:"only_first_purchase"`
}

type GetAdminUserInviteListRequest struct {
	UserId int64 `form:"user_id" validate:"required"`
	Page   int   `form:"page"`
	Size   int   `form:"size"`
}

type AdminInvitedUser struct {
	Id         int64  `json:"id"`
	Avatar     string `json:"avatar"`
	Identifier string `json:"identifier"`
	Enable     bool   `json:"enable"`
	CreatedAt  int64  `json:"created_at"`
}

type GetAdminUserInviteListResponse struct {
	Total int64              `json:"total"`
	List  []AdminInvitedUser `json:"list"`
}

type GetLogMessageRawRequest struct {
	Id int64 `form:"id" validate:"required"`
}

type GetLogMessageRawResponse struct {
	Id         int64           `json:"id"`
	Platform   string          `json:"platform"`
	AppVersion string          `json:"app_version"`
	OsName     string          `json:"os_name"`
	OsVersion  string          `json:"os_version"`
	DeviceId   string          `json:"device_id"`
	UserId     *int64          `json:"user_id"`
	SessionId  string          `json:"session_id"`
	Level      uint8           `json:"level"`
	ErrorCode  string          `json:"error_code"`
	Message    string          `json:"message"`
	Stack      string          `json:"stack"`
	Context    json.RawMessage `json:"context"`
	ClientIP   string          `json:"client_ip"`
	UserAgent  string          `json:"user_agent"`
	Locale     string          `json:"locale"`
	Digest     string          `json:"digest"`
	OccurredAt int64           `json:"occurred_at"`
	CreatedAt  int64           `json:"created_at"`
}
