2022-01-11 06:20:32 +00:00
|
|
|
/*
|
|
|
|
* 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-databag/swagger-codegen.git)
|
|
|
|
*/
|
|
|
|
package databag
|
|
|
|
|
|
|
|
import (
|
2022-01-12 07:04:27 +00:00
|
|
|
"errors"
|
2022-01-11 06:20:32 +00:00
|
|
|
"net/http"
|
2022-01-12 07:04:27 +00:00
|
|
|
"gorm.io/gorm"
|
|
|
|
store "databag/internal/store"
|
2022-01-11 06:20:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func AddNodeAccount(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetNodeAccountImage(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetNodeAccounts(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetNodeClaimable(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
2022-01-12 07:04:27 +00:00
|
|
|
|
|
|
|
var config store.Config
|
|
|
|
err := store.DB.Where("config_id = ?", CONFIG_CLAIMED).First(&config).Error;
|
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
} else {
|
|
|
|
w.WriteHeader(http.StatusNotAcceptable)
|
|
|
|
}
|
2022-01-11 06:20:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RemoveNodeAccount(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetNodeAccount(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetNodeClaim(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
}
|