新增客户端资产、钱包、订单、实名、设备管理等核心业务 Handler 与 DTO: - 客户端资产信息查询、套餐列表、套餐历史、资产刷新 - 客户端钱包详情、流水、充值校验、充值订单、充值记录 - 客户端订单创建、列表、详情 - 客户端实名认证链接获取 - 客户端设备卡列表、重启、恢复出厂、WiFi配置、切卡 - 客户端订单服务(含微信/支付宝支付流程) - 强充自动代购异步任务处理 - 数据库迁移 000084:充值记录增加自动代购状态字段
139 lines
7.8 KiB
Go
139 lines
7.8 KiB
Go
package dto
|
||
|
||
// ========================================
|
||
// C1 钱包详情
|
||
// ========================================
|
||
|
||
// WalletDetailRequest C1 钱包详情请求
|
||
type WalletDetailRequest struct {
|
||
Identifier string `json:"identifier" query:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符(SN/IMEI/虚拟号/ICCID/MSISDN)"`
|
||
}
|
||
|
||
// WalletDetailResponse C1 钱包详情响应
|
||
type WalletDetailResponse struct {
|
||
WalletID uint `json:"wallet_id" description:"钱包ID"`
|
||
ResourceType string `json:"resource_type" description:"资源类型 (iot_card:物联网卡, device:设备)"`
|
||
ResourceID uint `json:"resource_id" description:"资源ID"`
|
||
Balance int64 `json:"balance" description:"可用余额(分)"`
|
||
FrozenBalance int64 `json:"frozen_balance" description:"冻结余额(分)"`
|
||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||
}
|
||
|
||
// ========================================
|
||
// C2 钱包流水列表
|
||
// ========================================
|
||
|
||
// WalletTransactionListRequest C2 钱包流水列表请求
|
||
type WalletTransactionListRequest struct {
|
||
Identifier string `json:"identifier" query:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符(SN/IMEI/虚拟号/ICCID/MSISDN)"`
|
||
TransactionType string `json:"transaction_type" query:"transaction_type" validate:"omitempty,max=50" maxLength:"50" description:"流水类型"`
|
||
StartTime string `json:"start_time" query:"start_time" validate:"omitempty,max=32" maxLength:"32" description:"开始时间"`
|
||
EndTime string `json:"end_time" query:"end_time" validate:"omitempty,max=32" maxLength:"32" description:"结束时间"`
|
||
Page int `json:"page" query:"page" validate:"required,min=1" required:"true" minimum:"1" description:"页码"`
|
||
PageSize int `json:"page_size" query:"page_size" validate:"required,min=1,max=100" required:"true" minimum:"1" maximum:"100" description:"每页数量"`
|
||
}
|
||
|
||
// WalletTransactionItem C2 钱包流水项
|
||
type WalletTransactionItem struct {
|
||
TransactionID uint `json:"transaction_id" description:"流水ID"`
|
||
Type string `json:"type" description:"流水类型"`
|
||
Amount int64 `json:"amount" description:"变动金额(分)"`
|
||
BalanceAfter int64 `json:"balance_after" description:"变动后余额(分)"`
|
||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||
Remark string `json:"remark" description:"备注"`
|
||
}
|
||
|
||
// WalletTransactionListResponse C2 钱包流水列表响应
|
||
type WalletTransactionListResponse struct {
|
||
List []WalletTransactionItem `json:"list" description:"流水列表"`
|
||
Total int64 `json:"total" description:"总数"`
|
||
Page int `json:"page" description:"页码"`
|
||
PageSize int `json:"page_size" description:"每页数量"`
|
||
}
|
||
|
||
// ========================================
|
||
// C3 充值前校验
|
||
// ========================================
|
||
|
||
// ClientRechargeCheckRequest C3 充值前校验请求
|
||
type ClientRechargeCheckRequest struct {
|
||
Identifier string `json:"identifier" query:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符(SN/IMEI/虚拟号/ICCID/MSISDN)"`
|
||
}
|
||
|
||
// ClientRechargeCheckResponse C3 充值前校验响应
|
||
type ClientRechargeCheckResponse struct {
|
||
NeedForceRecharge bool `json:"need_force_recharge" description:"是否需要强制充值"`
|
||
ForceRechargeAmount int64 `json:"force_recharge_amount" description:"强制充值金额(分)"`
|
||
TriggerType string `json:"trigger_type" description:"触发类型"`
|
||
MinAmount int64 `json:"min_amount" description:"最小充值金额(分)"`
|
||
MaxAmount int64 `json:"max_amount" description:"最大充值金额(分)"`
|
||
Message string `json:"message" description:"提示信息"`
|
||
}
|
||
|
||
// ========================================
|
||
// C4 创建充值订单
|
||
// ========================================
|
||
|
||
// ClientCreateRechargeRequest C4 创建充值订单请求
|
||
type ClientCreateRechargeRequest struct {
|
||
Identifier string `json:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符(SN/IMEI/虚拟号/ICCID/MSISDN)"`
|
||
Amount int64 `json:"amount" validate:"required,min=100,max=10000000" required:"true" minimum:"100" maximum:"10000000" description:"充值金额(分)"`
|
||
PaymentMethod string `json:"payment_method" validate:"required,oneof=wechat" required:"true" description:"支付方式 (wechat:微信支付)"`
|
||
AppType string `json:"app_type" validate:"required,oneof=official_account miniapp" required:"true" description:"应用类型 (official_account:公众号, miniapp:小程序)"`
|
||
}
|
||
|
||
// ClientRechargeResponse C4 创建充值订单响应
|
||
type ClientRechargeResponse struct {
|
||
Recharge ClientRechargeResult `json:"recharge" description:"充值信息"`
|
||
PayConfig ClientRechargePayConfig `json:"pay_config" description:"支付配置"`
|
||
}
|
||
|
||
// ClientRechargeResult C4 充值信息
|
||
type ClientRechargeResult struct {
|
||
RechargeID uint `json:"recharge_id" description:"充值ID"`
|
||
RechargeNo string `json:"recharge_no" description:"充值单号"`
|
||
Amount int64 `json:"amount" description:"充值金额(分)"`
|
||
Status int `json:"status" description:"状态 (0:待支付, 1:已支付, 2:已关闭)"`
|
||
}
|
||
|
||
// ClientRechargePayConfig C4 支付配置
|
||
type ClientRechargePayConfig struct {
|
||
AppID string `json:"app_id" description:"应用ID"`
|
||
Timestamp string `json:"timestamp" description:"时间戳"`
|
||
NonceStr string `json:"nonce_str" description:"随机字符串"`
|
||
PackageVal string `json:"package" description:"预支付参数"`
|
||
SignType string `json:"sign_type" description:"签名类型"`
|
||
PaySign string `json:"pay_sign" description:"支付签名"`
|
||
}
|
||
|
||
// ========================================
|
||
// C5 充值记录列表
|
||
// ========================================
|
||
|
||
// ClientRechargeListRequest C5 充值记录列表请求
|
||
type ClientRechargeListRequest struct {
|
||
Identifier string `json:"identifier" query:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符(SN/IMEI/虚拟号/ICCID/MSISDN)"`
|
||
Status *int `json:"status" query:"status" validate:"omitempty,min=0,max=2" minimum:"0" maximum:"2" description:"充值状态 (0:待支付, 1:已支付, 2:已关闭)"`
|
||
Page int `json:"page" query:"page" validate:"required,min=1" required:"true" minimum:"1" description:"页码"`
|
||
PageSize int `json:"page_size" query:"page_size" validate:"required,min=1,max=100" required:"true" minimum:"1" maximum:"100" description:"每页数量"`
|
||
}
|
||
|
||
// ClientRechargeListItem C5 充值记录项
|
||
type ClientRechargeListItem struct {
|
||
RechargeID uint `json:"recharge_id" description:"充值ID"`
|
||
RechargeNo string `json:"recharge_no" description:"充值单号"`
|
||
Amount int64 `json:"amount" description:"充值金额(分)"`
|
||
Status int `json:"status" description:"状态 (0:待支付, 1:已支付, 2:已关闭)"`
|
||
PaymentMethod string `json:"payment_method" description:"支付方式"`
|
||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||
AutoPurchaseStatus string `json:"auto_purchase_status" description:"自动购包状态"`
|
||
}
|
||
|
||
// ClientRechargeListResponse C5 充值记录列表响应
|
||
type ClientRechargeListResponse struct {
|
||
List []ClientRechargeListItem `json:"list" description:"充值记录列表"`
|
||
Total int64 `json:"total" description:"总数"`
|
||
Page int `json:"page" description:"页码"`
|
||
PageSize int `json:"page_size" description:"每页数量"`
|
||
}
|