兜底1个

This commit is contained in:
2025-09-23 10:38:23 +08:00
parent 80b4508211
commit 90b6f53986
2 changed files with 29 additions and 6 deletions

View File

@@ -32,8 +32,6 @@ public class TemplateBiz {
private FaceRepository faceRepository;
@Autowired
private SourceMapper sourceMapper;
@Autowired
private SourceRepository sourceRepository;
public boolean determineTemplateCanGenerate(Long templateId, Long faceId) {
return determineTemplateCanGenerate(templateId, faceId, true);
@@ -175,4 +173,17 @@ public class TemplateBiz {
return filteredParams;
}
}
public Long findFirstAvailableTemplate(List<Long> templateIds, Long faceId) {
if (templateIds == null || templateIds.isEmpty() || faceId == null) {
return null;
}
for (Long templateId : templateIds) {
if (determineTemplateCanGenerate(templateId, faceId)) {
return templateId;
}
}
return null;
}
}