gettalentwithdrawlist.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package handler
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/sirupsen/logrus"
  5. "youngee_m_api/consts"
  6. "youngee_m_api/db"
  7. "youngee_m_api/model/http_model"
  8. "youngee_m_api/util"
  9. )
  10. func WrapGetTalentWithdrawListHandler(ctx *gin.Context) {
  11. handler := newGetTalentWithdrawListHandler(ctx)
  12. BaseRun(handler)
  13. }
  14. type GetTalentWithdrawList struct {
  15. ctx *gin.Context
  16. req *http_model.GetTalentWithdrawListRequest
  17. resp *http_model.CommonResponse
  18. }
  19. func (c GetTalentWithdrawList) getContext() *gin.Context {
  20. return c.ctx
  21. }
  22. func (c GetTalentWithdrawList) getResponse() interface{} {
  23. return c.resp
  24. }
  25. func (c GetTalentWithdrawList) getRequest() interface{} {
  26. return c.req
  27. }
  28. func (c GetTalentWithdrawList) run() {
  29. data := *c.req
  30. res, err := db.GetTalentWithdrawList(c.ctx, &data)
  31. if err != nil {
  32. logrus.Errorf("[GetTalentWithdrawList] call GetTalentWithdrawList err:%+v\n", err)
  33. util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
  34. logrus.Info("GetTalentWithdrawList fail,req:%+v", c.req)
  35. return
  36. }
  37. c.resp.Message = "成功查询开票列表"
  38. c.resp.Data = res
  39. }
  40. func (c GetTalentWithdrawList) checkParam() error {
  41. return nil
  42. }
  43. func newGetTalentWithdrawListHandler(ctx *gin.Context) *GetTalentWithdrawList {
  44. return &GetTalentWithdrawList{
  45. ctx: ctx,
  46. req: http_model.NewGetTalentWithdrawListRequest(),
  47. resp: http_model.NewGetTalentWithdrawListResponse(),
  48. }
  49. }