updating account status

This commit is contained in:
balzack 2022-01-12 21:08:44 -08:00
parent 26ab4a12d0
commit 4a0acc9b9f
4 changed files with 48 additions and 4 deletions

View File

@ -376,7 +376,7 @@ paths:
'500': '500':
description: internal server error description: internal server error
/account/disabled: /account/status:
get: get:
tags: tags:
- account - account
@ -390,7 +390,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: boolean $ref: '#/components/schemas/AccountStatus'
'401': '401':
description: authentication error description: authentication error
'500': '500':
@ -3871,6 +3871,22 @@ components:
type: integer type: integer
format: int64 format: int64
AccountStatus:
type: object
required:
- disabled
- storageUsed
- storageAvailable
properties:
disabled:
type: boolean
storageUsed:
type: number
format: int64
storageAvailable:
type: number
format: int64
Profile: Profile:
type: object type: object
required: required:

View File

@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
- API version: 0.0.1 - API version: 0.0.1
- Build date: 2022-01-13T04:53:26.618Z[GMT] - Build date: 2022-01-13T05:04:37.485Z[GMT]
### Running the server ### Running the server

View File

@ -0,0 +1,19 @@
/*
* DataBag
*
* DataBag provides storage for decentralized identity based self-hosting apps. It is intended to support sharing of personal data and hosting group conversations.
*
* API version: 0.0.1
* Contact: roland.osborne@gmail.com
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package databag
type AccountStatus struct {
Disabled bool `json:"disabled"`
StorageUsed float64 `json:"storageUsed"`
StorageAvailable float64 `json:"storageAvailable"`
}

View File

@ -27,6 +27,15 @@ type Route struct {
type Routes []Route type Routes []Route
func NewRouter() *mux.Router { func NewRouter() *mux.Router {
// populate context
_configured = getBoolConfigValue(CONFIG_CONFIGURED, false);
_adminUsername = getStrConfigValue(CONFIG_USERNAME, "");
_adminPassword = getBinConfigValue(CONFIG_PASSWORD, nil);
_nodeDomain = getStrConfigValue(CONFIG_DOMAIN, "");
_publicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
_accountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
router := mux.NewRouter().StrictSlash(true) router := mux.NewRouter().StrictSlash(true)
for _, route := range routes { for _, route := range routes {
var handler http.Handler var handler http.Handler
@ -114,7 +123,7 @@ var routes = Routes{
Route{ Route{
"GetAccountStatus", "GetAccountStatus",
strings.ToUpper("Get"), strings.ToUpper("Get"),
"/account/disabled", "/account/status",
GetAccountStatus, GetAccountStatus,
}, },