You've already forked FrameTour-BE
refactor(puzzle): 移除填充规则中的景区ID依赖
- 删除 PuzzleFillRuleDTO、PuzzleFillRuleSaveRequest 和 PuzzleFillRuleEntity 中的 scenicId 字段 - 从 ConditionContext 和 DataSourceContext 中移除 scenicId 属性 - 更新 PuzzleElementFillEngine 的 execute 方法,不再接收和传递 scenicId 参数 - 修改 PuzzleGenerateServiceImpl 中调用填充引擎的逻辑,去除 scenicId 判断和传参 - 调整 PuzzleFillRuleMapper.xml 配置文件,移除 scenic_id 映射关系 - 更新所有相关单元测试用例,删除对 scenicId 的引用和验证 - 简化规则查询方法,由 listByTemplateAndScenic 改为 listByTemplateId - 移除因缺少 scenicId 而产生的警告日志和特殊处理分支
This commit is contained in:
@@ -49,14 +49,13 @@ public class PuzzleElementFillEngine {
|
||||
*
|
||||
* @param templateId 模板ID
|
||||
* @param faceId 人脸ID
|
||||
* @param scenicId 景区ID
|
||||
* @return 填充后的dynamicData
|
||||
*/
|
||||
public Map<String, String> execute(Long templateId, Long faceId, Long scenicId) {
|
||||
public Map<String, String> execute(Long templateId, Long faceId) {
|
||||
Map<String, String> dynamicData = new HashMap<>();
|
||||
|
||||
if (faceId == null || scenicId == null) {
|
||||
log.debug("自动填充被跳过, templateId={}, faceId={}, scenicId={}", templateId, faceId, scenicId);
|
||||
if (faceId == null) {
|
||||
log.debug("自动填充被跳过, templateId={}, faceId={}", templateId, faceId);
|
||||
return dynamicData;
|
||||
}
|
||||
|
||||
@@ -78,7 +77,6 @@ public class PuzzleElementFillEngine {
|
||||
// 3. 构建条件评估上下文
|
||||
ConditionContext conditionContext = ConditionContext.builder()
|
||||
.faceId(faceId)
|
||||
.scenicId(scenicId)
|
||||
.deviceCount(deviceCount)
|
||||
.deviceIds(deviceIds)
|
||||
.build();
|
||||
@@ -105,7 +103,6 @@ public class PuzzleElementFillEngine {
|
||||
// 5. 批量填充dynamicData
|
||||
DataSourceContext dataSourceContext = DataSourceContext.builder()
|
||||
.faceId(faceId)
|
||||
.scenicId(scenicId)
|
||||
.build();
|
||||
|
||||
int successCount = 0;
|
||||
|
||||
@@ -18,11 +18,6 @@ public class ConditionContext {
|
||||
*/
|
||||
private Long faceId;
|
||||
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
private Long scenicId;
|
||||
|
||||
/**
|
||||
* 机位数量(缓存值,避免重复查询)
|
||||
*/
|
||||
|
||||
@@ -15,11 +15,6 @@ public class DataSourceContext {
|
||||
*/
|
||||
private Long faceId;
|
||||
|
||||
/**
|
||||
* 景区ID
|
||||
*/
|
||||
private Long scenicId;
|
||||
|
||||
/**
|
||||
* 可扩展的其他上下文数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user