|
|
|
@ -19,6 +19,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
@ -40,6 +41,7 @@ import org.thingsboard.server.dao.tenant.TenantService; |
|
|
|
import org.thingsboard.server.queue.util.TbCoreComponent; |
|
|
|
import org.thingsboard.server.service.entitiy.tenant.TbTenantService; |
|
|
|
import org.thingsboard.server.service.security.permission.Operation; |
|
|
|
import org.thingsboard.server.service.security.permission.Resource; |
|
|
|
|
|
|
|
import static org.thingsboard.server.controller.ControllerConstants.HOME_DASHBOARD; |
|
|
|
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS; |
|
|
|
@ -61,7 +63,7 @@ import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LI |
|
|
|
@TbCoreComponent |
|
|
|
@RequestMapping("/api") |
|
|
|
@Slf4j |
|
|
|
@AllArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class TenantController extends BaseController { |
|
|
|
|
|
|
|
private static final String TENANT_INFO_DESCRIPTION = "The Tenant Info object extends regular Tenant object and includes Tenant Profile name. "; |
|
|
|
@ -120,6 +122,7 @@ public class TenantController extends BaseController { |
|
|
|
@ResponseBody |
|
|
|
public Tenant saveTenant(@ApiParam(value = "A JSON value representing the tenant.") |
|
|
|
@RequestBody Tenant tenant) throws ThingsboardException { |
|
|
|
checkEntity(tenant.getId(), tenant, Resource.TENANT); |
|
|
|
return tbTenantService.save(tenant); |
|
|
|
} |
|
|
|
|
|
|
|
|