- route definition
- Url: /api/v1/games
- Method: GET
- Request:
GamesListRequest - Response:
GamesListResponse
- request definition
type GamesListRequest struct {
Page int `form:"page,optional"`
PageSize int `form:"pageSize,optional"`
Status string `form:"status,optional"`
}
- response definition
type GamesListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data GamesData `json:"data,omitempty"`
}
type GamesData struct {
Games []GameInfo `json:"games"`
Total int `json:"total,optional"`
}
- route definition
- Url: /api/v1/games
- Method: POST
- Request:
GameCreateRequest - Response:
GameCreateResponse
- request definition
type GameCreateRequest struct {
Name string `json:"name"`
Description string `json:"description,optional"`
Config string `json:"config,optional"`
}
- response definition
type GameCreateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/games/:id
- Method: GET
- Request:
GameDetailRequest - Response:
GameDetailResponse
- request definition
type GameDetailRequest struct {
ID string `path:"id"`
}
- response definition
type GameDetailResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data GameInfo `json:"data,omitempty"`
}
type GameInfo struct {
ID uint `json:"id"`
Name string `json:"name"`
Icon string `json:"icon,optional"`
Description string `json:"description,optional"`
Enabled bool `json:"enabled"`
AliasName string `json:"aliasName,optional"`
Homepage string `json:"homepage,optional"`
Status string `json:"status"`
GameType string `json:"gameType,optional"`
GenreCode string `json:"genreCode,optional"`
Color string `json:"color,optional"`
Envs []GameEnvItem `json:"envs,optional"`
CreatedAt string `json:"createdAt,optional"`
UpdatedAt string `json:"updatedAt,optional"`
}
- route definition
- Url: /api/v1/games/:id
- Method: PUT
- Request:
GameUpdateRequest - Response:
GameUpdateResponse
- request definition
type GameUpdateRequest struct {
ID string `path:"id"`
Name string `json:"name,optional"`
Description string `json:"description,optional"`
Config string `json:"config,optional"`
Status string `json:"status,optional"`
}
- response definition
type GameUpdateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data GameInfo `json:"data,omitempty"`
}
type GameInfo struct {
ID uint `json:"id"`
Name string `json:"name"`
Icon string `json:"icon,optional"`
Description string `json:"description,optional"`
Enabled bool `json:"enabled"`
AliasName string `json:"aliasName,optional"`
Homepage string `json:"homepage,optional"`
Status string `json:"status"`
GameType string `json:"gameType,optional"`
GenreCode string `json:"genreCode,optional"`
Color string `json:"color,optional"`
Envs []GameEnvItem `json:"envs,optional"`
CreatedAt string `json:"createdAt,optional"`
UpdatedAt string `json:"updatedAt,optional"`
}
- route definition
- Url: /api/v1/games/:id
- Method: DELETE
- Request:
GameDeleteRequest - Response:
GameDeleteResponse
- request definition
type GameDeleteRequest struct {
ID string `path:"id"`
}
- response definition
type GameDeleteResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/games/:id/envs
- Method: GET
- Request:
GameEnvsListRequest - Response:
GameEnvsListResponse
- request definition
type GameEnvsListRequest struct {
ID string `path:"id"`
}
- response definition
type GameEnvsListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data GameEnvsData `json:"data,omitempty"`
}
type GameEnvsData struct {
Envs []GameEnvItem `json:"envs"`
}
- route definition
- Url: /api/v1/games/:id/envs
- Method: POST
- Request:
GameEnvAddRequest - Response:
GameEnvAddResponse
- request definition
type GameEnvAddRequest struct {
ID string `path:"id"`
Name string `json:"name"`
Type string `json:"type,optional"`
}
- response definition
type GameEnvAddResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/games/:id/envs/:envId
- Method: PUT
- Request:
GameEnvUpdateRequest - Response:
GameEnvUpdateResponse
- request definition
type GameEnvUpdateRequest struct {
ID string `path:"id"`
EnvID string `path:"envId"`
Name string `json:"name,optional"`
Type string `json:"type,optional"`
}
- response definition
type GameEnvUpdateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/games/:id/envs/:envId
- Method: DELETE
- Request:
GameEnvDeleteRequest - Response:
GameEnvDeleteResponse
- request definition
type GameEnvDeleteRequest struct {
ID string `path:"id"`
EnvID string `path:"envId"`
}
- response definition
type GameEnvDeleteResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}