add server api get and update service control endpoints
This commit is contained in:
@@ -16,6 +16,25 @@ const (
|
||||
ServiceNamePrefix = "ACC-Server"
|
||||
)
|
||||
|
||||
// Server represents an ACC server instance
|
||||
type ServerAPI struct {
|
||||
Name string `json:"name"`
|
||||
Status ServiceStatus `json:"status"`
|
||||
State *ServerState `json:"state"`
|
||||
PlayerCount int `json:"playerCount"`
|
||||
Track string `json:"track"`
|
||||
}
|
||||
|
||||
func (s *Server) ToServerAPI() *ServerAPI {
|
||||
return &ServerAPI{
|
||||
Name: s.Name,
|
||||
Status: s.Status,
|
||||
State: s.State,
|
||||
PlayerCount: s.State.PlayerCount,
|
||||
Track: s.State.Track,
|
||||
}
|
||||
}
|
||||
|
||||
// Server represents an ACC server instance
|
||||
type Server struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;" json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user