12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package operate
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "youngee_m_api/consts"
- "youngee_m_api/db"
- "youngee_m_api/model/http_model"
- "youngee_m_api/util"
- )
- func WrapSelectionInvalidHandler(ctx *gin.Context) {
- handler := newSelectionInvalidHandler(ctx)
- println(handler)
- BaseRun(handler)
- }
- type selectioninvalidHandler struct {
- req *http_model.SelectionInvalid
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (i selectioninvalidHandler) getContext() *gin.Context {
- return i.ctx
- }
- func (i selectioninvalidHandler) getResponse() interface{} {
- return i.resp
- }
- func (i selectioninvalidHandler) getRequest() interface{} {
- return i.req
- }
- func (i selectioninvalidHandler) run() {
- println("selectioninvalid===============")
- time := i.req.Time
- err := db.UpdateAutoTaskTime(i.ctx, time, 13)
- if err != nil {
- logrus.WithContext(i.ctx).Errorf("[invalidHandler] error invalid, err:%+v", err)
- util.HandlerPackErrorResp(i.resp, consts.ErrorInternal, consts.DefaultToast)
- return
- }
- i.resp.Message = "已启动选品项目失效自动处理服务"
- }
- func (i selectioninvalidHandler) checkParam() error {
- return nil
- }
- func newSelectionInvalidHandler(ctx *gin.Context) *selectioninvalidHandler {
- return &selectioninvalidHandler{
- ctx: ctx,
- req: http_model.NewSelectionInvalidRequest(),
- resp: http_model.NewSelectionInvalidResponse(),
- }
- }
|