wangpengfei
2023-07-26 e0a433e9c31594527a3bf7766c0bfb2cbbceffdb
api/v1/quotation.go
@@ -98,29 +98,6 @@
   ctx.Ok()
}
// List
//
//   @Tags      Quotation
//   @Summary   报价单列表
//   @Produce   application/json
//   @Success   200   {object}   contextx.Response{data=response.QuotationResponse}
//   @Router      /api/quotation/list [get]
func (s *QuotationApi) List(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   if !ok {
      return
   }
   list, errCode := quotationService.GetQuotationList()
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.QuotationResponse{
      List: list,
   })
}
// checkQuotationParams
func checkQuotationParams(quotation request.Quotation) (int, model.Quotation) {
@@ -166,3 +143,30 @@
   return ecode.OK, quotationModel
}
// List
//
//   @Tags      Quotation
//   @Summary   报价单列表
//   @Produce   application/json
//   @Param      object   body      request.GetQuotationList   true   "参数"
//   @Success   200      {object}   contextx.Response{data=response.QuotationResponse}
//   @Router      /api/quotation/list [post]
func (con *QuotationApi) List(c *gin.Context) {
   var params request.GetQuotationList
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
      return
   }
   quotations, errCode := quotationService.GetQuotationList(params.Page, params.PageSize, params.Keyword)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.QuotationResponse{
      List: quotations,
      Count: len(quotations),
   })
}