zhangqian
2023-08-07 4b63908ad085bc570623f7b0c0fd397b2ae7a80d
api/v1/client.go
@@ -7,7 +7,6 @@
   "aps_crm/pkg/contextx"
   "aps_crm/pkg/ecode"
   "github.com/gin-gonic/gin"
   "strconv"
)
type ClientApi struct{}
@@ -120,17 +119,17 @@
//   @Tags      Client
//   @Summary   删除客户
//   @Produce   application/json
//   @Param      id   path      int   true   "客户ID"
//   @Param      object   body      request.DeleteClient true   "查询参数"
//   @Success   200   {object}   contextx.Response{}
//   @Router      /api/client/delete/{id} [delete]
//   @Router      /api/client/delete [delete]
func (cli *ClientApi) Delete(c *gin.Context) {
   ctx, ok := contextx.NewContext(c, nil)
   var params request.DeleteClient
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
      return
   }
   id, _ := strconv.Atoi(c.Param("id"))
   errCode := clientService.DeleteClient(id)
   errCode := clientService.DeleteClient(params.Ids)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
@@ -192,7 +191,7 @@
      return
   }
   clients, errCode := clientService.GetClientList(params.Page, params.PageSize, params.Keyword)
   clients, total, errCode := clientService.GetClientList(params.Page, params.PageSize, params.Keyword)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return
@@ -200,6 +199,6 @@
   ctx.OkWithDetailed(response.ClientResponse{
      List:  clients,
      Count: len(clients),
      Count: int(total),
   })
}