Files
huangguo_server/app/api/signrecordctrl/signrecord.go
T
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

45 lines
1.2 KiB
Go
Executable File

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())
}