forked from Gitlink/microservices
parent
eef339d228
commit
266e0a86a7
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue