feat(users): enable quota in handlers
This commit is contained in:
parent
75e10e6ad9
commit
e73947de0d
4 changed files with 60 additions and 34 deletions
|
@ -354,11 +354,19 @@ func (h *MultiUsersSvc) AddUser(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
spaceLimit := h.cfg.IntOr("Users.SpaceLimit", 1024)
|
||||
uploadSpeedLimit := h.cfg.IntOr("Users.UploadSpeedLimit", 100*1024)
|
||||
downloadSpeedLimit := h.cfg.IntOr("Users.DownloadSpeedLimit", 100*1024)
|
||||
err = h.deps.Users().AddUser(&userstore.User{
|
||||
ID: uid,
|
||||
Name: req.Name,
|
||||
Pwd: string(pwdHash),
|
||||
Role: req.Role,
|
||||
Quota: &userstore.Quota{
|
||||
SpaceLimit: spaceLimit,
|
||||
UploadSpeedLimit: uploadSpeedLimit,
|
||||
DownloadSpeedLimit: downloadSpeedLimit,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
c.JSON(q.ErrResp(c, 500, err))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue