package handler

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

func WrapSpecialSProjectAddToListHandler(ctx *gin.Context) {
	handler := newSpecialSProjectAddToListtHandler(ctx)
	baseRun(handler)
}

func newSpecialSProjectAddToListtHandler(ctx *gin.Context) *SpecialSProjectAddToListHandler {
	return &SpecialSProjectAddToListHandler{
		req:  http_model.NewSpecialSProjectAddToListRequest(),
		resp: http_model.NewSpecialSProjectAddToListResponse(),
		ctx:  ctx,
	}
}

type SpecialSProjectAddToListHandler struct {
	req  *http_model.SpecialSProjectAddToListRequest
	resp *http_model.CommonResponse
	ctx  *gin.Context
}

func (h *SpecialSProjectAddToListHandler) getRequest() interface{} {
	return h.req
}
func (h *SpecialSProjectAddToListHandler) getContext() *gin.Context {
	return h.ctx
}
func (h *SpecialSProjectAddToListHandler) getResponse() interface{} {
	return h.resp
}
func (h *SpecialSProjectAddToListHandler) run() {
	var data *http_model.SpecialSProjectAddToListRequest
	data = h.req
	err := service.SProject.UpdateSProject(h.ctx, data)
	if err != nil {
		h.resp.Status = 50000
		h.resp.Message = "同意定向邀约失败"
	}
	h.resp.Status = 20000
	h.resp.Message = "同意定向邀约成功"
}

func (h *SpecialSProjectAddToListHandler) checkParam() error {
	return nil
}
