update:评语添加用户自定义限制条件

develop
PL 2 months ago
parent 20a0bbfe8e
commit bb417b8613

@ -1,8 +1,11 @@
package cn.teammodel.model.dto.ai.comment; package cn.teammodel.model.dto.ai.comment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; 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; private String type;
@NotBlank(message = "教师学段") @ApiModelProperty(value = "教师学段")
private String period; private String period;
@NotBlank(message = "教师学科") @ApiModelProperty(value = "教师学科")
private String subject; private String subject;
/** /**
* *
@ -51,6 +55,12 @@ public class ChatCommentsDto {
* *
*/ */
private String text; private String text;
/**
*
*/
private List<String> limitTexts;
/** /**
* *
*/ */

@ -546,6 +546,15 @@ public class ChatMessageServiceImpl implements ChatMessageService {
int size = chatCommentsDto.getSize() > 0 ? chatCommentsDto.getSize() : 200; int size = chatCommentsDto.getSize() > 0 ? chatCommentsDto.getSize() : 200;
builder.append(String.format(limitChat, size)); 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(); return builder.toString();
} catch (Exception e) { } catch (Exception e) {
log.info(Arrays.toString(e.getStackTrace())); log.info(Arrays.toString(e.getStackTrace()));

Loading…
Cancel
Save