Showing
1 changed file
with
4 additions
and
8 deletions
@@ -15,32 +15,28 @@ | @@ -15,32 +15,28 @@ | ||
15 | */ | 15 | */ |
16 | package org.thingsboard.server.controller; | 16 | package org.thingsboard.server.controller; |
17 | 17 | ||
18 | -import com.google.common.util.concurrent.ListenableFuture; | ||
19 | import org.springframework.http.HttpStatus; | 18 | import org.springframework.http.HttpStatus; |
20 | import org.springframework.security.access.prepost.PreAuthorize; | 19 | import org.springframework.security.access.prepost.PreAuthorize; |
21 | import org.springframework.web.bind.annotation.*; | 20 | import org.springframework.web.bind.annotation.*; |
22 | import org.thingsboard.server.common.data.Customer; | 21 | import org.thingsboard.server.common.data.Customer; |
23 | -import org.thingsboard.server.common.data.Device; | ||
24 | -import org.thingsboard.server.common.data.EntitySubtype; | ||
25 | import org.thingsboard.server.common.data.EntityType; | 22 | import org.thingsboard.server.common.data.EntityType; |
26 | import org.thingsboard.server.common.data.EntityView; | 23 | import org.thingsboard.server.common.data.EntityView; |
27 | import org.thingsboard.server.common.data.audit.ActionType; | 24 | import org.thingsboard.server.common.data.audit.ActionType; |
28 | import org.thingsboard.server.common.data.entityview.EntityViewSearchQuery; | 25 | import org.thingsboard.server.common.data.entityview.EntityViewSearchQuery; |
29 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 26 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
30 | import org.thingsboard.server.common.data.id.CustomerId; | 27 | import org.thingsboard.server.common.data.id.CustomerId; |
31 | -import org.thingsboard.server.common.data.id.DeviceId; | ||
32 | import org.thingsboard.server.common.data.id.EntityViewId; | 28 | import org.thingsboard.server.common.data.id.EntityViewId; |
33 | import org.thingsboard.server.common.data.id.TenantId; | 29 | import org.thingsboard.server.common.data.id.TenantId; |
34 | import org.thingsboard.server.common.data.page.TextPageData; | 30 | import org.thingsboard.server.common.data.page.TextPageData; |
35 | import org.thingsboard.server.common.data.page.TextPageLink; | 31 | import org.thingsboard.server.common.data.page.TextPageLink; |
36 | import org.thingsboard.server.dao.exception.IncorrectParameterException; | 32 | import org.thingsboard.server.dao.exception.IncorrectParameterException; |
37 | import org.thingsboard.server.dao.model.ModelConstants; | 33 | import org.thingsboard.server.dao.model.ModelConstants; |
38 | -import org.thingsboard.server.service.security.model.SecurityUser; | ||
39 | 34 | ||
40 | -import java.util.ArrayList; | ||
41 | import java.util.List; | 35 | import java.util.List; |
42 | import java.util.stream.Collectors; | 36 | import java.util.stream.Collectors; |
43 | 37 | ||
38 | +import static org.thingsboard.server.controller.CustomerController.CUSTOMER_ID; | ||
39 | + | ||
44 | /** | 40 | /** |
45 | * Created by Victor Basanets on 8/28/2017. | 41 | * Created by Victor Basanets on 8/28/2017. |
46 | */ | 42 | */ |
@@ -109,9 +105,9 @@ public class EntityViewController extends BaseController { | @@ -109,9 +105,9 @@ public class EntityViewController extends BaseController { | ||
109 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") | 105 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
110 | @RequestMapping(value = "/customer/{customerId}/entityView/{entityViewId}", method = RequestMethod.POST) | 106 | @RequestMapping(value = "/customer/{customerId}/entityView/{entityViewId}", method = RequestMethod.POST) |
111 | @ResponseBody | 107 | @ResponseBody |
112 | - public EntityView assignEntityViewToCustomer(@PathVariable("customerId") String strCustomerId, | 108 | + public EntityView assignEntityViewToCustomer(@PathVariable(CUSTOMER_ID) String strCustomerId, |
113 | @PathVariable(ENTITY_VIEW_ID) String strEntityViewId) throws ThingsboardException { | 109 | @PathVariable(ENTITY_VIEW_ID) String strEntityViewId) throws ThingsboardException { |
114 | - checkParameter("customerId", strCustomerId); | 110 | + checkParameter(CUSTOMER_ID, strCustomerId); |
115 | checkParameter(ENTITY_VIEW_ID, strEntityViewId); | 111 | checkParameter(ENTITY_VIEW_ID, strEntityViewId); |
116 | try { | 112 | try { |
117 | CustomerId customerId = new CustomerId(toUUID(strCustomerId)); | 113 | CustomerId customerId = new CustomerId(toUUID(strCustomerId)); |