Answer.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package edu.nju.entities;
  2. import org.springframework.data.annotation.Id;
  3. import org.springframework.data.mongodb.core.mapping.Document;
  4. import java.util.ArrayList;
  5. import java.util.List;
  6. @Document
  7. public class Answer implements java.io.Serializable{
  8. private static final long serialVersionUID = -8263451883506704407L;
  9. @Id
  10. private String id;
  11. private String item_id;
  12. private List<String> answers;
  13. private String worker_id;
  14. private String job_id;
  15. private List<String> attachment_location;
  16. public Answer(String item_id, List<String> answers, String worker_id, List<String> attachment_location,String job_id) {
  17. this.item_id = item_id;
  18. this.answers = answers;
  19. this.worker_id = worker_id;
  20. this.attachment_location = attachment_location;
  21. this.job_id=job_id;
  22. }
  23. public Answer(String item_id,String worker_id,String job_id,int optionNum){
  24. this.item_id = item_id;
  25. this.worker_id = worker_id;
  26. this.attachment_location = new ArrayList<>();
  27. this.job_id=job_id;
  28. this.answers=new ArrayList<>();
  29. for(int i=0;i<optionNum;i++){
  30. answers.add("-1");
  31. }
  32. }
  33. public String getId() {
  34. return id;
  35. }
  36. public void setId(String id) {
  37. this.id = id;
  38. }
  39. public String getItem_id() {
  40. return item_id;
  41. }
  42. public void setItem_id(String item_id) {
  43. this.item_id = item_id;
  44. }
  45. public List<String> getAnswers() {
  46. return answers;
  47. }
  48. public void setAnswers(List<String> answers) {
  49. this.answers = answers;
  50. }
  51. public String getWorker_id() {
  52. return worker_id;
  53. }
  54. public void setWorker_id(String worker_id) {
  55. this.worker_id = worker_id;
  56. }
  57. public List<String> getAttachment_location() {
  58. return attachment_location;
  59. }
  60. public void setAttachment_location(List<String> attachment_location) {
  61. this.attachment_location = attachment_location;
  62. }
  63. public String getJob_id() {
  64. return job_id;
  65. }
  66. public void setJob_id(String job_id) {
  67. this.job_id = job_id;
  68. }
  69. }