优化结构
This commit is contained in:
@@ -47,6 +47,20 @@ func (h *Payment) Order(c *gin.Context) {
|
||||
}
|
||||
httpx.OKWithData(c, order)
|
||||
}
|
||||
|
||||
func (h *Payment) Orders(c *gin.Context) {
|
||||
var req dto.PaymentOrderListRequest
|
||||
if err := c.ShouldBindQuery(&req); err != nil {
|
||||
httpx.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
items, total, page, pageSize, err := h.service.Orders(c.Request.Context(), &req)
|
||||
if err != nil {
|
||||
httpx.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, httpx.PageResult{List: items, Total: total, Page: page, PageSize: pageSize}, "获取成功")
|
||||
}
|
||||
func (h *Payment) Create(c *gin.Context) {
|
||||
var req dto.PaymentRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user