wangpengfei
2023-07-26 e0a433e9c31594527a3bf7766c0bfb2cbbceffdb
api/v1/subOrder.go
@@ -98,29 +98,6 @@
   ctx.Ok()
}
// List
//
//   @Tags      SubOrder
//   @Summary   获取子订单列表
//   @Produce   application/json
//   @Success   200   {object}   contextx.Response{data=response.SubOrderResponse}
//   @Router      /api/subOrder/list [get]
func (s *SubOrderApi) List(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   if !ok {
      return
   }
   subOrders, errCode := subOrderService.GetSubOrderList()
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.SubOrderResponse{
      List: subOrders,
   })
}
// checkSubOrderParams
// 检查子订单参数
@@ -141,3 +118,30 @@
   return ecode.OK, newSubOrder
}
// List
//
//   @Tags      SubOrder
//   @Summary   销售子单列表
//   @Produce   application/json
//   @Param      object   body      request.GetSubOrderList   true   "参数"
//   @Success   200      {object}   contextx.Response{data=response.SubOrderResponse}
//   @Router      /api/subOrder/list [post]
func (con *SubOrderApi) List(c *gin.Context) {
   var params request.GetSubOrderList
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
      return
   }
   subOrders, errCode := subOrderService.GetSubOrderList(params.Page, params.PageSize, params.Keyword)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.SubOrderResponse{
      List: subOrders,
      Count: len(subOrders),
   })
}