From bb417b861385869184b29b1242d1eef7079e4045 Mon Sep 17 00:00:00 2001 From: PL <774412461@qq.com> Date: Tue, 29 Oct 2024 10:55:54 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=AF=84=E8=AF=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=87=AA=E5=AE=9A=E4=B9=89=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/ai/comment/ChatCommentsDto.java | 16 +++++++++++++--- .../service/impl/ChatMessageServiceImpl.java | 9 +++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/ChatCommentsDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/ChatCommentsDto.java index d18ed59..57c12c5 100644 --- a/src/main/java/cn/teammodel/model/dto/ai/comment/ChatCommentsDto.java +++ b/src/main/java/cn/teammodel/model/dto/ai/comment/ChatCommentsDto.java @@ -1,8 +1,11 @@ package cn.teammodel.model.dto.ai.comment; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; /** * 评语接收信息 @@ -20,13 +23,14 @@ public class ChatCommentsDto { /** * 评语类型 */ - @NotBlank(message = "评语类型不能为空") + @NotNull + @ApiModelProperty(value = "评语类型不能为空") private String type; - @NotBlank(message = "教师学段") + @ApiModelProperty(value = "教师学段") private String period; - @NotBlank(message = "教师学科") + @ApiModelProperty(value = "教师学科") private String subject; /** * 评语重复次数 @@ -51,6 +55,12 @@ public class ChatCommentsDto { * 评语内容 */ private String text; + + /** + * 限制评语 + */ + private List limitTexts; + /** * 评语数据 */ diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java index f66bd4e..c755803 100644 --- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java @@ -546,6 +546,15 @@ public class ChatMessageServiceImpl implements ChatMessageService { int size = chatCommentsDto.getSize() > 0 ? chatCommentsDto.getSize() : 200; builder.append(String.format(limitChat, size)); + //用户自定义限制条件 + if (chatCommentsDto.getLimitTexts() != null) { + int serialNumber = 5; + for (String str : chatCommentsDto.getLimitTexts()) { + builder.append(serialNumber).append(".").append(limitChat).append(";"); + serialNumber += 1; + } + } + return builder.toString(); } catch (Exception e) { log.info(Arrays.toString(e.getStackTrace()));