Commit 2e187df4485ee160edca284df3e82dd5577c5b7d

Authored by Andrii Shvaika
2 parents 2fea8570 4be37230

Merge branch 'feature/swagger-alarm-controller' of https://github.com/ShvaykaD/t…

…hingsboard into feature/swagger
@@ -221,7 +221,7 @@ public class AlarmController extends BaseController { @@ -221,7 +221,7 @@ public class AlarmController extends BaseController {
221 @RequestParam int page, 221 @RequestParam int page,
222 @ApiParam(value = ALARM_QUERY_TEXT_SEARCH_DESCRIPTION) 222 @ApiParam(value = ALARM_QUERY_TEXT_SEARCH_DESCRIPTION)
223 @RequestParam(required = false) String textSearch, 223 @RequestParam(required = false) String textSearch,
224 - @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) 224 + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = ALARM_SORT_PROPERTY_ALLOWABLE_VALUES)
225 @RequestParam(required = false) String sortProperty, 225 @RequestParam(required = false) String sortProperty,
226 @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) 226 @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
227 @RequestParam(required = false) String sortOrder, 227 @RequestParam(required = false) String sortOrder,
@@ -270,7 +270,7 @@ public class AlarmController extends BaseController { @@ -270,7 +270,7 @@ public class AlarmController extends BaseController {
270 @RequestParam int page, 270 @RequestParam int page,
271 @ApiParam(value = ALARM_QUERY_TEXT_SEARCH_DESCRIPTION) 271 @ApiParam(value = ALARM_QUERY_TEXT_SEARCH_DESCRIPTION)
272 @RequestParam(required = false) String textSearch, 272 @RequestParam(required = false) String textSearch,
273 - @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) 273 + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = ALARM_SORT_PROPERTY_ALLOWABLE_VALUES)
274 @RequestParam(required = false) String sortProperty, 274 @RequestParam(required = false) String sortProperty,
275 @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) 275 @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
276 @RequestParam(required = false) String sortOrder, 276 @RequestParam(required = false) String sortOrder,
@@ -184,6 +184,7 @@ public abstract class BaseController { @@ -184,6 +184,7 @@ public abstract class BaseController {
184 protected final String CUSTOMER_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, title, email, country, city"; 184 protected final String CUSTOMER_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, title, email, country, city";
185 protected final String DEVICE_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, name, deviceProfileName, label, customerTitle"; 185 protected final String DEVICE_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, name, deviceProfileName, label, customerTitle";
186 protected final String ASSET_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, name, type, label, customerTitle"; 186 protected final String ASSET_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, name, type, label, customerTitle";
  187 + protected final String ALARM_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, startTs, endTs, type, ackTs, clearTs, severity, status";
187 protected final String SORT_ORDER_DESCRIPTION = "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"; 188 protected final String SORT_ORDER_DESCRIPTION = "Sort order. ASC (ASCENDING) or DESC (DESCENDING)";
188 protected final String SORT_ORDER_ALLOWABLE_VALUES = "ASC, DESC"; 189 protected final String SORT_ORDER_ALLOWABLE_VALUES = "ASC, DESC";
189 protected final String DEVICE_INFO_DESCRIPTION = "Device Info is an extension of the default Device object that contains information about the assigned customer name and device profile name. "; 190 protected final String DEVICE_INFO_DESCRIPTION = "Device Info is an extension of the default Device object that contains information about the assigned customer name and device profile name. ";
@@ -17,6 +17,7 @@ package org.thingsboard.server.common.data.alarm; @@ -17,6 +17,7 @@ package org.thingsboard.server.common.data.alarm;
17 17
18 import com.fasterxml.jackson.annotation.JsonProperty; 18 import com.fasterxml.jackson.annotation.JsonProperty;
19 import com.fasterxml.jackson.databind.JsonNode; 19 import com.fasterxml.jackson.databind.JsonNode;
  20 +import io.swagger.annotations.ApiModel;
20 import io.swagger.annotations.ApiModelProperty; 21 import io.swagger.annotations.ApiModelProperty;
21 import lombok.AllArgsConstructor; 22 import lombok.AllArgsConstructor;
22 import lombok.Builder; 23 import lombok.Builder;
@@ -35,6 +36,7 @@ import java.util.List; @@ -35,6 +36,7 @@ import java.util.List;
35 /** 36 /**
36 * Created by ashvayka on 11.05.17. 37 * Created by ashvayka on 11.05.17.
37 */ 38 */
  39 +@ApiModel
38 @Data 40 @Data
39 @Builder 41 @Builder
40 @AllArgsConstructor 42 @AllArgsConstructor
@@ -15,8 +15,10 @@ @@ -15,8 +15,10 @@
15 */ 15 */
16 package org.thingsboard.server.common.data.alarm; 16 package org.thingsboard.server.common.data.alarm;
17 17
  18 +import io.swagger.annotations.ApiModel;
18 import io.swagger.annotations.ApiModelProperty; 19 import io.swagger.annotations.ApiModelProperty;
19 20
  21 +@ApiModel
20 public class AlarmInfo extends Alarm { 22 public class AlarmInfo extends Alarm {
21 23
22 private static final long serialVersionUID = 2807343093519543363L; 24 private static final long serialVersionUID = 2807343093519543363L;