Commit 1c5ca328e9859b580d8bc1c670e1f1938f81a0dc
1 parent
427e7ac0
Added ApiParam to edge controller methods
Showing
3 changed files
with
62 additions
and
14 deletions
@@ -162,6 +162,7 @@ public abstract class BaseController { | @@ -162,6 +162,7 @@ public abstract class BaseController { | ||
162 | public static final String TENANT_ID_PARAM_DESCRIPTION = "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; | 162 | public static final String TENANT_ID_PARAM_DESCRIPTION = "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; |
163 | public static final String EDGE_ID_PARAM_DESCRIPTION = "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; | 163 | public static final String EDGE_ID_PARAM_DESCRIPTION = "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; |
164 | public static final String CUSTOMER_ID_PARAM_DESCRIPTION = "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; | 164 | public static final String CUSTOMER_ID_PARAM_DESCRIPTION = "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; |
165 | + public static final String RULE_CHAIN_ID_PARAM_DESCRIPTION = "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'"; | ||
165 | 166 | ||
166 | protected final String PAGE_SIZE_DESCRIPTION = "Maximum amount of entities in a one page"; | 167 | protected final String PAGE_SIZE_DESCRIPTION = "Maximum amount of entities in a one page"; |
167 | protected final String PAGE_NUMBER_DESCRIPTION = "Sequence number of page starting from 0"; | 168 | protected final String PAGE_NUMBER_DESCRIPTION = "Sequence number of page starting from 0"; |
@@ -174,7 +175,8 @@ public abstract class BaseController { | @@ -174,7 +175,8 @@ public abstract class BaseController { | ||
174 | protected final String SORT_ORDER_ALLOWABLE_VALUES = "ASC, DESC"; | 175 | protected final String SORT_ORDER_ALLOWABLE_VALUES = "ASC, DESC"; |
175 | 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. "; | 176 | 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. "; |
176 | 177 | ||
177 | - protected final String EDGE_EVENT_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'startsWith' filter based on the edge event type name."; | 178 | + protected final String EDGE_TYPE_DESCRIPTION = "A string value representing the edge type. For example, 'default'"; |
179 | + protected final String EDGE_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'startsWith' filter based on the edge name."; | ||
178 | 180 | ||
179 | public static final String INCORRECT_TENANT_ID = "Incorrect tenantId "; | 181 | public static final String INCORRECT_TENANT_ID = "Incorrect tenantId "; |
180 | protected static final String DEFAULT_DASHBOARD = "defaultDashboardId"; | 182 | protected static final String DEFAULT_DASHBOARD = "defaultDashboardId"; |
@@ -18,6 +18,7 @@ package org.thingsboard.server.controller; | @@ -18,6 +18,7 @@ package org.thingsboard.server.controller; | ||
18 | import com.fasterxml.jackson.databind.JsonNode; | 18 | import com.fasterxml.jackson.databind.JsonNode; |
19 | import com.google.common.util.concurrent.ListenableFuture; | 19 | import com.google.common.util.concurrent.ListenableFuture; |
20 | import io.swagger.annotations.ApiOperation; | 20 | import io.swagger.annotations.ApiOperation; |
21 | +import io.swagger.annotations.ApiParam; | ||
21 | import lombok.RequiredArgsConstructor; | 22 | import lombok.RequiredArgsConstructor; |
22 | import lombok.extern.slf4j.Slf4j; | 23 | import lombok.extern.slf4j.Slf4j; |
23 | import org.springframework.http.HttpStatus; | 24 | import org.springframework.http.HttpStatus; |
@@ -93,7 +94,8 @@ public class EdgeController extends BaseController { | @@ -93,7 +94,8 @@ public class EdgeController extends BaseController { | ||
93 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") | 94 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
94 | @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.GET) | 95 | @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.GET) |
95 | @ResponseBody | 96 | @ResponseBody |
96 | - public Edge getEdgeById(@PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 97 | + public Edge getEdgeById(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
98 | + @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | ||
97 | checkParameter(EDGE_ID, strEdgeId); | 99 | checkParameter(EDGE_ID, strEdgeId); |
98 | try { | 100 | try { |
99 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 101 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
@@ -112,7 +114,8 @@ public class EdgeController extends BaseController { | @@ -112,7 +114,8 @@ public class EdgeController extends BaseController { | ||
112 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") | 114 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") |
113 | @RequestMapping(value = "/edge/info/{edgeId}", method = RequestMethod.GET) | 115 | @RequestMapping(value = "/edge/info/{edgeId}", method = RequestMethod.GET) |
114 | @ResponseBody | 116 | @ResponseBody |
115 | - public EdgeInfo getEdgeInfoById(@PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 117 | + public EdgeInfo getEdgeInfoById(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
118 | + @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | ||
116 | checkParameter(EDGE_ID, strEdgeId); | 119 | checkParameter(EDGE_ID, strEdgeId); |
117 | try { | 120 | try { |
118 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 121 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
@@ -133,7 +136,8 @@ public class EdgeController extends BaseController { | @@ -133,7 +136,8 @@ public class EdgeController extends BaseController { | ||
133 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 136 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
134 | @RequestMapping(value = "/edge", method = RequestMethod.POST) | 137 | @RequestMapping(value = "/edge", method = RequestMethod.POST) |
135 | @ResponseBody | 138 | @ResponseBody |
136 | - public Edge saveEdge(@RequestBody Edge edge) throws ThingsboardException { | 139 | + public Edge saveEdge(@ApiParam(value = "A JSON value representing the ed.") |
140 | + @RequestBody Edge edge) throws ThingsboardException { | ||
137 | try { | 141 | try { |
138 | TenantId tenantId = getCurrentUser().getTenantId(); | 142 | TenantId tenantId = getCurrentUser().getTenantId(); |
139 | edge.setTenantId(tenantId); | 143 | edge.setTenantId(tenantId); |
@@ -181,7 +185,8 @@ public class EdgeController extends BaseController { | @@ -181,7 +185,8 @@ public class EdgeController extends BaseController { | ||
181 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 185 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
182 | @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.DELETE) | 186 | @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.DELETE) |
183 | @ResponseStatus(value = HttpStatus.OK) | 187 | @ResponseStatus(value = HttpStatus.OK) |
184 | - public void deleteEdge(@PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 188 | + public void deleteEdge(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
189 | + @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | ||
185 | checkParameter(EDGE_ID, strEdgeId); | 190 | checkParameter(EDGE_ID, strEdgeId); |
186 | try { | 191 | try { |
187 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 192 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
@@ -212,10 +217,15 @@ public class EdgeController extends BaseController { | @@ -212,10 +217,15 @@ public class EdgeController extends BaseController { | ||
212 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 217 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
213 | @RequestMapping(value = "/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) | 218 | @RequestMapping(value = "/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) |
214 | @ResponseBody | 219 | @ResponseBody |
215 | - public PageData<Edge> getEdges(@RequestParam int pageSize, | 220 | + public PageData<Edge> getEdges(@ApiParam(value = PAGE_SIZE_DESCRIPTION) |
221 | + @RequestParam int pageSize, | ||
222 | + @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | ||
216 | @RequestParam int page, | 223 | @RequestParam int page, |
224 | + @ApiParam(value = EDGE_TEXT_SEARCH_DESCRIPTION) | ||
217 | @RequestParam(required = false) String textSearch, | 225 | @RequestParam(required = false) String textSearch, |
226 | + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | ||
218 | @RequestParam(required = false) String sortProperty, | 227 | @RequestParam(required = false) String sortProperty, |
228 | + @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) | ||
219 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { | 229 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { |
220 | try { | 230 | try { |
221 | PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); | 231 | PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
@@ -231,7 +241,9 @@ public class EdgeController extends BaseController { | @@ -231,7 +241,9 @@ public class EdgeController extends BaseController { | ||
231 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 241 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
232 | @RequestMapping(value = "/customer/{customerId}/edge/{edgeId}", method = RequestMethod.POST) | 242 | @RequestMapping(value = "/customer/{customerId}/edge/{edgeId}", method = RequestMethod.POST) |
233 | @ResponseBody | 243 | @ResponseBody |
234 | - public Edge assignEdgeToCustomer(@PathVariable("customerId") String strCustomerId, | 244 | + public Edge assignEdgeToCustomer(@ApiParam(value = CUSTOMER_ID_PARAM_DESCRIPTION) |
245 | + @PathVariable("customerId") String strCustomerId, | ||
246 | + @ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) | ||
235 | @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 247 | @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { |
236 | checkParameter("customerId", strCustomerId); | 248 | checkParameter("customerId", strCustomerId); |
237 | checkParameter(EDGE_ID, strEdgeId); | 249 | checkParameter(EDGE_ID, strEdgeId); |
@@ -268,7 +280,8 @@ public class EdgeController extends BaseController { | @@ -268,7 +280,8 @@ public class EdgeController extends BaseController { | ||
268 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 280 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
269 | @RequestMapping(value = "/customer/edge/{edgeId}", method = RequestMethod.DELETE) | 281 | @RequestMapping(value = "/customer/edge/{edgeId}", method = RequestMethod.DELETE) |
270 | @ResponseBody | 282 | @ResponseBody |
271 | - public Edge unassignEdgeFromCustomer(@PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 283 | + public Edge unassignEdgeFromCustomer(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
284 | + @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | ||
272 | checkParameter(EDGE_ID, strEdgeId); | 285 | checkParameter(EDGE_ID, strEdgeId); |
273 | try { | 286 | try { |
274 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 287 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
@@ -306,7 +319,8 @@ public class EdgeController extends BaseController { | @@ -306,7 +319,8 @@ public class EdgeController extends BaseController { | ||
306 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 319 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
307 | @RequestMapping(value = "/customer/public/edge/{edgeId}", method = RequestMethod.POST) | 320 | @RequestMapping(value = "/customer/public/edge/{edgeId}", method = RequestMethod.POST) |
308 | @ResponseBody | 321 | @ResponseBody |
309 | - public Edge assignEdgeToPublicCustomer(@PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | 322 | + public Edge assignEdgeToPublicCustomer(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
323 | + @PathVariable(EDGE_ID) String strEdgeId) throws ThingsboardException { | ||
310 | checkParameter(EDGE_ID, strEdgeId); | 324 | checkParameter(EDGE_ID, strEdgeId); |
311 | try { | 325 | try { |
312 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 326 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
@@ -337,11 +351,17 @@ public class EdgeController extends BaseController { | @@ -337,11 +351,17 @@ public class EdgeController extends BaseController { | ||
337 | @RequestMapping(value = "/tenant/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) | 351 | @RequestMapping(value = "/tenant/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) |
338 | @ResponseBody | 352 | @ResponseBody |
339 | public PageData<Edge> getTenantEdges( | 353 | public PageData<Edge> getTenantEdges( |
354 | + @ApiParam(value = PAGE_SIZE_DESCRIPTION) | ||
340 | @RequestParam int pageSize, | 355 | @RequestParam int pageSize, |
356 | + @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | ||
341 | @RequestParam int page, | 357 | @RequestParam int page, |
358 | + @ApiParam(value = EDGE_TYPE_DESCRIPTION) | ||
342 | @RequestParam(required = false) String type, | 359 | @RequestParam(required = false) String type, |
360 | + @ApiParam(value = EDGE_TEXT_SEARCH_DESCRIPTION) | ||
343 | @RequestParam(required = false) String textSearch, | 361 | @RequestParam(required = false) String textSearch, |
362 | + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | ||
344 | @RequestParam(required = false) String sortProperty, | 363 | @RequestParam(required = false) String sortProperty, |
364 | + @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) | ||
345 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { | 365 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { |
346 | try { | 366 | try { |
347 | TenantId tenantId = getCurrentUser().getTenantId(); | 367 | TenantId tenantId = getCurrentUser().getTenantId(); |
@@ -363,11 +383,17 @@ public class EdgeController extends BaseController { | @@ -363,11 +383,17 @@ public class EdgeController extends BaseController { | ||
363 | @RequestMapping(value = "/tenant/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) | 383 | @RequestMapping(value = "/tenant/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) |
364 | @ResponseBody | 384 | @ResponseBody |
365 | public PageData<EdgeInfo> getTenantEdgeInfos( | 385 | public PageData<EdgeInfo> getTenantEdgeInfos( |
386 | + @ApiParam(value = PAGE_SIZE_DESCRIPTION) | ||
366 | @RequestParam int pageSize, | 387 | @RequestParam int pageSize, |
388 | + @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | ||
367 | @RequestParam int page, | 389 | @RequestParam int page, |
390 | + @ApiParam(value = EDGE_TYPE_DESCRIPTION) | ||
368 | @RequestParam(required = false) String type, | 391 | @RequestParam(required = false) String type, |
392 | + @ApiParam(value = EDGE_TEXT_SEARCH_DESCRIPTION) | ||
369 | @RequestParam(required = false) String textSearch, | 393 | @RequestParam(required = false) String textSearch, |
394 | + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | ||
370 | @RequestParam(required = false) String sortProperty, | 395 | @RequestParam(required = false) String sortProperty, |
396 | + @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) | ||
371 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { | 397 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { |
372 | try { | 398 | try { |
373 | TenantId tenantId = getCurrentUser().getTenantId(); | 399 | TenantId tenantId = getCurrentUser().getTenantId(); |
@@ -388,7 +414,8 @@ public class EdgeController extends BaseController { | @@ -388,7 +414,8 @@ public class EdgeController extends BaseController { | ||
388 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 414 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
389 | @RequestMapping(value = "/tenant/edges", params = {"edgeName"}, method = RequestMethod.GET) | 415 | @RequestMapping(value = "/tenant/edges", params = {"edgeName"}, method = RequestMethod.GET) |
390 | @ResponseBody | 416 | @ResponseBody |
391 | - public Edge getTenantEdge(@RequestParam String edgeName) throws ThingsboardException { | 417 | + public Edge getTenantEdge(@ApiParam(value = "Unique name of the edge") |
418 | + @RequestParam String edgeName) throws ThingsboardException { | ||
392 | try { | 419 | try { |
393 | TenantId tenantId = getCurrentUser().getTenantId(); | 420 | TenantId tenantId = getCurrentUser().getTenantId(); |
394 | return checkNotNull(edgeService.findEdgeByTenantIdAndName(tenantId, edgeName)); | 421 | return checkNotNull(edgeService.findEdgeByTenantIdAndName(tenantId, edgeName)); |
@@ -403,7 +430,9 @@ public class EdgeController extends BaseController { | @@ -403,7 +430,9 @@ public class EdgeController extends BaseController { | ||
403 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") | 430 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") |
404 | @RequestMapping(value = "/edge/{edgeId}/{ruleChainId}/root", method = RequestMethod.POST) | 431 | @RequestMapping(value = "/edge/{edgeId}/{ruleChainId}/root", method = RequestMethod.POST) |
405 | @ResponseBody | 432 | @ResponseBody |
406 | - public Edge setRootRuleChain(@PathVariable(EDGE_ID) String strEdgeId, | 433 | + public Edge setRootRuleChain(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
434 | + @PathVariable(EDGE_ID) String strEdgeId, | ||
435 | + @ApiParam(value = RULE_CHAIN_ID_PARAM_DESCRIPTION) | ||
407 | @PathVariable("ruleChainId") String strRuleChainId) throws ThingsboardException { | 436 | @PathVariable("ruleChainId") String strRuleChainId) throws ThingsboardException { |
408 | checkParameter(EDGE_ID, strEdgeId); | 437 | checkParameter(EDGE_ID, strEdgeId); |
409 | checkParameter("ruleChainId", strRuleChainId); | 438 | checkParameter("ruleChainId", strRuleChainId); |
@@ -439,12 +468,19 @@ public class EdgeController extends BaseController { | @@ -439,12 +468,19 @@ public class EdgeController extends BaseController { | ||
439 | @RequestMapping(value = "/customer/{customerId}/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) | 468 | @RequestMapping(value = "/customer/{customerId}/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) |
440 | @ResponseBody | 469 | @ResponseBody |
441 | public PageData<Edge> getCustomerEdges( | 470 | public PageData<Edge> getCustomerEdges( |
471 | + @ApiParam(value = CUSTOMER_ID_PARAM_DESCRIPTION) | ||
442 | @PathVariable("customerId") String strCustomerId, | 472 | @PathVariable("customerId") String strCustomerId, |
473 | + @ApiParam(value = PAGE_SIZE_DESCRIPTION) | ||
443 | @RequestParam int pageSize, | 474 | @RequestParam int pageSize, |
475 | + @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | ||
444 | @RequestParam int page, | 476 | @RequestParam int page, |
477 | + @ApiParam(value = EDGE_TYPE_DESCRIPTION) | ||
445 | @RequestParam(required = false) String type, | 478 | @RequestParam(required = false) String type, |
479 | + @ApiParam(value = EDGE_TEXT_SEARCH_DESCRIPTION) | ||
446 | @RequestParam(required = false) String textSearch, | 480 | @RequestParam(required = false) String textSearch, |
481 | + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | ||
447 | @RequestParam(required = false) String sortProperty, | 482 | @RequestParam(required = false) String sortProperty, |
483 | + @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) | ||
448 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { | 484 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { |
449 | checkParameter("customerId", strCustomerId); | 485 | checkParameter("customerId", strCustomerId); |
450 | try { | 486 | try { |
@@ -477,12 +513,19 @@ public class EdgeController extends BaseController { | @@ -477,12 +513,19 @@ public class EdgeController extends BaseController { | ||
477 | @RequestMapping(value = "/customer/{customerId}/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) | 513 | @RequestMapping(value = "/customer/{customerId}/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) |
478 | @ResponseBody | 514 | @ResponseBody |
479 | public PageData<EdgeInfo> getCustomerEdgeInfos( | 515 | public PageData<EdgeInfo> getCustomerEdgeInfos( |
516 | + @ApiParam(value = CUSTOMER_ID_PARAM_DESCRIPTION) | ||
480 | @PathVariable("customerId") String strCustomerId, | 517 | @PathVariable("customerId") String strCustomerId, |
518 | + @ApiParam(value = PAGE_SIZE_DESCRIPTION) | ||
481 | @RequestParam int pageSize, | 519 | @RequestParam int pageSize, |
520 | + @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | ||
482 | @RequestParam int page, | 521 | @RequestParam int page, |
522 | + @ApiParam(value = EDGE_TYPE_DESCRIPTION) | ||
483 | @RequestParam(required = false) String type, | 523 | @RequestParam(required = false) String type, |
524 | + @ApiParam(value = EDGE_TEXT_SEARCH_DESCRIPTION) | ||
484 | @RequestParam(required = false) String textSearch, | 525 | @RequestParam(required = false) String textSearch, |
526 | + @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | ||
485 | @RequestParam(required = false) String sortProperty, | 527 | @RequestParam(required = false) String sortProperty, |
528 | + @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) | ||
486 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { | 529 | @RequestParam(required = false) String sortOrder) throws ThingsboardException { |
487 | checkParameter("customerId", strCustomerId); | 530 | checkParameter("customerId", strCustomerId); |
488 | try { | 531 | try { |
@@ -514,6 +557,7 @@ public class EdgeController extends BaseController { | @@ -514,6 +557,7 @@ public class EdgeController extends BaseController { | ||
514 | @RequestMapping(value = "/edges", params = {"edgeIds"}, method = RequestMethod.GET) | 557 | @RequestMapping(value = "/edges", params = {"edgeIds"}, method = RequestMethod.GET) |
515 | @ResponseBody | 558 | @ResponseBody |
516 | public List<Edge> getEdgesByIds( | 559 | public List<Edge> getEdgesByIds( |
560 | + @ApiParam(value = "A list of edges ids, separated by comma ','") | ||
517 | @RequestParam("edgeIds") String[] strEdgeIds) throws ThingsboardException { | 561 | @RequestParam("edgeIds") String[] strEdgeIds) throws ThingsboardException { |
518 | checkArrayParameter("edgeIds", strEdgeIds); | 562 | checkArrayParameter("edgeIds", strEdgeIds); |
519 | try { | 563 | try { |
@@ -598,7 +642,8 @@ public class EdgeController extends BaseController { | @@ -598,7 +642,8 @@ public class EdgeController extends BaseController { | ||
598 | "All entities that are assigned to particular edge are going to be send to remote edge service.") | 642 | "All entities that are assigned to particular edge are going to be send to remote edge service.") |
599 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 643 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
600 | @RequestMapping(value = "/edge/sync/{edgeId}", method = RequestMethod.POST) | 644 | @RequestMapping(value = "/edge/sync/{edgeId}", method = RequestMethod.POST) |
601 | - public void syncEdge(@PathVariable("edgeId") String strEdgeId) throws ThingsboardException { | 645 | + public void syncEdge(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
646 | + @PathVariable("edgeId") String strEdgeId) throws ThingsboardException { | ||
602 | checkParameter("edgeId", strEdgeId); | 647 | checkParameter("edgeId", strEdgeId); |
603 | try { | 648 | try { |
604 | if (isEdgesEnabled()) { | 649 | if (isEdgesEnabled()) { |
@@ -620,7 +665,8 @@ public class EdgeController extends BaseController { | @@ -620,7 +665,8 @@ public class EdgeController extends BaseController { | ||
620 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 665 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
621 | @RequestMapping(value = "/edge/missingToRelatedRuleChains/{edgeId}", method = RequestMethod.GET) | 666 | @RequestMapping(value = "/edge/missingToRelatedRuleChains/{edgeId}", method = RequestMethod.GET) |
622 | @ResponseBody | 667 | @ResponseBody |
623 | - public String findMissingToRelatedRuleChains(@PathVariable("edgeId") String strEdgeId) throws ThingsboardException { | 668 | + public String findMissingToRelatedRuleChains(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION) |
669 | + @PathVariable("edgeId") String strEdgeId) throws ThingsboardException { | ||
624 | try { | 670 | try { |
625 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); | 671 | EdgeId edgeId = new EdgeId(toUUID(strEdgeId)); |
626 | edgeId = checkNotNull(edgeId); | 672 | edgeId = checkNotNull(edgeId); |
@@ -60,7 +60,7 @@ public class EdgeEventController extends BaseController { | @@ -60,7 +60,7 @@ public class EdgeEventController extends BaseController { | ||
60 | @RequestParam int pageSize, | 60 | @RequestParam int pageSize, |
61 | @ApiParam(value = PAGE_NUMBER_DESCRIPTION) | 61 | @ApiParam(value = PAGE_NUMBER_DESCRIPTION) |
62 | @RequestParam int page, | 62 | @RequestParam int page, |
63 | - @ApiParam(value = EDGE_EVENT_TEXT_SEARCH_DESCRIPTION) | 63 | + @ApiParam(value = "The case insensitive 'startsWith' filter based on the edge event type name.") |
64 | @RequestParam(required = false) String textSearch, | 64 | @RequestParam(required = false) String textSearch, |
65 | @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) | 65 | @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = SORT_PROPERTY_ALLOWABLE_VALUES) |
66 | @RequestParam(required = false) String sortProperty, | 66 | @RequestParam(required = false) String sortProperty, |