chore: document v1 dto fields
This commit is contained in:
@@ -3,67 +3,109 @@ package dto
|
||||
import "quyun/v2/pkg/consts"
|
||||
|
||||
type UserUpdate struct {
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Gender consts.Gender `json:"gender"`
|
||||
Bio string `json:"bio"`
|
||||
Birthday string `json:"birthday"`
|
||||
Location *Location `json:"location"`
|
||||
// Nickname 昵称。
|
||||
Nickname string `json:"nickname"`
|
||||
// Avatar 头像URL。
|
||||
Avatar string `json:"avatar"`
|
||||
// Gender 性别(枚举)。
|
||||
Gender consts.Gender `json:"gender"`
|
||||
// Bio 个人简介。
|
||||
Bio string `json:"bio"`
|
||||
// Birthday 生日(YYYY-MM-DD)。
|
||||
Birthday string `json:"birthday"`
|
||||
// Location 地区信息(省/市)。
|
||||
Location *Location `json:"location"`
|
||||
}
|
||||
|
||||
type RealNameForm struct {
|
||||
// Realname 真实姓名。
|
||||
Realname string `json:"realname"`
|
||||
IDCard string `json:"id_card"`
|
||||
// IDCard 身份证号。
|
||||
IDCard string `json:"id_card"`
|
||||
}
|
||||
|
||||
type WalletResponse struct {
|
||||
Balance float64 `json:"balance"`
|
||||
// Balance 账户余额(单位元)。
|
||||
Balance float64 `json:"balance"`
|
||||
// Transactions 交易流水列表。
|
||||
Transactions []Transaction `json:"transactions"`
|
||||
}
|
||||
|
||||
type Transaction struct {
|
||||
ID int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
// ID 流水ID。
|
||||
ID int64 `json:"id"`
|
||||
// Title 流水标题/描述。
|
||||
Title string `json:"title"`
|
||||
// Amount 发生金额(单位元)。
|
||||
Amount float64 `json:"amount"`
|
||||
Type string `json:"type"` // income, expense
|
||||
Date string `json:"date"`
|
||||
// Type 流水类型(income/expense)。
|
||||
Type string `json:"type"`
|
||||
// Date 发生时间(RFC3339)。
|
||||
Date string `json:"date"`
|
||||
}
|
||||
|
||||
type RechargeForm struct {
|
||||
// Amount 充值金额(单位元)。
|
||||
Amount float64 `json:"amount"`
|
||||
Method string `json:"method"` // wechat, alipay
|
||||
// Method 充值方式(wechat/alipay)。
|
||||
Method string `json:"method"`
|
||||
}
|
||||
|
||||
type RechargeResponse struct {
|
||||
// PayParams 支付参数(透传给前端)。
|
||||
PayParams string `json:"pay_params"`
|
||||
OrderID string `json:"order_id"`
|
||||
// OrderID 充值订单ID。
|
||||
OrderID string `json:"order_id"`
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
ID int64 `json:"id"`
|
||||
Type string `json:"type"` // consts.OrderType...
|
||||
TypeDescription string `json:"type_description"`
|
||||
CreateTime string `json:"create_time"`
|
||||
PayTime string `json:"pay_time"`
|
||||
Status string `json:"status"`
|
||||
StatusDescription string `json:"status_description"`
|
||||
Amount float64 `json:"amount"`
|
||||
Quantity int `json:"quantity"`
|
||||
Items []ContentItem `json:"items"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
TenantName string `json:"tenant_name"`
|
||||
IsVirtual bool `json:"is_virtual"`
|
||||
BuyerName string `json:"buyer_name"`
|
||||
BuyerAvatar string `json:"buyer_avatar"`
|
||||
Title string `json:"title"`
|
||||
Cover string `json:"cover"`
|
||||
// ID 订单ID。
|
||||
ID int64 `json:"id"`
|
||||
// Type 订单类型(内容购买/充值等)。
|
||||
Type string `json:"type"`
|
||||
// TypeDescription 订单类型描述。
|
||||
TypeDescription string `json:"type_description"`
|
||||
// CreateTime 创建时间(RFC3339)。
|
||||
CreateTime string `json:"create_time"`
|
||||
// PayTime 支付时间(RFC3339)。
|
||||
PayTime string `json:"pay_time"`
|
||||
// Status 订单状态。
|
||||
Status string `json:"status"`
|
||||
// StatusDescription 订单状态描述。
|
||||
StatusDescription string `json:"status_description"`
|
||||
// Amount 实付金额(单位元)。
|
||||
Amount float64 `json:"amount"`
|
||||
// Quantity 内容数量。
|
||||
Quantity int `json:"quantity"`
|
||||
// Items 订单内容明细。
|
||||
Items []ContentItem `json:"items"`
|
||||
// TenantID 内容所属租户ID。
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
// TenantName 租户名称。
|
||||
TenantName string `json:"tenant_name"`
|
||||
// IsVirtual 是否虚拟订单。
|
||||
IsVirtual bool `json:"is_virtual"`
|
||||
// BuyerName 买家昵称。
|
||||
BuyerName string `json:"buyer_name"`
|
||||
// BuyerAvatar 买家头像URL。
|
||||
BuyerAvatar string `json:"buyer_avatar"`
|
||||
// Title 订单标题(用于列表展示)。
|
||||
Title string `json:"title"`
|
||||
// Cover 订单封面图。
|
||||
Cover string `json:"cover"`
|
||||
}
|
||||
|
||||
type Notification struct {
|
||||
ID int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
// ID 通知ID。
|
||||
ID int64 `json:"id"`
|
||||
// Type 通知类型(system/order/interaction)。
|
||||
Type string `json:"type"`
|
||||
// Title 通知标题。
|
||||
Title string `json:"title"`
|
||||
// Content 通知内容。
|
||||
Content string `json:"content"`
|
||||
Read bool `json:"read"`
|
||||
Time string `json:"time"`
|
||||
// Read 是否已读。
|
||||
Read bool `json:"read"`
|
||||
// Time 发送时间(RFC3339)。
|
||||
Time string `json:"time"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user