feat: 更新订单和用户视图,增强订单信息展示,支持充值类型订单
This commit is contained in:
@@ -40,16 +40,19 @@ type RechargeResponse struct {
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
ID string `json:"id"`
|
||||
CreateTime string `json:"create_time"`
|
||||
PayTime string `json:"pay_time"`
|
||||
Status string `json:"status"`
|
||||
Amount float64 `json:"amount"`
|
||||
Quantity int `json:"quantity"`
|
||||
Items []ContentItem `json:"items"`
|
||||
TenantID string `json:"tenant_id"`
|
||||
TenantName string `json:"tenant_name"`
|
||||
IsVirtual bool `json:"is_virtual"`
|
||||
ID string `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 string `json:"tenant_id"`
|
||||
TenantName string `json:"tenant_name"`
|
||||
IsVirtual bool `json:"is_virtual"`
|
||||
}
|
||||
|
||||
type Notification struct {
|
||||
|
||||
@@ -353,11 +353,14 @@ func (s *order) Status(ctx context.Context, id string) (*transaction_dto.OrderSt
|
||||
|
||||
func (s *order) composeOrderDTO(ctx context.Context, o *models.Order) (user_dto.Order, error) {
|
||||
dto := user_dto.Order{
|
||||
ID: cast.ToString(o.ID),
|
||||
Status: string(o.Status),
|
||||
Amount: float64(o.AmountPaid) / 100.0,
|
||||
CreateTime: o.CreatedAt.Format(time.RFC3339),
|
||||
TenantID: cast.ToString(o.TenantID),
|
||||
ID: cast.ToString(o.ID),
|
||||
Type: string(o.Type),
|
||||
TypeDescription: o.Type.Description(),
|
||||
Status: string(o.Status),
|
||||
StatusDescription: o.Status.Description(),
|
||||
Amount: float64(o.AmountPaid) / 100.0,
|
||||
CreateTime: o.CreatedAt.Format(time.RFC3339),
|
||||
TenantID: cast.ToString(o.TenantID),
|
||||
}
|
||||
|
||||
// Fetch Tenant Name
|
||||
|
||||
Reference in New Issue
Block a user