123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package handler
- import (
- "fmt"
- "github.com/gin-gonic/gin"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- )
- func WrapLocalSpecialAddStrategyHandler(ctx *gin.Context) {
- handler := newLocalSpecialAddStrategyHandler(ctx)
- baseRun(handler)
- }
- func newLocalSpecialAddStrategyHandler(ctx *gin.Context) *LocalSpecialAddStrategyHandler {
- return &LocalSpecialAddStrategyHandler{
- req: http_model.NewLocalSpecialAddStrategyRequest(),
- resp: http_model.NewLocalSpecialAddStrategyResponse(),
- ctx: ctx,
- }
- }
- type LocalSpecialAddStrategyHandler struct {
- req *http_model.LocalSpecialAddStrategyRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (p *LocalSpecialAddStrategyHandler) getContext() *gin.Context {
- return p.ctx
- }
- func (p *LocalSpecialAddStrategyHandler) getResponse() interface{} {
- return p.resp
- }
- func (p *LocalSpecialAddStrategyHandler) getRequest() interface{} {
- return p.req
- }
- func (p *LocalSpecialAddStrategyHandler) run() {
- fmt.Println(p.req.RecruitStrategys)
- err := service.SLocalLife.CreateSpecialStrategy(p.ctx, p.req)
- if err != nil {
- p.resp.Message = err.Error()
- p.resp.Status = 40000
- }
- p.resp.Message = "成功添加招募策略"
- p.resp.Status = 20000
- }
- func (p *LocalSpecialAddStrategyHandler) checkParam() error {
- return nil
- }
|