Start refactoring
This commit is contained in:
@@ -2,7 +2,6 @@ package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"opensavecloudserver/config"
|
||||
"opensavecloudserver/constant"
|
||||
"runtime"
|
||||
)
|
||||
@@ -10,20 +9,20 @@ import (
|
||||
type information struct {
|
||||
AllowRegister bool `json:"allow_register"`
|
||||
Version string `json:"version"`
|
||||
ApiVersion int `json:"api_version"`
|
||||
APIVersion int `json:"api_version"`
|
||||
GoVersion string `json:"go_version"`
|
||||
OsName string `json:"os_name"`
|
||||
OsArchitecture string `json:"os_architecture"`
|
||||
OSName string `json:"os_name"`
|
||||
OSArchitecture string `json:"os_architecture"`
|
||||
}
|
||||
|
||||
func Information(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *HTTPServer) Information(w http.ResponseWriter, r *http.Request) {
|
||||
info := information{
|
||||
AllowRegister: config.Features().AllowRegister,
|
||||
AllowRegister: s.config.Features.AllowRegister,
|
||||
Version: constant.Version,
|
||||
ApiVersion: constant.ApiVersion,
|
||||
APIVersion: constant.ApiVersion,
|
||||
GoVersion: runtime.Version(),
|
||||
OsName: runtime.GOOS,
|
||||
OsArchitecture: runtime.GOARCH,
|
||||
OSName: runtime.GOOS,
|
||||
OSArchitecture: runtime.GOARCH,
|
||||
}
|
||||
ok(info, w, r)
|
||||
ok(info, w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user