mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-23 21:19:18 -06:00
Merge pull request #27 from butonic/provisinging-api-fixes
This commit is contained in:
@@ -1,20 +1,30 @@
|
||||
package data
|
||||
|
||||
// User holds the payload for a GetUser response
|
||||
type User struct {
|
||||
// TODO needs better naming, clarify if we need a userid, a username or both
|
||||
UserID string `json:"id" xml:"id"`
|
||||
Username string `json:"username" xml:"username"`
|
||||
DisplayName string `json:"displayname" xml:"displayname"`
|
||||
Email string `json:"email" xml:"email"`
|
||||
Enabled bool `json:"enabled" xml:"enabled"`
|
||||
}
|
||||
|
||||
// Users holds user ids for the user listing
|
||||
type Users struct {
|
||||
Users []string `json:"users" xml:"users>element"`
|
||||
}
|
||||
|
||||
// User holds the payload for a GetUser response
|
||||
type User struct {
|
||||
// TODO needs better naming, clarify if we need a userid, a username or both
|
||||
Enabled bool `json:"enabled" xml:"enabled"`
|
||||
UserID string `json:"id" xml:"id"`
|
||||
Username string `json:"username" xml:"username"`
|
||||
DisplayName string `json:"displayname" xml:"displayname"`
|
||||
Email string `json:"email" xml:"email"`
|
||||
Quota *Quota `json:"quota" xml:"quota"`
|
||||
}
|
||||
|
||||
// Quota holds quota information
|
||||
type Quota struct {
|
||||
Free int64 `json:"free" xml:"free"`
|
||||
Used int64 `json:"used" xml:"used"`
|
||||
Total int64 `json:"total" xml:"total"`
|
||||
Relative float32 `json:"relative" xml:"relative"`
|
||||
Definition string `json:"definition" xml:"definition"`
|
||||
}
|
||||
|
||||
// SigningKey holds the Payload for a GetSigningKey response
|
||||
type SigningKey struct {
|
||||
User string `json:"user" xml:"user"`
|
||||
|
||||
@@ -61,6 +61,15 @@ func (o Ocs) GetUser(w http.ResponseWriter, r *http.Request) {
|
||||
DisplayName: account.DisplayName,
|
||||
Email: account.Mail,
|
||||
Enabled: account.AccountEnabled,
|
||||
// FIXME only return quota for users/{userid} endpoint (not /user)
|
||||
// TODO query storage registry for free space? of home storage, maybe...
|
||||
Quota: &data.Quota{
|
||||
Free: 2840756224000,
|
||||
Used: 5059416668,
|
||||
Total: 2845815640668,
|
||||
Relative: 0.18,
|
||||
Definition: "default",
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user