Question.java 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. package cn.seecoder.seecoderbokserver.domain;
  2. import cn.seecoder.bok.common.QuestionState;
  3. import cn.seecoder.bok.common.QuestionType;
  4. import org.springframework.data.annotation.CreatedDate;
  5. import org.springframework.data.annotation.Id;
  6. import org.springframework.data.annotation.LastModifiedDate;
  7. import org.springframework.data.annotation.TypeAlias;
  8. import org.springframework.data.elasticsearch.annotations.DateFormat;
  9. import org.springframework.data.elasticsearch.annotations.Document;
  10. import org.springframework.data.elasticsearch.annotations.Field;
  11. import org.springframework.data.elasticsearch.annotations.FieldType;
  12. import javax.persistence.EnumType;
  13. import javax.persistence.Enumerated;
  14. import java.time.Instant;
  15. import java.util.List;
  16. import java.util.Map;
  17. /**
  18. * @author Kunduin
  19. */
  20. @Document(indexName = "question")
  21. @TypeAlias("question")
  22. public class Question {
  23. @Id
  24. @Field(name = "id", type = FieldType.Keyword)
  25. private String id;
  26. @Field(name = "type", type = FieldType.Keyword)
  27. private QuestionType type;
  28. @Enumerated(EnumType.STRING)
  29. @Field(name = "state", type = FieldType.Keyword)
  30. private QuestionState state;
  31. @Field(name = "checkedUserId", type = FieldType.Integer)
  32. private Integer checkedUserId;
  33. @Field(name = "savedUserId", type = FieldType.Integer)
  34. private Integer savedUserId;
  35. @Field(name = "title", type = FieldType.Text)
  36. private String title;
  37. @Field(name = "stem", type = FieldType.Text)
  38. private String stem;
  39. @Field(name = "weight", type = FieldType.Integer)
  40. private Integer weight;
  41. @Field(name = "analysis", type = FieldType.Text)
  42. private String analysis;
  43. @Field(name = "key_points", type = FieldType.Text)
  44. private String keyPoints;
  45. @Field(name = "tags", type = FieldType.Text)
  46. private List<String> tags;
  47. @Field(name = "knowledge_id", type = FieldType.Text)
  48. private List<String> knowledgeId;
  49. @Field(name = "options", type = FieldType.Object)
  50. private Map<String, String> options;
  51. @Field(name = "blanks", type = FieldType.Object)
  52. private Map<String, String> blanks;
  53. @Field(name = "answer", type = FieldType.Text)
  54. private String answer;
  55. @Field(name = "input_output_mapping", type = FieldType.Object, index = false)
  56. private Map<String, String> inputOutputMapping;
  57. @Field(name = "millisecond_limit", type = FieldType.Integer)
  58. private Integer millisecondLimit;
  59. @Field(name = "memory_limit", type = FieldType.Integer)
  60. private Integer memoryLimit;
  61. @CreatedDate
  62. @Field(name = "created_at", type = FieldType.Date, format = DateFormat.basic_date_time)
  63. private Instant createdTime;
  64. @LastModifiedDate
  65. @Field(name = "updated_at", type = FieldType.Date, format = DateFormat.basic_date_time)
  66. private Instant lastModifiedTime;
  67. public String getId() {
  68. return id;
  69. }
  70. public void setId(String id) {
  71. this.id = id;
  72. }
  73. public QuestionType getType() {
  74. return type;
  75. }
  76. public void setType(QuestionType type) {
  77. this.type = type;
  78. }
  79. public String getTitle() {
  80. return title;
  81. }
  82. public void setTitle(String title) {
  83. this.title = title;
  84. }
  85. public Integer getWeight() {
  86. return weight;
  87. }
  88. public void setWeight(Integer weight) {
  89. this.weight = weight;
  90. }
  91. public String getStem() {
  92. return stem;
  93. }
  94. public void setStem(String stem) {
  95. this.stem = stem;
  96. }
  97. public String getAnalysis() {
  98. return analysis;
  99. }
  100. public void setAnalysis(String analysis) {
  101. this.analysis = analysis;
  102. }
  103. public String getKeyPoints() {
  104. return keyPoints;
  105. }
  106. public void setKeyPoints(String keyPoints) {
  107. this.keyPoints = keyPoints;
  108. }
  109. public List<String> getTags() {
  110. return tags;
  111. }
  112. public void setTags(List<String> tags) {
  113. this.tags = tags;
  114. }
  115. public List<String> getKnowledgeId() {
  116. return knowledgeId;
  117. }
  118. public void setKnowledgeId(List<String> knowledgeId) {
  119. this.knowledgeId = knowledgeId;
  120. }
  121. public Map<String, String> getOptions() {
  122. return options;
  123. }
  124. public void setOptions(Map<String, String> options) {
  125. this.options = options;
  126. }
  127. public Map<String, String> getBlanks() {
  128. return blanks;
  129. }
  130. public void setBlanks(Map<String, String> blanks) {
  131. this.blanks = blanks;
  132. }
  133. public String getAnswer() {
  134. return answer;
  135. }
  136. public void setAnswer(String answer) {
  137. this.answer = answer;
  138. }
  139. public Map<String, String> getInputOutputMapping() {
  140. return inputOutputMapping;
  141. }
  142. public void setInputOutputMapping(Map<String, String> inputOutputMapping) {
  143. this.inputOutputMapping = inputOutputMapping;
  144. }
  145. public Integer getMillisecondLimit() {
  146. return millisecondLimit;
  147. }
  148. public void setMillisecondLimit(Integer millisecondLimit) {
  149. this.millisecondLimit = millisecondLimit;
  150. }
  151. public Integer getMemoryLimit() {
  152. return memoryLimit;
  153. }
  154. public void setMemoryLimit(Integer memoryLimit) {
  155. this.memoryLimit = memoryLimit;
  156. }
  157. public Instant getLastModifiedTime() {
  158. return lastModifiedTime;
  159. }
  160. public void setLastModifiedTime(Instant lastModifiedTime) {
  161. this.lastModifiedTime = lastModifiedTime;
  162. }
  163. public Instant getCreatedTime() {
  164. return createdTime;
  165. }
  166. public void setCreatedTime(Instant createdTime) {
  167. this.createdTime = createdTime;
  168. }
  169. public Integer getCheckedUserId() {
  170. return checkedUserId;
  171. }
  172. public void setCheckedUserId(Integer checkedUserId) {
  173. this.checkedUserId = checkedUserId;
  174. }
  175. public Integer getSavedUserId() {
  176. return savedUserId;
  177. }
  178. public void setSavedUserId(Integer savedUserId) {
  179. this.savedUserId = savedUserId;
  180. }
  181. public QuestionState getState() {
  182. return state;
  183. }
  184. public void setState(QuestionState state) {
  185. this.state = state;
  186. }
  187. @Override
  188. public String toString() {
  189. return "Question{" +
  190. "id='" + id + '\'' +
  191. ", type=" + type +
  192. ", state=" + state +
  193. ", checkedUserId=" + checkedUserId +
  194. ", savedUserId=" + savedUserId +
  195. ", title='" + title + '\'' +
  196. ", stem='" + stem + '\'' +
  197. ", weight=" + weight +
  198. ", analysis='" + analysis + '\'' +
  199. ", keyPoints='" + keyPoints + '\'' +
  200. ", tags=" + tags +
  201. ", knowledgeId=" + knowledgeId +
  202. ", options=" + options +
  203. ", blanks=" + blanks +
  204. ", answer='" + answer + '\'' +
  205. ", inputOutputMapping=" + inputOutputMapping +
  206. ", millisecondLimit=" + millisecondLimit +
  207. ", memoryLimit=" + memoryLimit +
  208. ", createdTime=" + createdTime +
  209. ", lastModifiedTime=" + lastModifiedTime +
  210. '}';
  211. }
  212. }