-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(user): 提交问卷返回提交时间, 统一认证返回用户剩余提交次数 #32
base: dev
Are you sure you want to change the base?
Conversation
// 从 redis 中获取用户的对该问卷的访问次数 | ||
item := "survey:" + strconv.Itoa(sid) + ":stu_id:" + stu_id | ||
var limit int | ||
var limit uint | ||
err := redis.RedisClient.Get(c, item).Scan(&limit) | ||
return limit, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果redis没有该键会返回什么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还会是0吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0
internal/handler/user/user.go
Outdated
code.AbortWithException(c, code.VoteLimitError, errors.New("投票次数已达上限")) | ||
return | ||
} | ||
} | ||
|
||
err = service.SubmitSurvey(data.ID, data.QuestionsList, time.Now().Format("2006-01-02 15:04:05")) | ||
submitTime := time.Now().Format("2006-01-02 15:04:05") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里建议改成time.DateTime,硬编码容易出错
No description provided.