packageorg.thingsboard.server.controller;importio.swagger.annotations.ApiOperation;importio.swagger.annotations.ApiParam;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.security.access.prepost.PreAuthorize;importorg.springframework.stereotype.Service;importorg.springframework.web.bind.annotation.*;importorg.thingsboard.server.common.data.exception.ThingsboardException;importorg.thingsboard.server.common.data.id.ProjectId;importorg.thingsboard.server.common.data.id.TenantId;importorg.thingsboard.server.common.data.project.Project;importorg.thingsboard.server.dao.project.ProjectService;importjava.util.UUID;importstaticorg.thingsboard.server.controller.ControllerConstants.SYSTEM_AUTHORITY_PARAGRAPH;importstaticorg.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH;@RestController@RequestMapping("/api")@ServicepublicclassProjectControllerextendsBaseController{
@AutowiredprivateProjectService projectService;@ApiOperation(value ="Get Tenant Customer by Customer title (getTenantCustomer)",
notes ="Get the Customer using Customer Title. "+ TENANT_AUTHORITY_PARAGRAPH)@RequestMapping(value ="/project", params ={
"projectIdStr"}, method =RequestMethod.GET)@ResponseBodypublicProjectfindById(@ApiParam(value ="A string value representing the Project title.")@RequestParamString projectIdStr)throwsThingsboardException{
try{
ProjectId projectId =newProjectId(UUID.fromString(projectIdStr));return projectService.findProjectsById(TenantId.SYS_TENANT_ID, projectId);}catch(Exception e){
System.out.println(e.getMessage());System.out.println("dddddddddddddd");throwhandleException(e);}}@ApiOperation(value ="Get the Administration Settings object using key (getAdminSettings)",
notes ="Creates or Updates the Administration Settings. Platform generates random Administration Settings Id during settings creati