Question.java 5.7 KB

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