You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.0 KiB
50 lines
1.0 KiB
package order
|
|
|
|
import (
|
|
"base/app/common"
|
|
"base/app/lib/bean"
|
|
"base/app/logic/manage/order"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Sale struct {
|
|
}
|
|
|
|
type argsSaleLists struct {
|
|
order.SaleSearch
|
|
bean.Page
|
|
}
|
|
|
|
// Lists @Title 车辆出售订单列表
|
|
func (s *Sale) Lists(c *gin.Context) {
|
|
args := argsSaleLists{}
|
|
if err := c.ShouldBind(&args); err != nil {
|
|
bean.Response.ResultFail(c, 10001, common.GetVerErr(err))
|
|
return
|
|
}
|
|
lists, total := order.SaleLogic.Lists(args.SaleSearch, args.Page)
|
|
bean.Response.ResultSuc(c, "操作成功", bean.ResultLists{
|
|
List: lists,
|
|
Total: total,
|
|
})
|
|
}
|
|
|
|
type argsSaleInfo struct {
|
|
SaleId uint `binding:"required" label:"订单"`
|
|
}
|
|
|
|
// Info @Title 出售订单详情
|
|
func (s *Sale) Info(c *gin.Context) {
|
|
args := argsSaleInfo{}
|
|
if err := c.ShouldBind(&args); err != nil {
|
|
bean.Response.ResultFail(c, 10001, common.GetVerErr(err))
|
|
return
|
|
}
|
|
result, err := order.SaleLogic.Info(args.SaleId)
|
|
if err != nil {
|
|
bean.Response.ResultFail(c, 10002, err.Error())
|
|
return
|
|
}
|
|
bean.Response.ResultSuc(c, "操作成功", result)
|
|
}
|