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