21 lines
629 B
Go
21 lines
629 B
Go
package httpapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.yeij.top/AskaEth/Scoreboard/server/internal/auth"
|
|
"git.yeij.top/AskaEth/Scoreboard/server/internal/version"
|
|
)
|
|
|
|
// systemRoutes 挂载系统级只读信息。
|
|
func (s *server) systemRoutes(mux *http.ServeMux) {
|
|
// 内部署名是编译期注入的,不暴露给匿名访客:至少要登录(recorder 及以上)才能读到
|
|
mux.HandleFunc("GET /api/system/about", s.read(auth.RoleRecorder, s.systemAbout))
|
|
}
|
|
|
|
func (s *server) systemAbout(w http.ResponseWriter, r *http.Request) (any, error) {
|
|
return map[string]any{
|
|
"internalSignature": version.InternalSignature,
|
|
}, nil
|
|
}
|