| | |
| | | ctx.Ok() |
| | | } |
| | | |
| | | // List |
| | | // |
| | | // @Tags ServiceFollowup |
| | | // @Summary 服务跟进列表 |
| | | // @Produce application/json |
| | | // @Success 200 {object} contextx.Response{data=response.ServiceFollowupResponse} |
| | | // @Router /api/serviceFollowup/list [get] |
| | | func (s *ServiceFollowupApi) List(c *gin.Context) { |
| | | ctx, ok := contextx.NewContext(c, nil) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | list, errCode := serviceFollowupService.GetServiceFollowupList() |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(response.ServiceFollowupResponse{ |
| | | List: list, |
| | | }) |
| | | } |
| | | |
| | | // checkServiceFollowupParams |
| | | func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) { |
| | |
| | | |
| | | return ecode.OK, serviceFollowupModel |
| | | } |
| | | |
| | | // List |
| | | // |
| | | // @Tags ServiceFollowup |
| | | // @Summary 回访单管理列表 |
| | | // @Produce application/json |
| | | // @Param object body request.GetServiceFollowupList true "参数" |
| | | // @Success 200 {object} contextx.Response{data=response.ServiceFollowupResponse} |
| | | // @Router /api/serviceFollowup/list [post] |
| | | func (con *ServiceFollowupApi) List(c *gin.Context) { |
| | | var params request.GetServiceFollowupList |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | serviceFollowups, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.Keyword) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(response.ServiceFollowupResponse{ |
| | | List: serviceFollowups, |
| | | Count: len(serviceFollowups), |
| | | }) |
| | | } |