mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19:16 +00:00
updating account status
This commit is contained in:
parent
26ab4a12d0
commit
4a0acc9b9f
20
doc/api.oa3
20
doc/api.oa3
@ -376,7 +376,7 @@ paths:
|
||||
'500':
|
||||
description: internal server error
|
||||
|
||||
/account/disabled:
|
||||
/account/status:
|
||||
get:
|
||||
tags:
|
||||
- account
|
||||
@ -390,7 +390,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: boolean
|
||||
$ref: '#/components/schemas/AccountStatus'
|
||||
'401':
|
||||
description: authentication error
|
||||
'500':
|
||||
@ -3871,6 +3871,22 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
AccountStatus:
|
||||
type: object
|
||||
required:
|
||||
- disabled
|
||||
- storageUsed
|
||||
- storageAvailable
|
||||
properties:
|
||||
disabled:
|
||||
type: boolean
|
||||
storageUsed:
|
||||
type: number
|
||||
format: int64
|
||||
storageAvailable:
|
||||
type: number
|
||||
format: int64
|
||||
|
||||
Profile:
|
||||
type: object
|
||||
required:
|
||||
|
@ -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)
|
||||
|
||||
- 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
|
||||
|
19
net/server/internal/model_account_status.go
Normal file
19
net/server/internal/model_account_status.go
Normal 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"`
|
||||
}
|
@ -27,6 +27,15 @@ type Route struct {
|
||||
type Routes []Route
|
||||
|
||||
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)
|
||||
for _, route := range routes {
|
||||
var handler http.Handler
|
||||
@ -114,7 +123,7 @@ var routes = Routes{
|
||||
Route{
|
||||
"GetAccountStatus",
|
||||
strings.ToUpper("Get"),
|
||||
"/account/disabled",
|
||||
"/account/status",
|
||||
GetAccountStatus,
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user