package front import ( "qteam/app/http/entities" "qteam/app/models/ordermodel" "qteam/app/utils" ) type OrderCreateRequest struct { ProductId int `form:"product_id" validate:"required"` } type OrderQueryRequest struct { OrderNo string `form:"order_no" validate:"required"` } type OrderListRequest struct { entities.PageRequest } type OrderQueryResponse struct { Id string `json:"id"` OrderNo string `json:"order_no"` UserId int `json:"user_id"` UserName string `json:"user_name"` Mobile string `json:"mobile"` ProductId int `json:"product_id"` ProductName string `json:"product_name"` ActivityId int `json:"activity_id"` State int `json:"state"` VoucherId int `json:"voucher_id"` VoucherLink string `json:"voucher_link"` CreateTime string `json:"create_time"` } func (p *OrderQueryResponse) ResponseFromDb(l ordermodel.Order) { utils.EntityCopy(p, &l) p.CreateTime = l.CreateTime.Format("2006-01-02 15:04:05") } type OrdersUpdateRequest struct { Id int `json:"id" validate:"required" form:"id" validate:"required" example:"1"` Status int `json:"status" form:"status" validate:"oneof=1 2 3 4" example:"1"` // '状态(1/待支付,2/已支付,3/已完成4/取消5作废)' VoucherLink string `json:"voucher_link"` }