| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- package cn.seecoder.seecoderbokserver.domain;
- import cn.seecoder.bok.common.QuestionState;
- import cn.seecoder.bok.common.QuestionType;
- import org.springframework.data.annotation.CreatedDate;
- import org.springframework.data.annotation.Id;
- import org.springframework.data.annotation.LastModifiedDate;
- import org.springframework.data.annotation.TypeAlias;
- import org.springframework.data.elasticsearch.annotations.DateFormat;
- import org.springframework.data.elasticsearch.annotations.Document;
- import org.springframework.data.elasticsearch.annotations.Field;
- import org.springframework.data.elasticsearch.annotations.FieldType;
- import javax.persistence.EnumType;
- import javax.persistence.Enumerated;
- import java.time.Instant;
- import java.util.List;
- import java.util.Map;
- /**
- * @author Kunduin
- */
- @Document(indexName = "question")
- @TypeAlias("question")
- public class Question {
- @Id
- @Field(name = "id", type = FieldType.Keyword)
- private String id;
- @Field(name = "type", type = FieldType.Keyword)
- private QuestionType type;
- @Enumerated(EnumType.STRING)
- @Field(name = "state", type = FieldType.Keyword)
- private QuestionState state;
- @Field(name = "checkedUserId", type = FieldType.Integer)
- private Integer checkedUserId;
- @Field(name = "savedUserId", type = FieldType.Integer)
- private Integer savedUserId;
- @Field(name = "title", type = FieldType.Text)
- private String title;
- @Field(name = "stem", type = FieldType.Text)
- private String stem;
- @Field(name = "weight", type = FieldType.Integer)
- private Integer weight;
- @Field(name = "analysis", type = FieldType.Text)
- private String analysis;
- @Field(name = "key_points", type = FieldType.Text)
- private String keyPoints;
- @Field(name = "tags", type = FieldType.Text)
- private List<String> tags;
- @Field(name = "knowledge_id", type = FieldType.Text)
- private List<String> knowledgeId;
- @Field(name = "options", type = FieldType.Object)
- private Map<String, String> options;
- @Field(name = "blanks", type = FieldType.Object)
- private Map<String, String> blanks;
- @Field(name = "answer", type = FieldType.Text)
- private String answer;
- @Field(name = "input_output_mapping", type = FieldType.Object, index = false)
- private Map<String, String> inputOutputMapping;
- @Field(name = "millisecond_limit", type = FieldType.Integer)
- private Integer millisecondLimit;
- @Field(name = "memory_limit", type = FieldType.Integer)
- private Integer memoryLimit;
- @CreatedDate
- @Field(name = "created_at", type = FieldType.Date, format = DateFormat.basic_date_time)
- private Instant createdTime;
- @LastModifiedDate
- @Field(name = "updated_at", type = FieldType.Date, format = DateFormat.basic_date_time)
- private Instant lastModifiedTime;
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public QuestionType getType() {
- return type;
- }
- public void setType(QuestionType type) {
- this.type = type;
- }
- public String getTitle() {
- return title;
- }
- public void setTitle(String title) {
- this.title = title;
- }
- public Integer getWeight() {
- return weight;
- }
- public void setWeight(Integer weight) {
- this.weight = weight;
- }
- public String getStem() {
- return stem;
- }
- public void setStem(String stem) {
- this.stem = stem;
- }
- public String getAnalysis() {
- return analysis;
- }
- public void setAnalysis(String analysis) {
- this.analysis = analysis;
- }
- public String getKeyPoints() {
- return keyPoints;
- }
- public void setKeyPoints(String keyPoints) {
- this.keyPoints = keyPoints;
- }
- public List<String> getTags() {
- return tags;
- }
- public void setTags(List<String> tags) {
- this.tags = tags;
- }
- public List<String> getKnowledgeId() {
- return knowledgeId;
- }
- public void setKnowledgeId(List<String> knowledgeId) {
- this.knowledgeId = knowledgeId;
- }
- public Map<String, String> getOptions() {
- return options;
- }
- public void setOptions(Map<String, String> options) {
- this.options = options;
- }
- public Map<String, String> getBlanks() {
- return blanks;
- }
- public void setBlanks(Map<String, String> blanks) {
- this.blanks = blanks;
- }
- public String getAnswer() {
- return answer;
- }
- public void setAnswer(String answer) {
- this.answer = answer;
- }
- public Map<String, String> getInputOutputMapping() {
- return inputOutputMapping;
- }
- public void setInputOutputMapping(Map<String, String> inputOutputMapping) {
- this.inputOutputMapping = inputOutputMapping;
- }
- public Integer getMillisecondLimit() {
- return millisecondLimit;
- }
- public void setMillisecondLimit(Integer millisecondLimit) {
- this.millisecondLimit = millisecondLimit;
- }
- public Integer getMemoryLimit() {
- return memoryLimit;
- }
- public void setMemoryLimit(Integer memoryLimit) {
- this.memoryLimit = memoryLimit;
- }
- public Instant getLastModifiedTime() {
- return lastModifiedTime;
- }
- public void setLastModifiedTime(Instant lastModifiedTime) {
- this.lastModifiedTime = lastModifiedTime;
- }
- public Instant getCreatedTime() {
- return createdTime;
- }
- public void setCreatedTime(Instant createdTime) {
- this.createdTime = createdTime;
- }
- public Integer getCheckedUserId() {
- return checkedUserId;
- }
- public void setCheckedUserId(Integer checkedUserId) {
- this.checkedUserId = checkedUserId;
- }
- public Integer getSavedUserId() {
- return savedUserId;
- }
- public void setSavedUserId(Integer savedUserId) {
- this.savedUserId = savedUserId;
- }
- public QuestionState getState() {
- return state;
- }
- public void setState(QuestionState state) {
- this.state = state;
- }
- @Override
- public String toString() {
- return "Question{" +
- "id='" + id + '\'' +
- ", type=" + type +
- ", state=" + state +
- ", checkedUserId=" + checkedUserId +
- ", savedUserId=" + savedUserId +
- ", title='" + title + '\'' +
- ", stem='" + stem + '\'' +
- ", weight=" + weight +
- ", analysis='" + analysis + '\'' +
- ", keyPoints='" + keyPoints + '\'' +
- ", tags=" + tags +
- ", knowledgeId=" + knowledgeId +
- ", options=" + options +
- ", blanks=" + blanks +
- ", answer='" + answer + '\'' +
- ", inputOutputMapping=" + inputOutputMapping +
- ", millisecondLimit=" + millisecondLimit +
- ", memoryLimit=" + memoryLimit +
- ", createdTime=" + createdTime +
- ", lastModifiedTime=" + lastModifiedTime +
- '}';
- }
- }
|