|
@@ -0,0 +1,52 @@
|
|
|
+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.Message = "成功添加招募策略"
|
|
|
+}
|
|
|
+
|
|
|
+func (p *LocalSpecialAddStrategyHandler) checkParam() error {
|
|
|
+ return nil
|
|
|
+}
|