44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
|
package front
|
||
|
|
||
|
import (
|
||
|
"qteam/app/models/ordersmodel"
|
||
|
"qteam/app/utils"
|
||
|
)
|
||
|
|
||
|
type OrderCreateRequest struct {
|
||
|
ProductId int `form:"product_id" validate:"required"`
|
||
|
}
|
||
|
|
||
|
type OrderQueryRequest struct {
|
||
|
OrderId string `form:"order_id" validate:"required"`
|
||
|
}
|
||
|
|
||
|
type OrderListRequest struct {
|
||
|
PageRequest
|
||
|
}
|
||
|
|
||
|
type OrderQueryResponse struct {
|
||
|
Id int `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"`
|
||
|
State int `json:"state"`
|
||
|
VoucherLink string `json:"voucher_link"`
|
||
|
CreateTime string `json:"create_time"`
|
||
|
}
|
||
|
|
||
|
func (p *OrderQueryResponse) ResponseFromDb(l ordersmodel.Orders) {
|
||
|
utils.EntityCopy(p, &l)
|
||
|
p.CreateTime = l.CreateTime.Format("2006-01-02 15:04:05")
|
||
|
return
|
||
|
}
|
||
|
|
||
|
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"`
|
||
|
}
|