feat(AI资源广场): 模型和数据集资源相关功能开发

AI资源判断增加模型和数据集
This commit is contained in:
otto 2026-05-21 15:31:37 +08:00
parent eef339d228
commit 266e0a86a7
2 changed files with 5 additions and 1 deletions

View File

@ -24,4 +24,8 @@ public enum AiResourceCategory {
public String getDesc() {
return desc;
}
public static boolean isAiResourceCategory(String code) {
return SKILL.getCode().equals(code) || MODEL.getCode().equals(code) || DATASET.getCode().equals(code);
}
}

View File

@ -607,7 +607,7 @@ public class ZoneResourceServiceImpl implements IZoneResourceService {
if (resource == null) {
throw new ServiceException("资源不存在(资源id[" + id + "])");
}
if (!AiResourceCategory.SKILL.getCode().equals(resource.getResourceCategory())) {
if (!AiResourceCategory.isAiResourceCategory(resource.getResourceCategory())) {
throw new ServiceException("该资源不是AI资源");
}
return resource;