32 lines
861 B
Go
32 lines
861 B
Go
package host
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
libapi "dev.sum7.eu/sum7/warehost/lib/api"
|
|
)
|
|
|
|
func domainList(ctx context.Context, w http.ResponseWriter, r *http.Request) (returndata interface{}, returnerr *libapi.ErrorResult) {
|
|
profil := ctx.Value("profil").(*Profil)
|
|
returndata = false
|
|
logger := log.GetLog(r, "domainlist")
|
|
var domain []*Domain
|
|
dbconnection.Where("profil = ?", profil.ID).Find(&domain)
|
|
logger.Info("done")
|
|
returndata = domain
|
|
return
|
|
}
|
|
|
|
func databaseList(ctx context.Context, w http.ResponseWriter, r *http.Request) (returndata interface{}, returnerr *libapi.ErrorResult) {
|
|
profil := ctx.Value("profil").(*Profil)
|
|
returndata = false
|
|
logger := log.GetLog(r, "databaselist")
|
|
var database []*Database
|
|
dbconnection.Where("profil = ?", profil.ID).Find(&database)
|
|
logger.Info("done")
|
|
returndata = database
|
|
return
|
|
}
|