增加 模型调优 标签 枚举

This commit is contained in:
limin 2024-12-18 16:16:47 +08:00
parent 403ee35f35
commit 534e483bd4
3 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.llm.enums;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import com.sun.javaws.exceptions.ErrorCodeResponseException;
public interface ErrorCodeConstants {
ErrorCode KNOWLEDGE_BASE_NOT_EXISTS = new ErrorCode(10001, "知识库不存在");
@ -8,4 +9,8 @@ public interface ErrorCodeConstants {
ErrorCode DATASET_NOT_EXISTS = new ErrorCode(10002, "数据集不存在");
ErrorCode MODEL_SERVICE_NOT_EXISTS = new ErrorCode(10003, "模型服务不存在");
ErrorCode LABEL_NOT_EXISTS = new ErrorCode(10004,"标签不存在");
ErrorCode FINE_TUNING_TASK_NOT_EXISTS = new ErrorCode(10005, "微调任务不存在");
}

View File

@ -16,6 +16,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.llm.dal.mysql.finetuningtask.FineTuningTaskMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.FINE_TUNING_TASK_NOT_EXISTS;
/**
@ -62,7 +63,7 @@ public class FineTuningTaskServiceImpl implements FineTuningTaskService {
private void validateFineTuningTaskExists(Long id) {
if (fineTuningTaskMapper.selectById(id) == null) {
// throw exception(FINE_TUNING_TASK_NOT_EXISTS);
throw exception(FINE_TUNING_TASK_NOT_EXISTS);
}
}

View File

@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.llm.dal.mysql.label.LabelMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.LABEL_NOT_EXISTS;
/**
* 标签管理 Service 实现类
@ -57,7 +58,7 @@ public class LabelServiceImpl implements LabelService {
private void validateLabelExists(Long id) {
if (labelMapper.selectById(id) == null) {
// throw exception(LABEL_NOT_EXISTS);
throw exception(LABEL_NOT_EXISTS);
}
}