local_strategy.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package handler
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "youngee_b_api/model/http_model"
  5. "youngee_b_api/service"
  6. )
  7. func WrapLocalStrategyHandler(ctx *gin.Context) {
  8. handler := newLocalStrategyHandler(ctx)
  9. baseRun(handler)
  10. }
  11. func newLocalStrategyHandler(ctx *gin.Context) *LocalStrategyHandler {
  12. return &LocalStrategyHandler{
  13. req: http_model.NewLocalStrategyRequest(),
  14. resp: http_model.NewlocalStrategyResponse(),
  15. ctx: ctx,
  16. }
  17. }
  18. type LocalStrategyHandler struct {
  19. req *http_model.LocalStrategyRequest
  20. resp *http_model.CommonResponse
  21. ctx *gin.Context
  22. }
  23. func (h *LocalStrategyHandler) getRequest() interface{} {
  24. return h.req
  25. }
  26. func (h *LocalStrategyHandler) getContext() *gin.Context {
  27. return h.ctx
  28. }
  29. func (h *LocalStrategyHandler) getResponse() interface{} {
  30. return h.resp
  31. }
  32. func (h *LocalStrategyHandler) run() {
  33. recruitStrategys, err := service.Project.GetProjectStrategys(h.ctx, h.req.LocalId)
  34. if err != nil {
  35. h.resp.Message = err.Error()
  36. }
  37. h.resp.Message = "成功查询招募策略"
  38. h.resp.Data = recruitStrategys
  39. }
  40. func (h *LocalStrategyHandler) checkParam() error {
  41. return nil
  42. }