update:优化代码

develop
PL 2 months ago
parent 65d4740084
commit 8100e15948

@ -420,30 +420,22 @@ public class ChatMessageServiceImpl implements ChatMessageService {
case 1:{ case 1:{
for (WisdomExamCommentsDto examComment : examComments) { for (WisdomExamCommentsDto examComment : examComments) {
builder.append(String.format(finalChatModel.getCycleChats().get(1), count, examComment.getName(),examComment.getTime(), examComment.getClassRate(),examComment.getGradeRate())); builder.append(String.format(finalChatModel.getCycleChats().get(1), count, examComment.getName(),examComment.getTime(), examComment.getClassRate(),examComment.getGradeRate()));
if (count < examComments.size()) {
count++; count++;
} }
}
break; break;
} }
case 2:{ case 2:{
for (WisdomExamCommentsDto examComment : examComments) { for (WisdomExamCommentsDto examComment : examComments) {
builder.append(String.format(finalChatModel.getCycleChats().get(2), count, examComment.getName(),examComment.getTime(), examComment.getGradeRate())); builder.append(String.format(finalChatModel.getCycleChats().get(2), count, examComment.getName(),examComment.getTime(), examComment.getGradeRate()));
if (count < examComments.size()) {
count++; count++;
} }
}
break; break;
} }
default:{ default:{
for (WisdomExamCommentsDto examComment : examComments) { for (WisdomExamCommentsDto examComment : examComments) {
builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(), builder.append(String.format(finalChatModel.getCycleChats().get(0), count, examComment.getName(),examComment.getTime(), examComment.getScore(), examComment.getScoreRate(),examComment.getRanking()));
examComment.getTime(), examComment.getScore(), examComment.getScoreRate(),
examComment.getRanking()));
if (count < examComments.size()) {
count++; count++;
} }
}
break; break;
} }
} }

Loading…
Cancel
Save