|
|
@@ -103,7 +103,10 @@ public class AssetController extends BaseController {
|
|
|
@GetMapping("/get/{id}")
|
|
|
@JsonView(Asset.View.Basic.class)
|
|
|
public Asset get(@PathVariable Long id) {
|
|
|
- Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ Asset asset = assetRepo.findByIdAndUserIdAndDel(id, SecurityUtils.getAuthenticatedUser().getId(), false);
|
|
|
+ if (asset == null) {
|
|
|
+ throw new BusinessException("无记录");
|
|
|
+ }
|
|
|
if (asset.getType().equals(CollectionType.DOMAIN)) {
|
|
|
String domainName = asset.getName().substring(9);
|
|
|
DomainOrder domainOrder = domainOrderRepo
|
|
|
@@ -168,7 +171,7 @@ public class AssetController extends BaseController {
|
|
|
@ApiOperation("转赠(无gas费)")
|
|
|
public GiftOrder giftWithoutGasFee(@RequestParam Long assetId, @RequestParam Long toUserId, @RequestParam String tradeCode) {
|
|
|
return giftOrderService.giftWithoutGasFee(SecurityUtils.getAuthenticatedUser()
|
|
|
- .getId(), assetId, toUserId, tradeCode);
|
|
|
+ .getId(), assetId, toUserId, tradeCode);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/tokenHistory")
|
|
|
@@ -233,7 +236,7 @@ public class AssetController extends BaseController {
|
|
|
@PostMapping("/metaDestroy")
|
|
|
public void metaDestroy(@RequestBody MetaDestroyParam metaDestroyParam) {
|
|
|
assetService.metaDestroyWithoutTradeCode(metaDestroyParam, SecurityUtils.getAuthenticatedUser()
|
|
|
- .getId(), OperationSource.META);
|
|
|
+ .getId(), OperationSource.META);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("开盲盒")
|
|
|
@@ -259,7 +262,7 @@ public class AssetController extends BaseController {
|
|
|
return 0;
|
|
|
}
|
|
|
return assetService.getRoyalties(asset.getMinterId(), asset.getRoyalties(), SecurityUtils.getAuthenticatedUser()
|
|
|
- .getId());
|
|
|
+ .getId());
|
|
|
}
|
|
|
|
|
|
@PostMapping("/getServicecharge")
|
|
|
@@ -269,7 +272,7 @@ public class AssetController extends BaseController {
|
|
|
return assetService.getDomainServiceCharge(SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
return assetService.getServicecharge(asset.getServiceCharge(), SecurityUtils.getAuthenticatedUser()
|
|
|
- .getId());
|
|
|
+ .getId());
|
|
|
}
|
|
|
|
|
|
@GetMapping("/hcChain")
|