update
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
package com.yaoyuan.jiscuss.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -22,6 +24,8 @@ public class Discussion implements Serializable {
|
||||
@Column(name = "id", unique = true)
|
||||
private Integer id;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 200)
|
||||
@Column(name = "title")
|
||||
private String title;
|
||||
|
||||
@@ -64,7 +68,7 @@ public class Discussion implements Serializable {
|
||||
@Column(name = "like_count")
|
||||
private Integer likeCount;
|
||||
|
||||
|
||||
/** IP is resolved server-side via IpUtils.getClientIp() — never trusted from X-Forwarded-For alone. */
|
||||
@Column(name = "ip_address")
|
||||
private String ipAddress;
|
||||
|
||||
@@ -73,5 +77,5 @@ public class Discussion implements Serializable {
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user