Commit 1236e89bcac4e5bcf248204e2d5a03ec1852f0aa

Authored by YevhenBondarenko
1 parent 96cdae87

Queue controller description

... ... @@ -240,6 +240,8 @@ public abstract class BaseController {
240 240 protected static final String RELATION_INFO_DESCRIPTION = "Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ";
241 241 protected static final String EDGE_INFO_DESCRIPTION = "Edge Info is an extension of the default Edge object that contains information about the assigned customer name. ";
242 242 protected static final String DEVICE_PROFILE_INFO_DESCRIPTION = "Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. ";
  243 + protected static final String QUEUE_SERVICE_TYPE_DESCRIPTION = "Service type (implemented only for the TB-RULE-ENGINE)";
  244 + protected static final String QUEUE_SERVICE_TYPE_ALLOWABLE_VALUES = "TB-RULE-ENGINE, TB-CORE, TB-TRANSPORT, JS-EXECUTOR";
243 245
244 246 protected static final String DEVICE_NAME_DESCRIPTION = "A string value representing the Device name.";
245 247 protected static final String ASSET_NAME_DESCRIPTION = "A string value representing the Asset name.";
... ...
... ... @@ -15,7 +15,10 @@
15 15 */
16 16 package org.thingsboard.server.controller;
17 17
  18 +import io.swagger.annotations.ApiOperation;
  19 +import io.swagger.annotations.ApiParam;
18 20 import lombok.RequiredArgsConstructor;
  21 +import org.springframework.http.MediaType;
19 22 import org.springframework.security.access.prepost.PreAuthorize;
20 23 import org.springframework.web.bind.annotation.RequestMapping;
21 24 import org.springframework.web.bind.annotation.RequestMethod;
... ... @@ -37,10 +40,13 @@ public class QueueController extends BaseController {
37 40
38 41 private final QueueService queueService;
39 42
  43 + @ApiOperation(value = "Get queue names (getTenantQueuesByServiceType)",
  44 + notes = "Returns a set of unique queue names based on service type. " + TENANT_AUTHORITY_PARAGRAPH)
40 45 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
41   - @RequestMapping(value = "/tenant/queues", params = {"serviceType"}, method = RequestMethod.GET)
42   - @ResponseBody
43   - public Set<String> getTenantQueuesByServiceType(@RequestParam String serviceType) throws ThingsboardException {
  46 + @RequestMapping(value = "/tenant/queues", params = {"serviceType"}, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
  47 + @ResponseBody()
  48 + public Set<String> getTenantQueuesByServiceType(@ApiParam(value = QUEUE_SERVICE_TYPE_DESCRIPTION, allowableValues = QUEUE_SERVICE_TYPE_ALLOWABLE_VALUES)
  49 + @RequestParam String serviceType) throws ThingsboardException {
44 50 checkParameter("serviceType", serviceType);
45 51 try {
46 52 return queueService.getQueuesByServiceType(ServiceType.valueOf(serviceType));
... ...