fix: tier to use AccountTier struct

This commit is contained in:
Derrick Hammer 2024-01-17 12:38:52 -05:00
parent 1cf2d9880c
commit a5cbb4c4fb
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 28 additions and 7 deletions

View File

@ -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{

View File

@ -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"`
}