mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 08:46:38 +08:00
add api handle for update user's max_calls attribute
This commit is contained in:
parent
7e1e408b64
commit
dd0130caf8
@ -193,6 +193,7 @@ func (s *Server) SetUserHandle(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, types.BizVo{Code: types.Failed, Message: "Invalid args"})
|
||||
return
|
||||
} else if maxCalls > 0 {
|
||||
user.MaxCalls = maxCalls
|
||||
user.RemainingCalls += maxCalls - user.MaxCalls
|
||||
if user.RemainingCalls < 0 {
|
||||
user.RemainingCalls = 0
|
||||
|
Loading…
Reference in New Issue
Block a user