CroupierCroupier
指南
架构
API 参考
开发
  • C++ SDK
  • Go SDK
  • Java SDK
  • JavaScript SDK
  • Python SDK
  • C# SDK
  • Lua SDK
分析
GitHub
指南
架构
API 参考
开发
  • C++ SDK
  • Go SDK
  • Java SDK
  • JavaScript SDK
  • Python SDK
  • C# SDK
  • Lua SDK
分析
GitHub
  • API 参考

    • API 概览
    • gRPC API
    • REST API
  • 运维管理

    • 运维 API
    • 运维核心 API
    • 运维简化 API
    • 管理员 API
    • 备份 API
    • 配置 API
    • 迁移 API
    • 监控 API
    • 节点 API
  • Agent & 函数

    • Agent API
    • 函数 API
    • 任务 API
    • /api/pack.html
    • Schema API
  • 认证与权限

    • 认证 API
    • 审批 API
    • 审计 API
    • 限流 API
  • 游戏管理

    • 游戏 API
    • 玩家 API
    • 实体 API
    • /api/component.html
    • 注册表 API
  • 消息通知

    • 消息 API
    • 告警 API
    • 支持 API
    • 工单 API
    • 反馈 API
  • 平台与集成

    • 平台 API
    • Provider API
    • 证书 API
    • 存储 API
  • 数据分析

    • 数据分析 API
    • 行为分析 API
    • 分析概览 API
    • 支付分析 API
    • 留存分析 API
  • 其他

    • 分配 API
    • 常见问题
    • 元数据 API
    • 配置文件 API
    • Workspace API

游戏 API

1. "获取游戏列表"

  1. route definition
  • Url: /api/v1/games
  • Method: GET
  • Request: GamesListRequest
  • Response: GamesListResponse
  1. request definition
type GamesListRequest struct {
	Page int `form:"page,optional"`
	PageSize int `form:"pageSize,optional"`
	Status string `form:"status,optional"`
}
  1. 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"`
}

2. "创建游戏"

  1. route definition
  • Url: /api/v1/games
  • Method: POST
  • Request: GameCreateRequest
  • Response: GameCreateResponse
  1. request definition
type GameCreateRequest struct {
	Name string `json:"name"`
	Description string `json:"description,optional"`
	Config string `json:"config,optional"`
}
  1. response definition
type GameCreateResponse struct {
	Code int `json:"code"`
	Message string `json:"message"`
	Data interface{} `json:"data,omitempty"`
}

3. "获取游戏详情"

  1. route definition
  • Url: /api/v1/games/:id
  • Method: GET
  • Request: GameDetailRequest
  • Response: GameDetailResponse
  1. request definition
type GameDetailRequest struct {
	ID string `path:"id"`
}
  1. 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"`
}

4. "更新游戏"

  1. route definition
  • Url: /api/v1/games/:id
  • Method: PUT
  • Request: GameUpdateRequest
  • Response: GameUpdateResponse
  1. 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"`
}
  1. 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"`
}

5. "删除游戏"

  1. route definition
  • Url: /api/v1/games/:id
  • Method: DELETE
  • Request: GameDeleteRequest
  • Response: GameDeleteResponse
  1. request definition
type GameDeleteRequest struct {
	ID string `path:"id"`
}
  1. response definition
type GameDeleteResponse struct {
	Code int `json:"code"`
	Message string `json:"message"`
	Data interface{} `json:"data,omitempty"`
}

6. "获取游戏环境列表"

  1. route definition
  • Url: /api/v1/games/:id/envs
  • Method: GET
  • Request: GameEnvsListRequest
  • Response: GameEnvsListResponse
  1. request definition
type GameEnvsListRequest struct {
	ID string `path:"id"`
}
  1. 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"`
}

7. "添加游戏环境"

  1. route definition
  • Url: /api/v1/games/:id/envs
  • Method: POST
  • Request: GameEnvAddRequest
  • Response: GameEnvAddResponse
  1. request definition
type GameEnvAddRequest struct {
	ID string `path:"id"`
	Name string `json:"name"`
	Type string `json:"type,optional"`
}
  1. response definition
type GameEnvAddResponse struct {
	Code int `json:"code"`
	Message string `json:"message"`
	Data interface{} `json:"data,omitempty"`
}

8. "更新游戏环境"

  1. route definition
  • Url: /api/v1/games/:id/envs/:envId
  • Method: PUT
  • Request: GameEnvUpdateRequest
  • Response: GameEnvUpdateResponse
  1. request definition
type GameEnvUpdateRequest struct {
	ID string `path:"id"`
	EnvID string `path:"envId"`
	Name string `json:"name,optional"`
	Type string `json:"type,optional"`
}
  1. response definition
type GameEnvUpdateResponse struct {
	Code int `json:"code"`
	Message string `json:"message"`
	Data interface{} `json:"data,omitempty"`
}

9. "删除游戏环境"

  1. route definition
  • Url: /api/v1/games/:id/envs/:envId
  • Method: DELETE
  • Request: GameEnvDeleteRequest
  • Response: GameEnvDeleteResponse
  1. request definition
type GameEnvDeleteRequest struct {
	ID string `path:"id"`
	EnvID string `path:"envId"`
}
  1. response definition
type GameEnvDeleteResponse struct {
	Code int `json:"code"`
	Message string `json:"message"`
	Data interface{} `json:"data,omitempty"`
}
在 GitHub 上编辑此页
最后更新: 2026/3/19 10:26
Next
玩家 API