wangpengfei
2023-07-26 e0a433e9c31594527a3bf7766c0bfb2cbbceffdb
api/v1/saleChance.go
@@ -104,29 +104,6 @@
   ctx.Ok()
}
// List
//
//   @Tags      SaleChance
//   @Summary   获取销售机会列表
//   @Produce   application/json
//   @Success   200   {object}   contextx.Response{data=response.SaleChanceResponse}
//   @Router      /api/saleChance/list [get]
func (s *SaleChanceApi) List(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   if !ok {
      return
   }
   errCode, list := saleChanceService.GetSaleChanceList()
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.SaleChanceResponse{
      List: list,
   })
}
// checkSaleChanceParams
// 检查销售机会参数
@@ -207,3 +184,30 @@
   return ecode.OK, sc
}
// List
//
//   @Tags      SaleChance
//   @Summary   销售机会列表
//   @Produce   application/json
//   @Param      object   body      request.GetSaleChanceList   true   "参数"
//   @Success   200      {object}   contextx.Response{data=response.SaleChanceResponse}
//   @Router      /api/saleChance/list [post]
func (con *SaleChanceApi) List(c *gin.Context) {
   var params request.GetSaleChanceList
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
      return
   }
   saleChances, errCode := saleChanceService.GetSaleChanceList(params.Page, params.PageSize, params.Keyword)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
   }
   ctx.OkWithDetailed(response.SaleChanceResponse{
      List: saleChances,
      Count: len(saleChances),
   })
}