Executable
+44
@@ -0,0 +1,44 @@
|
||||
package signrecordctrl
|
||||
|
||||
import (
|
||||
"91porn-server/app/service/signrecordser"
|
||||
"91porn-server/common"
|
||||
"91porn-server/common/log"
|
||||
"91porn-server/common/stderr"
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// AgainSign doc
|
||||
// @Summary 补签打卡接口
|
||||
// @Description 补签打卡
|
||||
// @Tags 移动端-补签打卡
|
||||
// @Accept mpfd,json
|
||||
// @Produce json
|
||||
// @Param q query signrecordser.AppReSignReq false "请求参数"
|
||||
// @Success 200 {string} json "{"msg": "操作成功"}"
|
||||
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
||||
// @Router /api/app/sign_record/resign [post]
|
||||
func AgainSign(ctx *gin.Context) {
|
||||
uid, err := common.GetUID(ctx)
|
||||
if err != nil {
|
||||
common.ServeJSON(ctx, stderr.ErrNoToken, nil)
|
||||
return
|
||||
}
|
||||
p := &signrecordser.AppReSignReq{}
|
||||
if err := ctx.ShouldBind(&p); err != nil {
|
||||
log.Error(fmt.Sprintf("uid:%v,resign param is err:%v", uid, err))
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
|
||||
code, err := p.ReSign(uid)
|
||||
if code != stderr.Success {
|
||||
log.Error(fmt.Sprintf("uid:%v,resign is err:%v", uid, err))
|
||||
common.ServeJSON(ctx, code, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
common.ServeJSON(ctx, stderr.Success, stderr.Success.Msg())
|
||||
}
|
||||
Reference in New Issue
Block a user