为各服务接口补 /// 中文注释:swagger 恢复中文说明(admin 203 / user 93 / customer 12 / fishgame 4)
This commit is contained in:
@@ -38,6 +38,9 @@ namespace AdminApi.GameConfigs
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有房间列表
|
||||
/// </summary>
|
||||
[HttpGet("GetAllRooms")]
|
||||
public async Task<PageResponse<RedisGameRoom>> GetAllRooms(
|
||||
int pageIndex = 1,
|
||||
@@ -97,6 +100,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToPageResult(pagedRooms, total);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有象棋房间列表
|
||||
/// </summary>
|
||||
[HttpGet("GetAllChessRooms")]
|
||||
public async Task<PageResponse<ChessGameRoom>> GetAllChessRooms(
|
||||
int pageIndex = 1,
|
||||
@@ -124,6 +130,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToPageResult(pagedRooms, total);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取象棋房间详情
|
||||
/// </summary>
|
||||
[HttpGet("GetChessRoomDetail")]
|
||||
public async Task<BaseResponse<ChessGameRoom>> GetChessRoomDetail(string roomId)
|
||||
{
|
||||
@@ -134,6 +143,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(room);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空象棋房间玩家
|
||||
/// </summary>
|
||||
[HttpGet("ClearChessRoom")]
|
||||
public async Task<BaseResponse<string>> ClearChessRoom(string roomId)
|
||||
{
|
||||
@@ -176,6 +188,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult($"已清空房间 {roomId} 的所有玩家({playerCount} 人)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后台将指定玩家踢出象棋房间。
|
||||
/// </summary>
|
||||
[HttpGet("KickChessPlayer")]
|
||||
public async Task<BaseResponse<string>> KickChessPlayer(string roomId, string userId)
|
||||
{
|
||||
@@ -200,6 +215,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult("踢人指令已提交");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取象棋房间统计(房间为空时自动初始化)
|
||||
/// </summary>
|
||||
[HttpGet("GetChessRoomStatistics")]
|
||||
public async Task<BaseResponse<ChessRoomStatistics>> GetChessRoomStatistics()
|
||||
{
|
||||
@@ -226,6 +244,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(stats);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除象棋房间
|
||||
/// </summary>
|
||||
[HttpGet("DeleteChessRoom")]
|
||||
public async Task<BaseResponse<string>> DeleteChessRoom(string roomId)
|
||||
{
|
||||
@@ -238,6 +259,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult("已删除房间 " + roomId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 为象棋房间添加机器人
|
||||
/// </summary>
|
||||
[HttpGet("AddChessRobot")]
|
||||
public async Task<BaseResponse<string>> AddChessRobot(string roomId, int count)
|
||||
{
|
||||
@@ -256,6 +280,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult("添加成功");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置象棋房间机器人数量
|
||||
/// </summary>
|
||||
[HttpGet("SetChessRobot")]
|
||||
public async Task<BaseResponse<string>> SetChessRobot(string roomId, int count)
|
||||
{
|
||||
@@ -274,6 +301,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult("设置成功");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取房间详情
|
||||
/// </summary>
|
||||
[HttpGet("GetRoomDetail")]
|
||||
public async Task<BaseResponse<RedisGameRoom>> GetRoomDetail(string roomId)
|
||||
{
|
||||
@@ -284,6 +314,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(room);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户实时房间数据(捕鱼,读Redis房间内该用户数据)
|
||||
/// </summary>
|
||||
[HttpGet("GetUserRoomRealtime")]
|
||||
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
|
||||
public async Task<BaseResponse<UserRoomRealtimeDto>> GetUserRoomRealtime(string userId)
|
||||
@@ -383,6 +416,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(dto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 为房间添加机器人
|
||||
/// </summary>
|
||||
[HttpGet("AddRobot")]
|
||||
public async Task<BaseResponse<string>> AddRobot(string roomId, int count)
|
||||
{
|
||||
@@ -411,6 +447,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult($"已为房间 {roomId} 添加 {count} 个机器人");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置房间机器人数量
|
||||
/// </summary>
|
||||
[HttpGet("SetRobotCount")]
|
||||
public async Task<BaseResponse<string>> SetRobotCount(string roomId, int count)
|
||||
{
|
||||
@@ -439,6 +478,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult($"已将房间 {roomId} 的机器人数量设置为 {count}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一键重生成所有机器人编号(GUID UserId + 8位编号)
|
||||
/// </summary>
|
||||
[HttpGet("RegenerateAllBotIds")]
|
||||
public async Task<BaseResponse<string>> RegenerateAllBotIds()
|
||||
{
|
||||
@@ -469,6 +511,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult($"已刷新 {totalBots} 个机器人编号(涉及 {rooms.Count(r => r?.Players?.Any(p => p.IsBot) == true)} 个房间)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空房间(踢出所有玩家,含结算通知)
|
||||
/// </summary>
|
||||
[HttpGet("ClearRoom")]
|
||||
public async Task<BaseResponse<string>> ClearRoom(string roomId)
|
||||
{
|
||||
@@ -536,6 +581,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(msg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取房间统计
|
||||
/// </summary>
|
||||
[HttpGet("GetRoomStatistics")]
|
||||
public async Task<BaseResponse<RoomStatistics>> GetRoomStatistics()
|
||||
{
|
||||
@@ -563,6 +611,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult(stats);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修复所有象棋房间状态和密码(按 robotCount 规则修正)
|
||||
/// </summary>
|
||||
[HttpGet("RepairChessRooms")]
|
||||
public async Task<BaseResponse<string>> RepairChessRooms()
|
||||
{
|
||||
@@ -584,6 +635,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult($"已修复 {fixedCount} 个象棋房间");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化房间
|
||||
/// </summary>
|
||||
[HttpGet("InitRooms")]
|
||||
public async Task<BaseResponse<string>> InitRooms()
|
||||
{
|
||||
@@ -625,6 +679,9 @@ namespace AdminApi.GameConfigs
|
||||
return this.ToResult("房间初始化成功");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空并重新初始化所有象棋房间
|
||||
/// </summary>
|
||||
[HttpGet("ReInitChessRooms")]
|
||||
public async Task<BaseResponse<string>> ReInitChessRooms()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user