SpecialTaskFinishData.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package handler
  2. // import (
  3. // "errors"
  4. // "fmt"
  5. // "youngee_b_api/consts"
  6. // "youngee_b_api/model/http_model"
  7. // "youngee_b_api/pack"
  8. // "youngee_b_api/service"
  9. // "youngee_b_api/util"
  10. // "github.com/gin-gonic/gin"
  11. // "github.com/issue9/conv"
  12. // "github.com/sirupsen/logrus"
  13. // )
  14. // func WrapSpecialTaskFinishDataListHandler(ctx *gin.Context) {
  15. // handler := newSpecialTaskFinishDataListHandler(ctx)
  16. // baseRun(handler)
  17. // }
  18. // func newSpecialTaskFinishDataListHandler(ctx *gin.Context) *SpecialTaskFinishDataListHandler {
  19. // return &SpecialTaskFinishDataListHandler{
  20. // req: http_model.NewSpecialTaskFinishDataListRequest(),
  21. // resp: http_model.NewSpecialTaskFinishDataListResponse(),
  22. // ctx: ctx,
  23. // }
  24. // }
  25. // type SpecialTaskFinishDataListHandler struct {
  26. // req *http_model.SpecialTaskFinishDataListRequest
  27. // resp *http_model.CommonResponse
  28. // ctx *gin.Context
  29. // }
  30. // func (h *SpecialTaskFinishDataListHandler) getRequest() interface{} {
  31. // return h.req
  32. // }
  33. // func (h *SpecialTaskFinishDataListHandler) getContext() *gin.Context {
  34. // return h.ctx
  35. // }
  36. // func (h *SpecialTaskFinishDataListHandler) getResponse() interface{} {
  37. // return h.resp
  38. // }
  39. // func (h *SpecialTaskFinishDataListHandler) run() {
  40. // conditions := pack.HttpSpecialTaskFinishDataListRequestToCondition(h.req)
  41. // data, err := service.SpecialTask.GetSpecialTaskFinishDataList(h.ctx, h.req.ProjectId, h.req.PageSize, h.req.PageNum, conditions)
  42. // if err != nil {
  43. // logrus.WithContext(h.ctx).Errorf("[TaskLogisticsListHandler] error GetProjectTaskList, err:%+v", err)
  44. // util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast)
  45. // return
  46. // }
  47. // h.resp.Data = data
  48. // }
  49. // func (h *SpecialTaskFinishDataListHandler) checkParam() error {
  50. // var errs []error
  51. // if h.req.PageNum < 0 || h.req.PageSize <= 0 {
  52. // errs = append(errs, errors.New("page param error"))
  53. // }
  54. // h.req.PageNum--
  55. // h.req.ProjectId = util.IsNull(h.req.ProjectId)
  56. // if _, err := conv.Int64(h.req.ProjectId); err != nil {
  57. // errs = append(errs, err)
  58. // }
  59. // h.req.FinishDataStatus = util.IsNull(h.req.FinishDataStatus)
  60. // if _, err := conv.Int64(h.req.FinishDataStatus); err != nil {
  61. // errs = append(errs, err)
  62. // }
  63. // if len(errs) != 0 {
  64. // return fmt.Errorf("check param errs:%+v", errs)
  65. // }
  66. // return nil
  67. // }