114 lines
2.4 KiB
Java
114 lines
2.4 KiB
Java
package com.kaidi.oa.domain;
|
|
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.GenerationType;
|
|
import jakarta.persistence.Id;
|
|
import jakarta.persistence.Table;
|
|
|
|
/**
|
|
* A survey / poll. status is one of 进行中 / 已结束. optionsJson stores the option
|
|
* list as a JSON array of {label, votes} stored as TEXT for portability.
|
|
*/
|
|
@Entity
|
|
@Table(name = "survey")
|
|
public class Survey {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
private String title;
|
|
|
|
@Column(columnDefinition = "TEXT")
|
|
private String description;
|
|
|
|
private String author;
|
|
|
|
private String status;
|
|
|
|
@Column(name = "options_json", columnDefinition = "TEXT")
|
|
private String optionsJson;
|
|
|
|
// --> JSON array of voter usernames who already voted; used to reject duplicate votes.
|
|
@Column(name = "voters_json", columnDefinition = "TEXT")
|
|
private String votersJson;
|
|
|
|
private int responseCount;
|
|
|
|
private String deadline;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public String getAuthor() {
|
|
return author;
|
|
}
|
|
|
|
public void setAuthor(String author) {
|
|
this.author = author;
|
|
}
|
|
|
|
public String getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(String status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public String getOptionsJson() {
|
|
return optionsJson;
|
|
}
|
|
|
|
public void setOptionsJson(String optionsJson) {
|
|
this.optionsJson = optionsJson;
|
|
}
|
|
|
|
public String getVotersJson() {
|
|
return votersJson;
|
|
}
|
|
|
|
public void setVotersJson(String votersJson) {
|
|
this.votersJson = votersJson;
|
|
}
|
|
|
|
public int getResponseCount() {
|
|
return responseCount;
|
|
}
|
|
|
|
public void setResponseCount(int responseCount) {
|
|
this.responseCount = responseCount;
|
|
}
|
|
|
|
public String getDeadline() {
|
|
return deadline;
|
|
}
|
|
|
|
public void setDeadline(String deadline) {
|
|
this.deadline = deadline;
|
|
}
|
|
}
|