fix: tier to use AccountTier struct
This commit is contained in:
parent
1cf2d9880c
commit
a5cbb4c4fb
|
@ -17,6 +17,7 @@ import (
|
|||
"go.sia.tech/jape"
|
||||
"go.uber.org/zap"
|
||||
"io"
|
||||
"math"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -529,7 +530,13 @@ func (h *HttpHandler) AccountInfo(jc jape.Context) {
|
|||
QuotaExceeded: false,
|
||||
EmailConfirmed: false,
|
||||
IsRestricted: false,
|
||||
Tier: 0,
|
||||
Tier: AccountTier{
|
||||
Id: 1,
|
||||
Name: "default",
|
||||
UploadBandwidth: math.MaxUint64,
|
||||
StorageLimit: math.MaxUint64,
|
||||
Scopes: []interface{}{},
|
||||
},
|
||||
}
|
||||
|
||||
jc.Encode(info)
|
||||
|
@ -544,7 +551,13 @@ func (h *HttpHandler) AccountStats(jc jape.Context) {
|
|||
QuotaExceeded: false,
|
||||
EmailConfirmed: false,
|
||||
IsRestricted: false,
|
||||
Tier: 0,
|
||||
Tier: AccountTier{
|
||||
Id: 1,
|
||||
Name: "default",
|
||||
UploadBandwidth: math.MaxUint64,
|
||||
StorageLimit: math.MaxUint64,
|
||||
Scopes: []interface{}{},
|
||||
},
|
||||
},
|
||||
Stats: AccountStats{
|
||||
Total: AccountStatsTotal{
|
||||
|
|
|
@ -27,7 +27,7 @@ type AccountInfoResponse struct {
|
|||
QuotaExceeded bool `json:"quotaExceeded"`
|
||||
EmailConfirmed bool `json:"emailConfirmed"`
|
||||
IsRestricted bool `json:"isRestricted"`
|
||||
Tier uint8 `json:"tier"`
|
||||
Tier AccountTier `json:"tier"`
|
||||
}
|
||||
|
||||
type AccountStatsResponse struct {
|
||||
|
@ -35,6 +35,14 @@ type AccountStatsResponse struct {
|
|||
Stats AccountStats `json:"stats"`
|
||||
}
|
||||
|
||||
type AccountTier struct {
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
UploadBandwidth uint64 `json:"uploadBandwidth"`
|
||||
StorageLimit uint64 `json:"storageLimit"`
|
||||
Scopes []interface{} `json:"scopes"`
|
||||
}
|
||||
|
||||
type AccountStats struct {
|
||||
Total AccountStatsTotal `json:"total"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue