RefuseTalentWithdraw.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 WrapRefuseTalentWithdrawalHandler(ctx *gin.Context) {
  11. handler := newRefuseTalentWithdrawalHandler(ctx)
  12. BaseRun(handler)
  13. }
  14. type RefuseTalentWithdrawalHandler struct {
  15. ctx *gin.Context
  16. req *http_model.RefuseTalentWithdrawalRequest
  17. resp *http_model.CommonResponse
  18. }
  19. func (c RefuseTalentWithdrawalHandler) getContext() *gin.Context {
  20. return c.ctx
  21. }
  22. func (c RefuseTalentWithdrawalHandler) getResponse() interface{} {
  23. return c.resp
  24. }
  25. func (c RefuseTalentWithdrawalHandler) getRequest() interface{} {
  26. return c.req
  27. }
  28. func (c RefuseTalentWithdrawalHandler) run() {
  29. err := db.RefuseTalentWithdrawal(c.ctx, c.req)
  30. if err != nil {
  31. logrus.WithContext(c.ctx).Errorf("[RefuseTalentWithdrawalHandler] error RefuseTalentWithdrawal, err:%+v", err)
  32. util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, consts.DefaultToast)
  33. return
  34. }
  35. c.resp.Message = "驳回提现成功"
  36. }
  37. func (c RefuseTalentWithdrawalHandler) checkParam() error {
  38. return nil
  39. }
  40. func newRefuseTalentWithdrawalHandler(ctx *gin.Context) *RefuseTalentWithdrawalHandler {
  41. return &RefuseTalentWithdrawalHandler{
  42. ctx: ctx,
  43. req: http_model.NewRefuseTalentWithdrawalRequest(),
  44. resp: http_model.NewRefuseTalentWithdrawalResponse(),
  45. }
  46. }