localtasklinklist.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package handler
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/sirupsen/logrus"
  5. "youngee_b_api/consts"
  6. "youngee_b_api/model/http_model"
  7. "youngee_b_api/service"
  8. "youngee_b_api/util"
  9. )
  10. func WrapLocalTaskLinklistHandler(ctx *gin.Context) {
  11. handler := newLocalTaskLinklistHandler(ctx)
  12. baseRun(handler)
  13. }
  14. type LocalTaskLinklist struct {
  15. ctx *gin.Context
  16. req *http_model.LocalTaskLinklistRequest
  17. resp *http_model.CommonResponse
  18. }
  19. func (c LocalTaskLinklist) getContext() *gin.Context {
  20. return c.ctx
  21. }
  22. func (c LocalTaskLinklist) getResponse() interface{} {
  23. return c.resp
  24. }
  25. func (c LocalTaskLinklist) getRequest() interface{} {
  26. return c.req
  27. }
  28. func (c LocalTaskLinklist) run() {
  29. data := http_model.LocalTaskLinklistRequest{}
  30. data = *c.req
  31. res, err := service.LocalTask.GetLocalTaskLinklist(c.ctx, data)
  32. if err != nil {
  33. logrus.Errorf("[GetLocalTaskLinklist] call GetLocalTaskLinklist err:%+v\n", err)
  34. util.HandlerPackErrorResp(c.resp, consts.ErrorParamCheck, "")
  35. logrus.Info("GetLocalTaskLinklist fail,req:%+v", c.req)
  36. return
  37. }
  38. c.resp.Message = "成功查询链接待审列表"
  39. c.resp.Data = res
  40. c.resp.Status = consts.ErrorSuccess
  41. }
  42. func (c LocalTaskLinklist) checkParam() error {
  43. return nil
  44. }
  45. func newLocalTaskLinklistHandler(ctx *gin.Context) *LocalTaskLinklist {
  46. return &LocalTaskLinklist{
  47. ctx: ctx,
  48. req: http_model.NewLocalTaskLinklistRequest(),
  49. resp: http_model.NewLocalTaskLinklistResponse(),
  50. }
  51. }