新增代理明细列表

This commit is contained in:
lu7213 committed 2026-10-12 03:26:55 -04:00
1 parent 81febe2c56
commit df5512838b
12 files changed
+266 -37

No files matched your search

@@ -11,13 +11,19 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.WalletAddress;
import com.ruoyi.system.domain.WalletAddressPlus;
import com.ruoyi.system.domain.UsdtDelegationToOther;
import com.ruoyi.system.domain.UsdtOtherToDelegation;
import com.ruoyi.system.service.IWalletAddressService;
import com.ruoyi.system.service.IUsdtProxyToOtherService;
import com.ruoyi.system.service.IUsdtOtherToProxyService;
import com.ruoyi.system.service.WalletSigningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.LinkedHashMap;
import java.util.Map;
import com.ruoyi.system.domain.vo.WalletOperationRequest;
/**
@@ -33,6 +39,10 @@ public class WalletAddressController extends BaseController {
private IWalletAddressService walletAddressService;
@Autowired
private WalletSigningService walletSigningService;
@Autowired
private IUsdtProxyToOtherService usdtProxyToOtherService;
@Autowired
private IUsdtOtherToProxyService usdtOtherToProxyService;
/**
* 同步刷新并返回完整链上账户快照。
@@ -61,6 +71,32 @@ public class WalletAddressController extends BaseController {
}
}
/**
* 返回钱包的双向代理关系快照。先校验钱包归属,商户只能查看自己的钱包。
*/
@PreAuthorize("@ss.hasPermi('system:address:query') or @ss.hasPermi('system:address:user-query')")
@GetMapping("/{id}/delegations")
public AjaxResult delegations(@PathVariable("id") Long id) {
WalletAddressPlus wallet = walletAddressService.getById(id);
if (wallet == null) {
return AjaxResult.error("钱包不存在");
}
if (!SecurityUtils.isAdmin(getUserId()) && !getUserId().equals(wallet.getUserId())) {
return AjaxResult.error("无权访问该钱包");
}
UsdtDelegationToOther delegatedQuery = new UsdtDelegationToOther();
delegatedQuery.setToken(wallet.getToken());
UsdtOtherToDelegation acquiredQuery = new UsdtOtherToDelegation();
acquiredQuery.setToken(wallet.getToken());
Map<String, Object> result = new LinkedHashMap<>();
result.put("delegatedToOthers",
usdtProxyToOtherService.selectUsdtDelegationToOtherList(delegatedQuery));
result.put("acquiredFromOthers",
usdtOtherToProxyService.selectUsdtOtherToDelegationList(acquiredQuery));
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('system:address:operate') or @ss.hasPermi('system:address:user-query')")
@PostMapping("/operations/transfer-trx")
public AjaxResult transferTrx(@RequestBody WalletOperationRequest request) {