This commit is contained in:
1 parent
f43fbef5db
commit
21abd01593
11 files changed
+450
-104
No files matched your search
@@ -1918,6 +1918,58 @@ func (h *Handler) WecomCheckinPage(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": page})
|
||||
}
|
||||
|
||||
// WecomCheckinPageAnonRequest is the body of POST /training/wecom/checkin-page-anon.
|
||||
// EmployeeNo 可选:非空时附带名单/重复标记(前端输入工号后即时提示)。
|
||||
type WecomCheckinPageAnonRequest struct {
|
||||
Token string `json:"token" binding:"required"`
|
||||
EmployeeNo string `json:"employee_no"`
|
||||
}
|
||||
|
||||
// WecomCheckinPageAnon POST /training/wecom/checkin-page-anon — 匿名落地页数据
|
||||
// (课程信息/倒计时,工号未输入时不含成员信息)。2026-11-25 调整:工号主流程。
|
||||
func (h *Handler) WecomCheckinPageAnon(c *gin.Context) {
|
||||
var req WecomCheckinPageAnonRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
_ = c.Error(errors.NewBadRequestError("缺少签到码").WithDetails(err.Error()))
|
||||
return
|
||||
}
|
||||
page, err := h.svc.WecomCheckinPageAnon(c.Request.Context(), req.Token, req.EmployeeNo)
|
||||
if err != nil {
|
||||
_ = c.Error(err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": page})
|
||||
}
|
||||
|
||||
// WecomCheckinByEmployeeRequest is the body of POST /training/wecom/checkin-by-employee.
|
||||
// Nonce 必带(需求规则 2:签到须提供随机时间戳防重放)。
|
||||
type WecomCheckinByEmployeeRequest struct {
|
||||
Token string `json:"token" binding:"required"`
|
||||
EmployeeNo string `json:"employee_no" binding:"required"`
|
||||
Nonce string `json:"nonce" binding:"required"`
|
||||
Lat float64 `json:"lat"`
|
||||
Lng float64 `json:"lng"`
|
||||
ClientTS int64 `json:"client_ts"`
|
||||
}
|
||||
|
||||
// WecomCheckinByEmployee POST /training/wecom/checkin-by-employee — 工号扫码
|
||||
// 签到:按签到规则校验 + 工号反查档案 + 自动登录(签发会话随响应返回)。
|
||||
// 匿名入口(noAuthAPI 白名单 + 签到专用限流),身份由「未过期签到码 token +
|
||||
// 名单内工号」承载;冒签风险经需求方确认接受,自动登录可由规则项关闭。
|
||||
func (h *Handler) WecomCheckinByEmployee(c *gin.Context) {
|
||||
var req WecomCheckinByEmployeeRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
_ = c.Error(errors.NewBadRequestError("请求参数不完整(签到码/工号/随机时间戳必填)").WithDetails(err.Error()))
|
||||
return
|
||||
}
|
||||
resp, err := h.svc.WecomCheckinByEmployee(c.Request.Context(), req.Token, req.EmployeeNo, req.Lat, req.Lng, req.Nonce, req.ClientTS)
|
||||
if err != nil {
|
||||
_ = c.Error(err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": resp})
|
||||
}
|
||||
|
||||
// ListSignRecords GET /training/sessions/:id/sign-records — 签到明细。
|
||||
func (h *Handler) ListSignRecords(c *gin.Context) {
|
||||
items, err := h.svc.ListSignRecords(c.Request.Context(), callerTenantID(c), c.Param("id"))
|
||||
|
||||
Reference in new issue
Block a user