From a271ed5a232236383bc96c8c1e380a5c91dc1c3c Mon Sep 17 00:00:00 2001 From: guyue <1721849008@qq.com> Date: 星期二, 12 八月 2025 01:07:19 +0800 Subject: [PATCH] 代码规范 --- src/main/java/com/linghu/model/entity/Question.java | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/linghu/model/entity/Question.java b/src/main/java/com/linghu/model/entity/Question.java index 8544350..29c77fc 100644 --- a/src/main/java/com/linghu/model/entity/Question.java +++ b/src/main/java/com/linghu/model/entity/Question.java @@ -5,20 +5,27 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDateTime; + +import com.linghu.model.validator.CreateGroup; +import com.linghu.model.validator.UpdateGroup; import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; + +import javax.validation.constraints.NotNull; /** * * @TableName question */ -@TableName(value ="question") +@TableName(value = "question") @Data public class Question implements Serializable { /** * 提问词id */ @TableId(type = IdType.AUTO) + @NotNull(message = "id不能为空",groups = UpdateGroup.class) private Integer question_id; /** @@ -32,7 +39,7 @@ private String question; /** - * 提示词状态,(pending:待处理;processing:处理中 ; success:处理成功;failed:处理失败 ) + * 提示词状态,(pending:待处理;processing:处理中 ; success:处理成功;failed:处理失败 ) */ private String status; @@ -49,7 +56,8 @@ /** * 采集时间 */ - private Date timestamp; + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS", timezone = "GMT+8") + private LocalDateTime timestamp; /** * 提取的引用数量 @@ -81,16 +89,24 @@ return false; } Question other = (Question) that; - return (this.getQuestion_id() == null ? other.getQuestion_id() == null : this.getQuestion_id().equals(other.getQuestion_id())) - && (this.getKeyword_id() == null ? other.getKeyword_id() == null : this.getKeyword_id().equals(other.getKeyword_id())) - && (this.getQuestion() == null ? other.getQuestion() == null : this.getQuestion().equals(other.getQuestion())) - && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) - && (this.getUser_name() == null ? other.getUser_name() == null : this.getUser_name().equals(other.getUser_name())) - && (this.getUser_email() == null ? other.getUser_email() == null : this.getUser_email().equals(other.getUser_email())) - && (this.getTimestamp() == null ? other.getTimestamp() == null : this.getTimestamp().equals(other.getTimestamp())) - && (this.getExtracted_count() == null ? other.getExtracted_count() == null : this.getExtracted_count().equals(other.getExtracted_count())) - && (this.getResponse() == null ? other.getResponse() == null : this.getResponse().equals(other.getResponse())) - && (this.getError() == null ? other.getError() == null : this.getError().equals(other.getError())); + return (this.getQuestion_id() == null ? other.getQuestion_id() == null + : this.getQuestion_id().equals(other.getQuestion_id())) + && (this.getKeyword_id() == null ? other.getKeyword_id() == null + : this.getKeyword_id().equals(other.getKeyword_id())) + && (this.getQuestion() == null ? other.getQuestion() == null + : this.getQuestion().equals(other.getQuestion())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getUser_name() == null ? other.getUser_name() == null + : this.getUser_name().equals(other.getUser_name())) + && (this.getUser_email() == null ? other.getUser_email() == null + : this.getUser_email().equals(other.getUser_email())) + && (this.getTimestamp() == null ? other.getTimestamp() == null + : this.getTimestamp().equals(other.getTimestamp())) + && (this.getExtracted_count() == null ? other.getExtracted_count() == null + : this.getExtracted_count().equals(other.getExtracted_count())) + && (this.getResponse() == null ? other.getResponse() == null + : this.getResponse().equals(other.getResponse())) + && (this.getError() == null ? other.getError() == null : this.getError().equals(other.getError())); } @Override -- Gitblit v1.7.1