feat(users): add preference to self
This commit is contained in:
parent
7ca5f5753f
commit
1f6fa6d370
1 changed files with 12 additions and 10 deletions
|
@ -620,11 +620,12 @@ func (h *MultiUsersSvc) isValidRole(role string) error {
|
|||
}
|
||||
|
||||
type SelfResp struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Role string `json:"role"`
|
||||
Quota *userstore.Quota `json:"quota"`
|
||||
UsedSpace int64 `json:"usedSpace,string"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Role string `json:"role"`
|
||||
Quota *userstore.Quota `json:"quota"`
|
||||
UsedSpace int64 `json:"usedSpace,string"`
|
||||
Preferences *userstore.Preferences `json:"preferences"`
|
||||
}
|
||||
|
||||
func (h *MultiUsersSvc) Self(c *gin.Context) {
|
||||
|
@ -641,11 +642,12 @@ func (h *MultiUsersSvc) Self(c *gin.Context) {
|
|||
}
|
||||
|
||||
c.JSON(200, &SelfResp{
|
||||
ID: claims[q.UserIDParam],
|
||||
Name: claims[q.UserParam],
|
||||
Role: claims[q.RoleParam],
|
||||
Quota: user.Quota,
|
||||
UsedSpace: user.UsedSpace,
|
||||
ID: claims[q.UserIDParam],
|
||||
Name: claims[q.UserParam],
|
||||
Role: claims[q.RoleParam],
|
||||
Quota: user.Quota,
|
||||
UsedSpace: user.UsedSpace,
|
||||
Preferences: user.Preferences,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue