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 {
|
type SelfResp struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Role string `json:"role"`
|
Role string `json:"role"`
|
||||||
Quota *userstore.Quota `json:"quota"`
|
Quota *userstore.Quota `json:"quota"`
|
||||||
UsedSpace int64 `json:"usedSpace,string"`
|
UsedSpace int64 `json:"usedSpace,string"`
|
||||||
|
Preferences *userstore.Preferences `json:"preferences"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *MultiUsersSvc) Self(c *gin.Context) {
|
func (h *MultiUsersSvc) Self(c *gin.Context) {
|
||||||
|
@ -641,11 +642,12 @@ func (h *MultiUsersSvc) Self(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(200, &SelfResp{
|
c.JSON(200, &SelfResp{
|
||||||
ID: claims[q.UserIDParam],
|
ID: claims[q.UserIDParam],
|
||||||
Name: claims[q.UserParam],
|
Name: claims[q.UserParam],
|
||||||
Role: claims[q.RoleParam],
|
Role: claims[q.RoleParam],
|
||||||
Quota: user.Quota,
|
Quota: user.Quota,
|
||||||
UsedSpace: user.UsedSpace,
|
UsedSpace: user.UsedSpace,
|
||||||
|
Preferences: user.Preferences,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue