AlgAbilityFetchResponseDTO.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. package com.usky.ai.dto;
  2. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  3. import com.fasterxml.jackson.annotation.JsonProperty;
  4. import com.fasterxml.jackson.databind.JsonNode;
  5. import lombok.Data;
  6. import java.util.List;
  7. @Data
  8. @JsonIgnoreProperties(ignoreUnknown = true)
  9. public class AlgAbilityFetchResponseDTO {
  10. @JsonProperty("BoardId")
  11. private String boardId;
  12. @JsonProperty("BoardIp")
  13. private String boardIp;
  14. @JsonProperty("Ability")
  15. private List<Algorithm> ability;
  16. @JsonProperty("Result")
  17. private Result result;
  18. private long time = System.currentTimeMillis();
  19. public boolean isSuccess() {
  20. return result != null && Integer.valueOf(0).equals(result.getCode());
  21. }
  22. @Data
  23. @JsonIgnoreProperties(ignoreUnknown = true)
  24. public static class Algorithm {
  25. @JsonProperty("attribute")
  26. private JsonNode attribute;
  27. @JsonProperty("parameters")
  28. private List<Parameter> parameters;
  29. @JsonProperty("permitted")
  30. private boolean permitted;
  31. @JsonProperty("code")
  32. private int code;
  33. @JsonProperty("sub")
  34. private boolean sub;
  35. @JsonProperty("name")
  36. private String name;
  37. @JsonProperty("desc")
  38. private String desc;
  39. @JsonProperty("item")
  40. private int item;
  41. @JsonProperty("policy")
  42. private List<Policy> policy;
  43. @Data
  44. @JsonIgnoreProperties(ignoreUnknown = true)
  45. public static class Parameter {
  46. @JsonProperty("class")
  47. private String classType;
  48. @JsonProperty("type")
  49. private int type;
  50. @JsonProperty("max")
  51. private Object max;
  52. @JsonProperty("min")
  53. private Object min;
  54. @JsonProperty("default")
  55. private Object defaultValue;
  56. @JsonProperty("key")
  57. private String key;
  58. @JsonProperty("name")
  59. private String name;
  60. @JsonProperty("required")
  61. private boolean required;
  62. @JsonProperty("value")
  63. private Object value;
  64. @JsonProperty("options")
  65. private List<Option> options;
  66. @Data
  67. @JsonIgnoreProperties(ignoreUnknown = true)
  68. public static class Option {
  69. @JsonProperty("enable")
  70. private boolean enable;
  71. @JsonProperty("key")
  72. private String key;
  73. @JsonProperty("value")
  74. private int value;
  75. @JsonProperty("name")
  76. private String name;
  77. }
  78. }
  79. @Data
  80. @JsonIgnoreProperties(ignoreUnknown = true)
  81. public static class Policy {
  82. @JsonProperty("property")
  83. private String property;
  84. @JsonProperty("name")
  85. private String name;
  86. }
  87. }
  88. @Data
  89. @JsonIgnoreProperties(ignoreUnknown = true)
  90. public static class Result {
  91. @JsonProperty("Code")
  92. private int code;
  93. @JsonProperty("Desc")
  94. private String desc;
  95. }
  96. }