KanbanInstance.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package com.uas.kanban.model;
  2. import java.util.List;
  3. import java.util.Map;
  4. import org.mongodb.morphia.annotations.Embedded;
  5. import com.uas.kanban.annotation.FieldProperty;
  6. import com.uas.kanban.base.BaseEntity;
  7. /**
  8. * 看板实例
  9. *
  10. * @author sunyj
  11. * @since 2017年9月3日 下午5:21:06
  12. */
  13. public class KanbanInstance extends BaseEntity {
  14. private static final long serialVersionUID = 1L;
  15. /**
  16. * 默认切换频率为 10 s
  17. */
  18. public static final double DEFAULT_SWITCH_FREQUENCY = 10;
  19. /**
  20. * 默认刷新频率为 5 s
  21. */
  22. public static final double DEFAULT_REFRESH_FREQUENCY = 5;
  23. /**
  24. * 看板的 code
  25. */
  26. @FieldProperty(nullable = false)
  27. private String kanbanCode;
  28. /**
  29. * 切换频率(秒)看板的展示方式为 {@link Kanban.Display#AutoSwitch} 时,才生效)
  30. */
  31. private Double switchFrequency;
  32. /**
  33. * 刷新频率(秒)
  34. */
  35. @FieldProperty(nullable = false)
  36. private Double refreshFrequency;
  37. /**
  38. * 公共参数
  39. */
  40. @Embedded
  41. private List<GlobalParameter> globalParameters;
  42. /**
  43. * 看板实例参数
  44. * <p/>
  45. * <table border=1 cellpadding=5 cellspacing=0 summary= "Key and value">
  46. * <tr>
  47. * <th>key</th>
  48. * <th>value</th>
  49. * </tr>
  50. * <tr>
  51. * <td>模版 code</td>
  52. * <td>模版参数</td>
  53. * </tr>
  54. * </table>
  55. */
  56. @Embedded
  57. private Map<String, List<TemplateParameter>> parameters;
  58. public String getKanbanCode() {
  59. return kanbanCode;
  60. }
  61. public void setKanbanCode(String kanbanCode) {
  62. this.kanbanCode = kanbanCode;
  63. }
  64. public Double getSwitchFrequency() {
  65. return switchFrequency;
  66. }
  67. public void setSwitchFrequency(Double switchFrequency) {
  68. this.switchFrequency = switchFrequency;
  69. }
  70. public Double getRefreshFrequency() {
  71. return refreshFrequency;
  72. }
  73. public void setRefreshFrequency(Double refreshFrequency) {
  74. this.refreshFrequency = refreshFrequency;
  75. }
  76. public List<GlobalParameter> getGlobalParameters() {
  77. return globalParameters;
  78. }
  79. public void setGlobalParameters(List<GlobalParameter> globalParameters) {
  80. this.globalParameters = globalParameters;
  81. }
  82. public Map<String, List<TemplateParameter>> getParameters() {
  83. return parameters;
  84. }
  85. public void setParameters(Map<String, List<TemplateParameter>> parameters) {
  86. this.parameters = parameters;
  87. }
  88. @Override
  89. public String toString() {
  90. return "KanbanInstance [kanbanCode=" + kanbanCode + ", switchFrequency=" + switchFrequency
  91. + ", refreshFrequency=" + refreshFrequency + ", globalParameters=" + globalParameters + ", parameters="
  92. + parameters + ", id=" + id + ", createTime=" + createTime + ", lastModified=" + lastModified
  93. + ", version=" + version + ", code=" + code + "]";
  94. }
  95. }