1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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 WrapLinkOtherTimeOutHandler(ctx *gin.Context) {
- handler := newLinkOtherTimeOutHandler(ctx)
- BaseRun(handler)
- }
- type LinkOtherTimeOutHandler struct {
- ctx *gin.Context
- req *http_model.LinkOtherTimeOutRequest
- resp *http_model.CommonResponse
- }
- func (l LinkOtherTimeOutHandler) getContext() *gin.Context {
- return l.ctx
- }
- func (l LinkOtherTimeOutHandler) getResponse() interface{} {
- return l.resp
- }
- func (l LinkOtherTimeOutHandler) getRequest() interface{} {
- return l.req
- }
- func (l LinkOtherTimeOutHandler) run() {
- rate := l.req.Rate
- err := db.UpdateAutoDefaultRate(l.ctx, rate, 12)
- if err != nil {
- logrus.WithContext(l.ctx).Errorf("[LinkOtherTimeOutHandler] error UpdateAutoDefaultRate, err:%+v", err)
- util.HandlerPackErrorResp(l.resp, consts.ErrorInternal, consts.DefaultToast)
- return
- }
- l.resp.Message = "已更新自报价、固定稿费类型的链接违约超时未上传的扣款比率"
- }
- func (l LinkOtherTimeOutHandler) checkParam() error {
- return nil
- }
- func newLinkOtherTimeOutHandler(ctx *gin.Context) *LinkOtherTimeOutHandler {
- return &LinkOtherTimeOutHandler{
- ctx: ctx,
- req: http_model.NewLinkOtherTimeOutRequest(),
- resp: http_model.NewLinkOtherTimeOutResponse(),
- }
- }
|