优化代码

This commit is contained in:
lu7213 committed 2026-10-10 20:57:36 -04:00
1 parent ed738d3da6
commit 4048428169
14 files changed
+381 -309

No files matched your search

@@ -19,10 +19,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.math.BigDecimal;
import org.tron.trident.core.ApiWrapper;
import org.tron.common.crypto.ECKey;
import org.tron.trident.utils.Base58Check;
import java.math.BigInteger;
import com.ruoyi.system.service.ITronService;
import com.ruoyi.system.service.TronServiceProvider;
import com.ruoyi.system.domain.vo.WalletOperationRequest;
/**
@@ -37,7 +35,7 @@ public class WalletAddressController extends BaseController {
@Autowired
private IWalletAddressService walletAddressService;
@Autowired
private ITronService tronService;
private TronServiceProvider tronServiceProvider;
/** 查询链上账户快照。私钥只从服务端读取,响应永远不包含 tokenKey。 */
@PreAuthorize("@ss.hasPermi('system:address:query')")
@@ -52,6 +50,7 @@ public class WalletAddressController extends BaseController {
}
ApiWrapper api = null;
try {
ITronService tronService = tronServiceProvider.getCurrentService();
api = tronService.buildApiWrapper();
wallet.setTrxBalance(tronService.getTRxBalance(api, wallet.getToken()));
wallet.setUsdtBalance(tronService.getUsdtBalance(api, wallet.getToken()));
@@ -78,6 +77,7 @@ public class WalletAddressController extends BaseController {
if (!Boolean.TRUE.equals(request.getBroadcast())) return AjaxResult.success("预演模式:已通过参数校验,未广播交易");
ApiWrapper api = null;
try {
ITronService tronService = tronServiceProvider.getCurrentService();
api = tronService.buildApiWrapper();
String tx;
BigDecimal amount = request.getAmount();