UserPanel.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.uas.kanban.model;
  2. import com.uas.kanban.annotation.FieldProperty;
  3. import com.uas.kanban.base.BaseEntity;
  4. import org.mongodb.morphia.annotations.Entity;
  5. import org.mongodb.morphia.annotations.Index;
  6. import org.mongodb.morphia.annotations.Indexes;
  7. /**
  8. * 中间表,用户面板(存储用户可查看的面板)
  9. *
  10. * @author sunyj
  11. * @since 2017/10/20 11:12
  12. */
  13. @Entity
  14. @Indexes(@Index(value = "userCode, panelCode", unique = true))
  15. public class UserPanel extends BaseEntity {
  16. private static final long serialVersionUID = 1L;
  17. /**
  18. * 用户 code {@link User}
  19. */
  20. @FieldProperty(nullable = false)
  21. private String userCode;
  22. /**
  23. * 面板 code {@link Panel}
  24. */
  25. @FieldProperty(nullable = false)
  26. private String panelCode;
  27. public UserPanel() {
  28. }
  29. public UserPanel(String userCode, String panelCode) {
  30. this.userCode = userCode;
  31. this.panelCode = panelCode;
  32. }
  33. public String getUserCode() {
  34. return userCode;
  35. }
  36. public void setUserCode(String userCode) {
  37. this.userCode = userCode;
  38. }
  39. public String getPanelCode() {
  40. return panelCode;
  41. }
  42. public void setPanelCode(String panelCode) {
  43. this.panelCode = panelCode;
  44. }
  45. @Override
  46. public String toString() {
  47. return "UserPanel{" +
  48. "userCode='" + userCode + '\'' +
  49. ", panelCode='" + panelCode + '\'' +
  50. "} " + super.toString();
  51. }
  52. }