|
|
|
@ -78,12 +78,8 @@ public class AssetProfileController extends BaseController { |
|
|
|
@ApiParam(value = ASSET_PROFILE_ID_PARAM_DESCRIPTION) |
|
|
|
@PathVariable(ASSET_PROFILE_ID) String strAssetProfileId) throws ThingsboardException { |
|
|
|
checkParameter(ASSET_PROFILE_ID, strAssetProfileId); |
|
|
|
try { |
|
|
|
AssetProfileId assetProfileId = new AssetProfileId(toUUID(strAssetProfileId)); |
|
|
|
return checkAssetProfileId(assetProfileId, Operation.READ); |
|
|
|
} catch (Exception e) { |
|
|
|
throw handleException(e); |
|
|
|
} |
|
|
|
AssetProfileId assetProfileId = new AssetProfileId(toUUID(strAssetProfileId)); |
|
|
|
return checkAssetProfileId(assetProfileId, Operation.READ); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "Get Asset Profile Info (getAssetProfileInfoById)", |
|
|
|
@ -97,12 +93,8 @@ public class AssetProfileController extends BaseController { |
|
|
|
@ApiParam(value = ASSET_PROFILE_ID_PARAM_DESCRIPTION) |
|
|
|
@PathVariable(ASSET_PROFILE_ID) String strAssetProfileId) throws ThingsboardException { |
|
|
|
checkParameter(ASSET_PROFILE_ID, strAssetProfileId); |
|
|
|
try { |
|
|
|
AssetProfileId assetProfileId = new AssetProfileId(toUUID(strAssetProfileId)); |
|
|
|
return new AssetProfileInfo(checkAssetProfileId(assetProfileId, Operation.READ)); |
|
|
|
} catch (Exception e) { |
|
|
|
throw handleException(e); |
|
|
|
} |
|
|
|
AssetProfileId assetProfileId = new AssetProfileId(toUUID(strAssetProfileId)); |
|
|
|
return new AssetProfileInfo(checkAssetProfileId(assetProfileId, Operation.READ)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "Get Default Asset Profile (getDefaultAssetProfileInfo)", |
|
|
|
@ -113,11 +105,7 @@ public class AssetProfileController extends BaseController { |
|
|
|
@RequestMapping(value = "/assetProfileInfo/default", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public AssetProfileInfo getDefaultAssetProfileInfo() throws ThingsboardException { |
|
|
|
try { |
|
|
|
return checkNotNull(assetProfileService.findDefaultAssetProfileInfo(getTenantId())); |
|
|
|
} catch (Exception e) { |
|
|
|
throw handleException(e); |
|
|
|
} |
|
|
|
return checkNotNull(assetProfileService.findDefaultAssetProfileInfo(getTenantId())); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "Create Or Update Asset Profile (saveAssetProfile)", |
|
|
|
@ -191,12 +179,8 @@ public class AssetProfileController extends BaseController { |
|
|
|
@RequestParam(required = false) String sortProperty, |
|
|
|
@ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) |
|
|
|
@RequestParam(required = false) String sortOrder) throws ThingsboardException { |
|
|
|
try { |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
return checkNotNull(assetProfileService.findAssetProfiles(getTenantId(), pageLink)); |
|
|
|
} catch (Exception e) { |
|
|
|
throw handleException(e); |
|
|
|
} |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
return checkNotNull(assetProfileService.findAssetProfiles(getTenantId(), pageLink)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "Get Asset Profile infos (getAssetProfileInfos)", |
|
|
|
@ -217,11 +201,7 @@ public class AssetProfileController extends BaseController { |
|
|
|
@RequestParam(required = false) String sortProperty, |
|
|
|
@ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES) |
|
|
|
@RequestParam(required = false) String sortOrder) throws ThingsboardException { |
|
|
|
try { |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
return checkNotNull(assetProfileService.findAssetProfileInfos(getTenantId(), pageLink)); |
|
|
|
} catch (Exception e) { |
|
|
|
throw handleException(e); |
|
|
|
} |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
return checkNotNull(assetProfileService.findAssetProfileInfos(getTenantId(), pageLink)); |
|
|
|
} |
|
|
|
} |
|
|
|
|