From 534e483bd4cd45dd4b54ea73e48470b625876646 Mon Sep 17 00:00:00 2001 From: limin Date: Wed, 18 Dec 2024 16:16:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=B0=83=E4=BC=98=20=E6=A0=87=E7=AD=BE=20=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/yudao/module/llm/enums/ErrorCodeConstants.java | 5 +++++ .../service/finetuningtask/FineTuningTaskServiceImpl.java | 3 ++- .../yudao/module/llm/service/label/LabelServiceImpl.java | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/yudao-module-llm/yudao-module-llm-api/src/main/java/cn/iocoder/yudao/module/llm/enums/ErrorCodeConstants.java b/yudao-module-llm/yudao-module-llm-api/src/main/java/cn/iocoder/yudao/module/llm/enums/ErrorCodeConstants.java index 469c7a034..99e6c8e90 100644 --- a/yudao-module-llm/yudao-module-llm-api/src/main/java/cn/iocoder/yudao/module/llm/enums/ErrorCodeConstants.java +++ b/yudao-module-llm/yudao-module-llm-api/src/main/java/cn/iocoder/yudao/module/llm/enums/ErrorCodeConstants.java @@ -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, "微调任务不存在"); } diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/finetuningtask/FineTuningTaskServiceImpl.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/finetuningtask/FineTuningTaskServiceImpl.java index 92d980629..8a6e09dbd 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/finetuningtask/FineTuningTaskServiceImpl.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/finetuningtask/FineTuningTaskServiceImpl.java @@ -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); } } diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/label/LabelServiceImpl.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/label/LabelServiceImpl.java index b350289a2..821e63023 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/label/LabelServiceImpl.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/service/label/LabelServiceImpl.java @@ -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); } }