package handler

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"youngee_b_api/model/http_model"
	"youngee_b_api/service"
)

func WrapProjectStrategyHandler(ctx *gin.Context) {
	handler := newProjectStrategyHandler(ctx)
	baseRun(handler)
}

func newProjectStrategyHandler(ctx *gin.Context) *ProjectStrategyHandler {
	return &ProjectStrategyHandler{
		req:  http_model.NewProjectStrategyRequest(),
		resp: http_model.NewProjectStrategyResponse(),
		ctx:  ctx,
	}
}

type ProjectStrategyHandler struct {
	req  *http_model.ProjectStrategyRequest
	resp *http_model.CommonResponse
	ctx  *gin.Context
}

func (h *ProjectStrategyHandler) getRequest() interface{} {
	return h.req
}
func (h *ProjectStrategyHandler) getContext() *gin.Context {
	return h.ctx
}
func (h *ProjectStrategyHandler) getResponse() interface{} {
	return h.resp
}
func (h *ProjectStrategyHandler) run() {
	fmt.Println("project_id: ", h.req.ProjectId)
	recruitStrategys, err := service.Project.GetProjectStrategys(h.ctx, h.req.ProjectId)
	if err != nil {
		h.resp.Message = err.Error()
	}
	h.resp.Message = "成功查询招募策略"
	h.resp.Data = recruitStrategys
}
func (h *ProjectStrategyHandler) checkParam() error {
	return nil
}
