diff --git a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java index 8e065a4..dbe13fd 100644 --- a/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java +++ b/src/main/java/cn/teammodel/model/dto/ai/comment/WisdomExamCommentsDto.java @@ -6,6 +6,7 @@ import lombok.Data; */ @Data public class WisdomExamCommentsDto { + /** * 试卷名称 */ @@ -21,9 +22,19 @@ public class WisdomExamCommentsDto { /** * 得分率 */ - public int scoreRate; + public double scoreRate; /** * 排名 */ public int ranking; + + /** + * 班级得分率 + */ + public double classRate; + + /** + * 年级得分率 + */ + public double gradeRate; } diff --git a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java index ece5764..f1fff1e 100644 --- a/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java +++ b/src/main/java/cn/teammodel/service/impl/ChatMessageServiceImpl.java @@ -416,15 +416,37 @@ public class ChatMessageServiceImpl implements ChatMessageService { //昵称 builder.append(String.format(finalChatModel.getChat().get(0), chatCommentsDto.getName())); } - for (WisdomExamCommentsDto examComment : examComments) { - builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(), - examComment.getTime(), examComment.getScore(), examComment.getScoreRate(), - examComment.getRanking())); - if (count < examComments.size()) { - count++; + switch(phase){ + case 1:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(1), count, examComment.getName(),examComment.getTime(), examComment.getClassRate(),examComment.getGradeRate())); + if (count < examComments.size()) { + count++; + } + } + break; + } + case 2:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(2), count, examComment.getName(),examComment.getTime(), examComment.getGradeRate())); + if (count < examComments.size()) { + count++; + } + } + break; + } + default:{ + for (WisdomExamCommentsDto examComment : examComments) { + builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(), + examComment.getTime(), examComment.getScore(), examComment.getScoreRate(), + examComment.getRanking())); + if (count < examComments.size()) { + count++; + } + } + break; } } - //builder.append(String.format(finalChatModel.getEnd().get(0),chatName)); break; } // 智育 学科评语模版 diff --git a/src/main/resources/Json/ChatModel.json b/src/main/resources/Json/ChatModel.json index 3b071d5..30b7920 100644 --- a/src/main/resources/Json/ChatModel.json +++ b/src/main/resources/Json/ChatModel.json @@ -16,7 +16,7 @@ "name": "智育 成绩表现模版", "role": ["请扮演[%s%s]老师角色,依据我提供的数据,对%s的学习成效表现做一个评价。数据如下:\n"], "chat": ["%s\n,"], - "cycleChats": ["参加第%s次,考试结果:名称:%s,时间:%s,得分:%s,考试得分率:%s %% 排名:%s ;\n"], + "cycleChats": ["参加第%s次,考试结果:名称:%s,时间:%s,得分:%s,考试得分率:%s %% 排名:%s ;\n","参加第%s次,考试结果:名称:%s,时间:%s,班级平均得分率:%s %%吗,年级平均得分率:%s %%;\n","参加第%s次,考试结果:名称:%s,时间:%s,年级平均得分率:%s %%;\n"], "end": ["请根据我提供的数据,对%s的考试成绩表现做一个评价。\n"], "limit": "。限制条件如下:1、%s字左右;2、直接返回评语的内容;3、评语的开篇不允许出现提示语;4、评语的开篇不允许出现特殊字符。" },