feat(schedule): 添加赛程配置API,支持动态时间段配置

- 添加 GET /martial/schedule/config API 暴露 ScheduleConfig
- 返回 morningStartTime, afternoonStartTime 等配置
- 更新 docker-compose.yml 使用 Dockerfile.quick
This commit is contained in:
2025-12-30 10:51:04 +08:00
parent 0b5fc9fb71
commit 16b55adf81
2 changed files with 22 additions and 5 deletions

View File

@@ -85,8 +85,8 @@ services:
# 后端应用(完整构建模式) # 后端应用(完整构建模式)
martial-api: martial-api:
build: build:
context: .. context: .
dockerfile: martial-master/Dockerfile.fullbuild dockerfile: Dockerfile.quick
container_name: martial-api container_name: martial-api
restart: always restart: always
environment: environment:

View File

@@ -8,6 +8,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.modules.martial.config.ScheduleConfig;
import org.springblade.modules.martial.pojo.dto.MoveScheduleGroupDTO; import org.springblade.modules.martial.pojo.dto.MoveScheduleGroupDTO;
import org.springblade.modules.martial.pojo.dto.SaveScheduleDraftDTO; import org.springblade.modules.martial.pojo.dto.SaveScheduleDraftDTO;
import org.springblade.modules.martial.pojo.dto.ScheduleResultDTO; import org.springblade.modules.martial.pojo.dto.ScheduleResultDTO;
@@ -15,6 +16,7 @@ import org.springblade.modules.martial.service.IMartialScheduleArrangeService;
import org.springblade.modules.martial.service.IMartialScheduleService; import org.springblade.modules.martial.service.IMartialScheduleService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@@ -31,6 +33,24 @@ public class MartialScheduleArrangeController extends BladeController {
private final IMartialScheduleArrangeService scheduleArrangeService; private final IMartialScheduleArrangeService scheduleArrangeService;
private final IMartialScheduleService scheduleService; private final IMartialScheduleService scheduleService;
private final ScheduleConfig scheduleConfig;
/**
* 获取赛程配置
*/
@GetMapping("/config")
@Operation(summary = "获取赛程配置", description = "获取赛程编排的时间配置")
public R<Map<String, Object>> getScheduleConfig() {
Map<String, Object> config = new HashMap<>();
config.put("morningStartTime", scheduleConfig.getMorningStartTime());
config.put("morningEndTime", scheduleConfig.getMorningEndTime());
config.put("afternoonStartTime", scheduleConfig.getAfternoonStartTime());
config.put("afternoonEndTime", scheduleConfig.getAfternoonEndTime());
config.put("maxPeoplePerGroup", scheduleConfig.getMaxPeoplePerGroup());
config.put("targetPeoplePerGroup", scheduleConfig.getTargetPeoplePerGroup());
config.put("defaultDurationPerPerson", scheduleConfig.getDefaultDurationPerPerson());
return R.data(config);
}
/** /**
* 获取编排结果 * 获取编排结果
@@ -69,13 +89,11 @@ public class MartialScheduleArrangeController extends BladeController {
@Operation(summary = "完成编排并锁定", description = "传入赛事ID") @Operation(summary = "完成编排并锁定", description = "传入赛事ID")
public R saveAndLock(@RequestBody SaveScheduleDraftDTO dto) { public R saveAndLock(@RequestBody SaveScheduleDraftDTO dto) {
try { try {
// 获取当前登录用户
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
String userId = user != null ? user.getUserName() : "system"; String userId = user != null ? user.getUserName() : "system";
boolean success = scheduleService.saveAndLockSchedule(dto.getCompetitionId()); boolean success = scheduleService.saveAndLockSchedule(dto.getCompetitionId());
if (success) { if (success) {
// 调用原有的锁定逻辑
scheduleArrangeService.saveAndLock(dto.getCompetitionId(), userId); scheduleArrangeService.saveAndLock(dto.getCompetitionId(), userId);
return R.success("编排已完成并锁定"); return R.success("编排已完成并锁定");
} else { } else {
@@ -167,7 +185,6 @@ public class MartialScheduleArrangeController extends BladeController {
} }
} }
/** /**
* 更新参赛者签到状态 * 更新参赛者签到状态
*/ */