Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1683d5c2f1 | ||
|
|
87d4af0bec | ||
|
|
35449a090d | ||
|
|
5324a41e05 | ||
|
|
ac61ba5223 |
@@ -5,14 +5,14 @@
|
|||||||
// @description API for managing Assetto Corsa Competizione dedicated servers
|
// @description API for managing Assetto Corsa Competizione dedicated servers
|
||||||
//
|
//
|
||||||
// @contact.name ACC Server Manager Support
|
// @contact.name ACC Server Manager Support
|
||||||
// @contact.url https://github.com/yourusername/acc-server-manager
|
// @contact.url https://github.com/FJurmanovic/acc-server-manager
|
||||||
//
|
//
|
||||||
// @license.name MIT
|
// @license.name MIT
|
||||||
// @license.url https://opensource.org/licenses/MIT
|
// @license.url https://opensource.org/licenses/MIT
|
||||||
//
|
//
|
||||||
// @host localhost:3000
|
// @host acc-api.jurmanovic.com
|
||||||
// @BasePath /api/v1
|
// @BasePath /v1
|
||||||
// @schemes http https
|
// @schemes https
|
||||||
//
|
//
|
||||||
// @securityDefinitions.apikey BearerAuth
|
// @securityDefinitions.apikey BearerAuth
|
||||||
// @in header
|
// @in header
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ func NewConfigController(as *service.ConfigService, routeGroups *common.RouteGro
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Server or config file not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Server or config file not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server/{id}/config/{file} [put]
|
// @Router /server/{id}/config/{file} [put]
|
||||||
func (ac *ConfigController) UpdateConfig(c *fiber.Ctx) error {
|
func (ac *ConfigController) UpdateConfig(c *fiber.Ctx) error {
|
||||||
restart := c.QueryBool("restart")
|
restart := c.QueryBool("restart")
|
||||||
serverID := c.Params("id")
|
serverID := c.Params("id")
|
||||||
@@ -106,7 +106,7 @@ func (ac *ConfigController) UpdateConfig(c *fiber.Ctx) error {
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Server or config file not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Server or config file not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server/{id}/config/{file} [get]
|
// @Router /server/{id}/config/{file} [get]
|
||||||
func (ac *ConfigController) GetConfig(c *fiber.Ctx) error {
|
func (ac *ConfigController) GetConfig(c *fiber.Ctx) error {
|
||||||
Model, err := ac.service.GetConfig(c)
|
Model, err := ac.service.GetConfig(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -130,7 +130,7 @@ func (ac *ConfigController) GetConfig(c *fiber.Ctx) error {
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server/{id}/config [get]
|
// @Router /server/{id}/config [get]
|
||||||
func (ac *ConfigController) GetConfigs(c *fiber.Ctx) error {
|
func (ac *ConfigController) GetConfigs(c *fiber.Ctx) error {
|
||||||
Model, err := ac.service.GetConfigs(c)
|
Model, err := ac.service.GetConfigs(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func NewLookupController(as *service.LookupService, routeGroups *common.RouteGro
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/lookup/tracks [get]
|
// @Router /lookup/tracks [get]
|
||||||
func (ac *LookupController) GetTracks(c *fiber.Ctx) error {
|
func (ac *LookupController) GetTracks(c *fiber.Ctx) error {
|
||||||
result, err := ac.service.GetTracks(c)
|
result, err := ac.service.GetTracks(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -66,7 +66,7 @@ func (ac *LookupController) GetTracks(c *fiber.Ctx) error {
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/lookup/car-models [get]
|
// @Router /lookup/car-models [get]
|
||||||
func (ac *LookupController) GetCarModels(c *fiber.Ctx) error {
|
func (ac *LookupController) GetCarModels(c *fiber.Ctx) error {
|
||||||
result, err := ac.service.GetCarModels(c)
|
result, err := ac.service.GetCarModels(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -86,7 +86,7 @@ func (ac *LookupController) GetCarModels(c *fiber.Ctx) error {
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/lookup/driver-categories [get]
|
// @Router /lookup/driver-categories [get]
|
||||||
func (ac *LookupController) GetDriverCategories(c *fiber.Ctx) error {
|
func (ac *LookupController) GetDriverCategories(c *fiber.Ctx) error {
|
||||||
result, err := ac.service.GetDriverCategories(c)
|
result, err := ac.service.GetDriverCategories(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -106,7 +106,7 @@ func (ac *LookupController) GetDriverCategories(c *fiber.Ctx) error {
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/lookup/cup-categories [get]
|
// @Router /lookup/cup-categories [get]
|
||||||
func (ac *LookupController) GetCupCategories(c *fiber.Ctx) error {
|
func (ac *LookupController) GetCupCategories(c *fiber.Ctx) error {
|
||||||
result, err := ac.service.GetCupCategories(c)
|
result, err := ac.service.GetCupCategories(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -126,7 +126,7 @@ func (ac *LookupController) GetCupCategories(c *fiber.Ctx) error {
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/lookup/session-types [get]
|
// @Router /lookup/session-types [get]
|
||||||
func (ac *LookupController) GetSessionTypes(c *fiber.Ctx) error {
|
func (ac *LookupController) GetSessionTypes(c *fiber.Ctx) error {
|
||||||
result, err := ac.service.GetSessionTypes(c)
|
result, err := ac.service.GetSessionTypes(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -139,6 +139,18 @@ func (mc *MembershipController) ListUsers(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetUser gets a single user by ID.
|
// GetUser gets a single user by ID.
|
||||||
|
// @Summary Get user by ID
|
||||||
|
// @Description Get detailed information about a specific user
|
||||||
|
// @Tags User Management
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "User ID (UUID format)"
|
||||||
|
// @Success 200 {object} model.User "User details"
|
||||||
|
// @Failure 400 {object} error_handler.ErrorResponse "Invalid user ID format"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 404 {object} error_handler.ErrorResponse "User not found"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /membership/{id} [get]
|
||||||
func (mc *MembershipController) GetUser(c *fiber.Ctx) error {
|
func (mc *MembershipController) GetUser(c *fiber.Ctx) error {
|
||||||
id, err := uuid.Parse(c.Params("id"))
|
id, err := uuid.Parse(c.Params("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -154,6 +166,16 @@ func (mc *MembershipController) GetUser(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetMe returns the currently authenticated user's details.
|
// GetMe returns the currently authenticated user's details.
|
||||||
|
// @Summary Get current user details
|
||||||
|
// @Description Get details of the currently authenticated user
|
||||||
|
// @Tags Authentication
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Success 200 {object} model.User "Current user details"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 404 {object} error_handler.ErrorResponse "User not found"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /auth/me [get]
|
||||||
func (mc *MembershipController) GetMe(c *fiber.Ctx) error {
|
func (mc *MembershipController) GetMe(c *fiber.Ctx) error {
|
||||||
userID, ok := c.Locals("userID").(string)
|
userID, ok := c.Locals("userID").(string)
|
||||||
if !ok || userID == "" {
|
if !ok || userID == "" {
|
||||||
@@ -172,6 +194,19 @@ func (mc *MembershipController) GetMe(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DeleteUser deletes a user.
|
// DeleteUser deletes a user.
|
||||||
|
// @Summary Delete user
|
||||||
|
// @Description Delete a specific user by ID
|
||||||
|
// @Tags User Management
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "User ID (UUID format)"
|
||||||
|
// @Success 204 "User successfully deleted"
|
||||||
|
// @Failure 400 {object} error_handler.ErrorResponse "Invalid user ID format"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
||||||
|
// @Failure 404 {object} error_handler.ErrorResponse "User not found"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /membership/{id} [delete]
|
||||||
func (mc *MembershipController) DeleteUser(c *fiber.Ctx) error {
|
func (mc *MembershipController) DeleteUser(c *fiber.Ctx) error {
|
||||||
id, err := uuid.Parse(c.Params("id"))
|
id, err := uuid.Parse(c.Params("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -187,6 +222,20 @@ func (mc *MembershipController) DeleteUser(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UpdateUser updates a user.
|
// UpdateUser updates a user.
|
||||||
|
// @Summary Update user
|
||||||
|
// @Description Update user details by ID
|
||||||
|
// @Tags User Management
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "User ID (UUID format)"
|
||||||
|
// @Param user body service.UpdateUserRequest true "Updated user details"
|
||||||
|
// @Success 200 {object} model.User "Updated user details"
|
||||||
|
// @Failure 400 {object} error_handler.ErrorResponse "Invalid request body or ID format"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
||||||
|
// @Failure 404 {object} error_handler.ErrorResponse "User not found"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /membership/{id} [put]
|
||||||
func (mc *MembershipController) UpdateUser(c *fiber.Ctx) error {
|
func (mc *MembershipController) UpdateUser(c *fiber.Ctx) error {
|
||||||
id, err := uuid.Parse(c.Params("id"))
|
id, err := uuid.Parse(c.Params("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -207,6 +256,17 @@ func (mc *MembershipController) UpdateUser(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetRoles returns all available roles.
|
// GetRoles returns all available roles.
|
||||||
|
// @Summary Get all roles
|
||||||
|
// @Description Get a list of all available user roles
|
||||||
|
// @Tags User Management
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Success 200 {array} model.Role "List of roles"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
||||||
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /membership/roles [get]
|
||||||
func (mc *MembershipController) GetRoles(c *fiber.Ctx) error {
|
func (mc *MembershipController) GetRoles(c *fiber.Ctx) error {
|
||||||
roles, err := mc.service.GetAllRoles(c.UserContext())
|
roles, err := mc.service.GetAllRoles(c.UserContext())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func NewServerController(ss *service.ServerService, routeGroups *common.RouteGro
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /server [get]
|
// @Router /api/server [get]
|
||||||
func (ac *ServerController) GetAllApi(c *fiber.Ctx) error {
|
func (ac *ServerController) GetAllApi(c *fiber.Ctx) error {
|
||||||
var filter model.ServerFilter
|
var filter model.ServerFilter
|
||||||
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
||||||
@@ -79,7 +79,7 @@ func (ac *ServerController) GetAllApi(c *fiber.Ctx) error {
|
|||||||
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server [get]
|
// @Router /server [get]
|
||||||
func (ac *ServerController) GetAll(c *fiber.Ctx) error {
|
func (ac *ServerController) GetAll(c *fiber.Ctx) error {
|
||||||
var filter model.ServerFilter
|
var filter model.ServerFilter
|
||||||
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
||||||
@@ -105,7 +105,7 @@ func (ac *ServerController) GetAll(c *fiber.Ctx) error {
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server/{id} [get]
|
// @Router /server/{id} [get]
|
||||||
func (ac *ServerController) GetById(c *fiber.Ctx) error {
|
func (ac *ServerController) GetById(c *fiber.Ctx) error {
|
||||||
serverIDStr := c.Params("id")
|
serverIDStr := c.Params("id")
|
||||||
serverID, err := uuid.Parse(serverIDStr)
|
serverID, err := uuid.Parse(serverIDStr)
|
||||||
@@ -133,7 +133,7 @@ func (ac *ServerController) GetById(c *fiber.Ctx) error {
|
|||||||
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server [post]
|
// @Router /server [post]
|
||||||
func (ac *ServerController) CreateServer(c *fiber.Ctx) error {
|
func (ac *ServerController) CreateServer(c *fiber.Ctx) error {
|
||||||
server := new(model.Server)
|
server := new(model.Server)
|
||||||
if err := c.BodyParser(server); err != nil {
|
if err := c.BodyParser(server); err != nil {
|
||||||
@@ -161,7 +161,7 @@ func (ac *ServerController) CreateServer(c *fiber.Ctx) error {
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/server/{id} [put]
|
// @Router /server/{id} [put]
|
||||||
func (ac *ServerController) UpdateServer(c *fiber.Ctx) error {
|
func (ac *ServerController) UpdateServer(c *fiber.Ctx) error {
|
||||||
serverIDStr := c.Params("id")
|
serverIDStr := c.Params("id")
|
||||||
serverID, err := uuid.Parse(serverIDStr)
|
serverID, err := uuid.Parse(serverIDStr)
|
||||||
@@ -181,7 +181,21 @@ func (ac *ServerController) UpdateServer(c *fiber.Ctx) error {
|
|||||||
return c.JSON(server)
|
return c.JSON(server)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteServer deletes a server
|
// DeleteServer deletes an existing server
|
||||||
|
// @Summary Delete an ACC server
|
||||||
|
// @Description Delete an existing ACC server
|
||||||
|
// @Tags Server
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "Server ID (UUID format)"
|
||||||
|
// @Success 200 {object} object "Deleted server details"
|
||||||
|
// @Failure 400 {object} error_handler.ErrorResponse "Invalid server data or ID"
|
||||||
|
// @Failure 401 {object} error_handler.ErrorResponse "Unauthorized"
|
||||||
|
// @Failure 403 {object} error_handler.ErrorResponse "Insufficient permissions"
|
||||||
|
// @Failure 404 {object} error_handler.ErrorResponse "Server not found"
|
||||||
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Router /server/{id} [delete]
|
||||||
func (ac *ServerController) DeleteServer(c *fiber.Ctx) error {
|
func (ac *ServerController) DeleteServer(c *fiber.Ctx) error {
|
||||||
serverIDStr := c.Params("id")
|
serverIDStr := c.Params("id")
|
||||||
serverID, err := uuid.Parse(serverIDStr)
|
serverID, err := uuid.Parse(serverIDStr)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func NewServiceControlController(as *service.ServiceControlService, routeGroups
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Service not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Service not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/service-control/{service} [get]
|
// @Router /server/{id}/service/{service} [get]
|
||||||
func (ac *ServiceControlController) getStatus(c *fiber.Ctx) error {
|
func (ac *ServiceControlController) getStatus(c *fiber.Ctx) error {
|
||||||
id := c.Params("id")
|
id := c.Params("id")
|
||||||
c.Locals("serverId", id)
|
c.Locals("serverId", id)
|
||||||
@@ -78,7 +78,7 @@ func (ac *ServiceControlController) getStatus(c *fiber.Ctx) error {
|
|||||||
// @Failure 409 {object} error_handler.ErrorResponse "Service already running"
|
// @Failure 409 {object} error_handler.ErrorResponse "Service already running"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/service-control/start [post]
|
// @Router /server/{id}/service/start [post]
|
||||||
func (ac *ServiceControlController) startServer(c *fiber.Ctx) error {
|
func (ac *ServiceControlController) startServer(c *fiber.Ctx) error {
|
||||||
id := c.Params("id")
|
id := c.Params("id")
|
||||||
c.Locals("serverId", id)
|
c.Locals("serverId", id)
|
||||||
@@ -105,7 +105,7 @@ func (ac *ServiceControlController) startServer(c *fiber.Ctx) error {
|
|||||||
// @Failure 409 {object} error_handler.ErrorResponse "Service already stopped"
|
// @Failure 409 {object} error_handler.ErrorResponse "Service already stopped"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/service-control/stop [post]
|
// @Router /server/{id}/service/stop [post]
|
||||||
func (ac *ServiceControlController) stopServer(c *fiber.Ctx) error {
|
func (ac *ServiceControlController) stopServer(c *fiber.Ctx) error {
|
||||||
id := c.Params("id")
|
id := c.Params("id")
|
||||||
c.Locals("serverId", id)
|
c.Locals("serverId", id)
|
||||||
@@ -131,7 +131,7 @@ func (ac *ServiceControlController) stopServer(c *fiber.Ctx) error {
|
|||||||
// @Failure 404 {object} error_handler.ErrorResponse "Service not found"
|
// @Failure 404 {object} error_handler.ErrorResponse "Service not found"
|
||||||
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
// @Failure 500 {object} error_handler.ErrorResponse "Internal server error"
|
||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /v1/service-control/restart [post]
|
// @Router /server/{id}/service/restart [post]
|
||||||
func (ac *ServiceControlController) restartServer(c *fiber.Ctx) error {
|
func (ac *ServiceControlController) restartServer(c *fiber.Ctx) error {
|
||||||
id := c.Params("id")
|
id := c.Params("id")
|
||||||
c.Locals("serverId", id)
|
c.Locals("serverId", id)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func NewStateHistoryController(as *service.StateHistoryService, routeGroups *com
|
|||||||
// @Description Return StateHistorys
|
// @Description Return StateHistorys
|
||||||
// @Tags StateHistory
|
// @Tags StateHistory
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Router /v1/state-history [get]
|
// @Router /state-history [get]
|
||||||
func (ac *StateHistoryController) GetAll(c *fiber.Ctx) error {
|
func (ac *StateHistoryController) GetAll(c *fiber.Ctx) error {
|
||||||
var filter model.StateHistoryFilter
|
var filter model.StateHistoryFilter
|
||||||
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
||||||
@@ -63,7 +63,7 @@ func (ac *StateHistoryController) GetAll(c *fiber.Ctx) error {
|
|||||||
// @Description Return StateHistorys
|
// @Description Return StateHistorys
|
||||||
// @Tags StateHistory
|
// @Tags StateHistory
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Router /v1/state-history/statistics [get]
|
// @Router /state-history/statistics [get]
|
||||||
func (ac *StateHistoryController) GetStatistics(c *fiber.Ctx) error {
|
func (ac *StateHistoryController) GetStatistics(c *fiber.Ctx) error {
|
||||||
var filter model.StateHistoryFilter
|
var filter model.StateHistoryFilter
|
||||||
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ func NewSystemController(routeGroups *common.RouteGroups) *SystemController {
|
|||||||
//
|
//
|
||||||
// @Summary Return service control status
|
// @Summary Return service control status
|
||||||
// @Description Return service control status
|
// @Description Return service control status
|
||||||
// @Tags service-control
|
// @Tags system
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Router /v1/service-control [get]
|
// @Router /system/health [get]
|
||||||
func (ac *SystemController) getFirst(c *fiber.Ctx) error {
|
func (ac *SystemController) getFirst(c *fiber.Ctx) error {
|
||||||
return c.SendString(configs.Version)
|
return c.SendString(configs.Version)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Version = "0.10.2"
|
Version = "0.10.3"
|
||||||
Prefix = "v1"
|
Prefix = "v1"
|
||||||
Secret string
|
Secret string
|
||||||
SecretCode string
|
SecretCode string
|
||||||
|
|||||||
921
swagger/docs.go
921
swagger/docs.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
basePath: /api/v1
|
basePath: /v1
|
||||||
definitions:
|
definitions:
|
||||||
error_handler.ErrorResponse:
|
error_handler.ErrorResponse:
|
||||||
properties:
|
properties:
|
||||||
@@ -103,11 +103,20 @@ definitions:
|
|||||||
username:
|
username:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
host: localhost:3000
|
service.UpdateUserRequest:
|
||||||
|
properties:
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
roleId:
|
||||||
|
type: string
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
host: acc-api.jurmanovic.com
|
||||||
info:
|
info:
|
||||||
contact:
|
contact:
|
||||||
name: ACC Server Manager Support
|
name: ACC Server Manager Support
|
||||||
url: https://github.com/yourusername/acc-server-manager
|
url: https://github.com/FJurmanovic/acc-server-manager
|
||||||
description: API for managing Assetto Corsa Competizione dedicated servers
|
description: API for managing Assetto Corsa Competizione dedicated servers
|
||||||
license:
|
license:
|
||||||
name: MIT
|
name: MIT
|
||||||
@@ -115,6 +124,62 @@ info:
|
|||||||
title: ACC Server Manager API
|
title: ACC Server Manager API
|
||||||
version: "1.0"
|
version: "1.0"
|
||||||
paths:
|
paths:
|
||||||
|
/api/server:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all ACC servers with filtering options
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: name
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: page
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: pageSize
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: serverID
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: serviceName
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: sortBy
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: sortDesc
|
||||||
|
type: boolean
|
||||||
|
- in: query
|
||||||
|
name: status
|
||||||
|
type: string
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of servers
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/model.ServerAPI'
|
||||||
|
type: array
|
||||||
|
"400":
|
||||||
|
description: Invalid filter parameters
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: List all servers (API format)
|
||||||
|
tags:
|
||||||
|
- Server
|
||||||
/auth/login:
|
/auth/login:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
@@ -157,6 +222,198 @@ paths:
|
|||||||
summary: User login
|
summary: User login
|
||||||
tags:
|
tags:
|
||||||
- Authentication
|
- Authentication
|
||||||
|
/auth/me:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get details of the currently authenticated user
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Current user details
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/model.User'
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"404":
|
||||||
|
description: User not found
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get current user details
|
||||||
|
tags:
|
||||||
|
- Authentication
|
||||||
|
/lookup/car-models:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all available ACC car models with their identifiers
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of car models
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
class:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get available car models
|
||||||
|
tags:
|
||||||
|
- Lookups
|
||||||
|
/lookup/cup-categories:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all available racing cup categories
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of cup categories
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: number
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get cup categories
|
||||||
|
tags:
|
||||||
|
- Lookups
|
||||||
|
/lookup/driver-categories:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all driver categories (Bronze, Silver, Gold, Platinum)
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of driver categories
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: number
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get driver categories
|
||||||
|
tags:
|
||||||
|
- Lookups
|
||||||
|
/lookup/session-types:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all available session types (Practice, Qualifying,
|
||||||
|
Race)
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of session types
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get session types
|
||||||
|
tags:
|
||||||
|
- Lookups
|
||||||
|
/lookup/tracks:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all available ACC tracks with their identifiers
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of tracks
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get available tracks
|
||||||
|
tags:
|
||||||
|
- Lookups
|
||||||
/membership:
|
/membership:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
@@ -238,117 +495,141 @@ paths:
|
|||||||
summary: Create a new user
|
summary: Create a new user
|
||||||
tags:
|
tags:
|
||||||
- User Management
|
- User Management
|
||||||
/server:
|
/membership/{id}:
|
||||||
get:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Get a list of all ACC servers with filtering options
|
description: Delete a specific user by ID
|
||||||
parameters:
|
parameters:
|
||||||
- in: query
|
- description: User ID (UUID format)
|
||||||
name: name
|
in: path
|
||||||
type: string
|
name: id
|
||||||
- in: query
|
required: true
|
||||||
name: page
|
|
||||||
type: integer
|
|
||||||
- in: query
|
|
||||||
name: pageSize
|
|
||||||
type: integer
|
|
||||||
- in: query
|
|
||||||
name: serverID
|
|
||||||
type: string
|
|
||||||
- in: query
|
|
||||||
name: serviceName
|
|
||||||
type: string
|
|
||||||
- in: query
|
|
||||||
name: sortBy
|
|
||||||
type: string
|
|
||||||
- in: query
|
|
||||||
name: sortDesc
|
|
||||||
type: boolean
|
|
||||||
- in: query
|
|
||||||
name: status
|
|
||||||
type: string
|
type: string
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"204":
|
||||||
description: List of servers
|
description: User successfully deleted
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/definitions/model.ServerAPI'
|
|
||||||
type: array
|
|
||||||
"400":
|
"400":
|
||||||
description: Invalid filter parameters
|
description: Invalid user ID format
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
"401":
|
"401":
|
||||||
description: Unauthorized
|
description: Unauthorized
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
"500":
|
"403":
|
||||||
description: Internal server error
|
description: Insufficient permissions
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"404":
|
||||||
|
description: User not found
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
summary: List all servers (API format)
|
summary: Delete user
|
||||||
tags:
|
tags:
|
||||||
- Server
|
- User Management
|
||||||
/v1/lookup/car-models:
|
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Get a list of all available ACC car models with their identifiers
|
description: Get detailed information about a specific user
|
||||||
|
parameters:
|
||||||
|
- description: User ID (UUID format)
|
||||||
|
in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: List of car models
|
description: User details
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/model.User'
|
||||||
|
"400":
|
||||||
|
description: Invalid user ID format
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"404":
|
||||||
|
description: User not found
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Get user by ID
|
||||||
|
tags:
|
||||||
|
- User Management
|
||||||
|
put:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Update user details by ID
|
||||||
|
parameters:
|
||||||
|
- description: User ID (UUID format)
|
||||||
|
in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- description: Updated user details
|
||||||
|
in: body
|
||||||
|
name: user
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/service.UpdateUserRequest'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Updated user details
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/model.User'
|
||||||
|
"400":
|
||||||
|
description: Invalid request body or ID format
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"403":
|
||||||
|
description: Insufficient permissions
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"404":
|
||||||
|
description: User not found
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Update user
|
||||||
|
tags:
|
||||||
|
- User Management
|
||||||
|
/membership/roles:
|
||||||
|
get:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Get a list of all available user roles
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: List of roles
|
||||||
schema:
|
schema:
|
||||||
items:
|
items:
|
||||||
properties:
|
$ref: '#/definitions/model.Role'
|
||||||
class:
|
|
||||||
type: string
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
type: array
|
||||||
"401":
|
"401":
|
||||||
description: Unauthorized
|
description: Unauthorized
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
"500":
|
"403":
|
||||||
description: Internal server error
|
description: Insufficient permissions
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
security:
|
|
||||||
- BearerAuth: []
|
|
||||||
summary: Get available car models
|
|
||||||
tags:
|
|
||||||
- Lookups
|
|
||||||
/v1/lookup/cup-categories:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Get a list of all available racing cup categories
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: List of cup categories
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: number
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
"401":
|
|
||||||
description: Unauthorized
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
"500":
|
"500":
|
||||||
@@ -357,111 +638,10 @@ paths:
|
|||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
summary: Get cup categories
|
summary: Get all roles
|
||||||
tags:
|
tags:
|
||||||
- Lookups
|
- User Management
|
||||||
/v1/lookup/driver-categories:
|
/server:
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Get a list of all driver categories (Bronze, Silver, Gold, Platinum)
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: List of driver categories
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
description:
|
|
||||||
type: string
|
|
||||||
id:
|
|
||||||
type: number
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
"401":
|
|
||||||
description: Unauthorized
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
"500":
|
|
||||||
description: Internal server error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
security:
|
|
||||||
- BearerAuth: []
|
|
||||||
summary: Get driver categories
|
|
||||||
tags:
|
|
||||||
- Lookups
|
|
||||||
/v1/lookup/session-types:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Get a list of all available session types (Practice, Qualifying,
|
|
||||||
Race)
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: List of session types
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
"401":
|
|
||||||
description: Unauthorized
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
"500":
|
|
||||||
description: Internal server error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
security:
|
|
||||||
- BearerAuth: []
|
|
||||||
summary: Get session types
|
|
||||||
tags:
|
|
||||||
- Lookups
|
|
||||||
/v1/lookup/tracks:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Get a list of all available ACC tracks with their identifiers
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: List of tracks
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
"401":
|
|
||||||
description: Unauthorized
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
"500":
|
|
||||||
description: Internal server error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
|
||||||
security:
|
|
||||||
- BearerAuth: []
|
|
||||||
summary: Get available tracks
|
|
||||||
tags:
|
|
||||||
- Lookups
|
|
||||||
/v1/server:
|
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -556,7 +736,49 @@ paths:
|
|||||||
summary: Create a new ACC server
|
summary: Create a new ACC server
|
||||||
tags:
|
tags:
|
||||||
- Server
|
- Server
|
||||||
/v1/server/{id}:
|
/server/{id}:
|
||||||
|
delete:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Delete an existing ACC server
|
||||||
|
parameters:
|
||||||
|
- description: Server ID (UUID format)
|
||||||
|
in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Deleted server details
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
"400":
|
||||||
|
description: Invalid server data or ID
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"403":
|
||||||
|
description: Insufficient permissions
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"404":
|
||||||
|
description: Server not found
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
"500":
|
||||||
|
description: Internal server error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Delete an ACC server
|
||||||
|
tags:
|
||||||
|
- Server
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -643,7 +865,7 @@ paths:
|
|||||||
summary: Update an ACC server
|
summary: Update an ACC server
|
||||||
tags:
|
tags:
|
||||||
- Server
|
- Server
|
||||||
/v1/server/{id}/config:
|
/server/{id}/config:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -688,7 +910,7 @@ paths:
|
|||||||
summary: List available configuration files
|
summary: List available configuration files
|
||||||
tags:
|
tags:
|
||||||
- Server Configuration
|
- Server Configuration
|
||||||
/v1/server/{id}/config/{file}:
|
/server/{id}/config/{file}:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -792,20 +1014,7 @@ paths:
|
|||||||
summary: Update server configuration file
|
summary: Update server configuration file
|
||||||
tags:
|
tags:
|
||||||
- Server Configuration
|
- Server Configuration
|
||||||
/v1/service-control:
|
/server/{id}/service/{service}:
|
||||||
get:
|
|
||||||
description: Return service control status
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
summary: Return service control status
|
|
||||||
tags:
|
|
||||||
- service-control
|
|
||||||
/v1/service-control/{service}:
|
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -849,7 +1058,7 @@ paths:
|
|||||||
summary: Get service status
|
summary: Get service status
|
||||||
tags:
|
tags:
|
||||||
- Service Control
|
- Service Control
|
||||||
/v1/service-control/restart:
|
/server/{id}/service/restart:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -899,7 +1108,7 @@ paths:
|
|||||||
summary: Restart a Windows service
|
summary: Restart a Windows service
|
||||||
tags:
|
tags:
|
||||||
- Service Control
|
- Service Control
|
||||||
/v1/service-control/start:
|
/server/{id}/service/start:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -953,7 +1162,7 @@ paths:
|
|||||||
summary: Start a Windows service
|
summary: Start a Windows service
|
||||||
tags:
|
tags:
|
||||||
- Service Control
|
- Service Control
|
||||||
/v1/service-control/stop:
|
/server/{id}/service/stop:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
@@ -1007,7 +1216,7 @@ paths:
|
|||||||
summary: Stop a Windows service
|
summary: Stop a Windows service
|
||||||
tags:
|
tags:
|
||||||
- Service Control
|
- Service Control
|
||||||
/v1/state-history:
|
/state-history:
|
||||||
get:
|
get:
|
||||||
description: Return StateHistorys
|
description: Return StateHistorys
|
||||||
responses:
|
responses:
|
||||||
@@ -1020,7 +1229,7 @@ paths:
|
|||||||
summary: Return StateHistorys
|
summary: Return StateHistorys
|
||||||
tags:
|
tags:
|
||||||
- StateHistory
|
- StateHistory
|
||||||
/v1/state-history/statistics:
|
/state-history/statistics:
|
||||||
get:
|
get:
|
||||||
description: Return StateHistorys
|
description: Return StateHistorys
|
||||||
responses:
|
responses:
|
||||||
@@ -1033,8 +1242,20 @@ paths:
|
|||||||
summary: Return StateHistorys
|
summary: Return StateHistorys
|
||||||
tags:
|
tags:
|
||||||
- StateHistory
|
- StateHistory
|
||||||
|
/system/health:
|
||||||
|
get:
|
||||||
|
description: Return service control status
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
summary: Return service control status
|
||||||
|
tags:
|
||||||
|
- system
|
||||||
schemes:
|
schemes:
|
||||||
- http
|
|
||||||
- https
|
- https
|
||||||
securityDefinitions:
|
securityDefinitions:
|
||||||
BearerAuth:
|
BearerAuth:
|
||||||
|
|||||||
Reference in New Issue
Block a user