update:优化代码

develop
PL 2 months ago
parent 65d4740084
commit 8100e15948

@ -420,30 +420,22 @@ public class ChatMessageServiceImpl implements ChatMessageService {
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()) {
builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(),examComment.getTime(), examComment.getScore(), examComment.getScoreRate(),examComment.getRanking()));
count++;
}
}
break;
}
}

Loading…
Cancel
Save