mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +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':
|
'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:
|
||||||
|
@ -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
|
||||||
|
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
|
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,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user