新增代理明细列表
This commit is contained in:
1 parent
81febe2c56
commit
df5512838b
12 files changed
+266
-37
No files matched your search
+9
-9
@@ -24,19 +24,19 @@ import java.util.List;
|
||||
* @date 2026-10-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/otherToDelegation")
|
||||
@RequestMapping("/system/delegationToOther")
|
||||
public class UsdtDelegationToOtherController extends BaseController {
|
||||
@Autowired
|
||||
private IUsdtProxyToOtherService usdtProxyToOtherService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:getByIds')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<UsdtDelegationToOtherPlus> list = usdtProxyToOtherService.getByIds(ids.getLongIds(), UsdtDelegationToOtherPlus::getToken, UsdtDelegationToOtherPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:select')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = usdtProxyToOtherService.select(keyword);
|
||||
@@ -46,7 +46,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 查询代理给其他地址列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:list')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UsdtDelegationToOther usdtDelegationToOther) {
|
||||
startPage();
|
||||
@@ -57,7 +57,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 导出代理给其他地址列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:export')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:export')")
|
||||
@Log(title = "代理给其他地址", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(UsdtDelegationToOther usdtDelegationToOther) {
|
||||
@@ -69,7 +69,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 获取代理给其他地址详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:query')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(usdtProxyToOtherService.selectUsdtDelegationToOtherById(id));
|
||||
@@ -78,7 +78,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 新增代理给其他地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:add')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:add')")
|
||||
@Log(title = "代理给其他地址", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UsdtDelegationToOther usdtDelegationToOther) {
|
||||
@@ -88,7 +88,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 修改代理给其他地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:edit')")
|
||||
@Log(title = "代理给其他地址", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UsdtDelegationToOther usdtDelegationToOther) {
|
||||
@@ -98,7 +98,7 @@ public class UsdtDelegationToOtherController extends BaseController {
|
||||
/**
|
||||
* 删除代理给其他地址
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:remove')")
|
||||
@Log(title = "代理给其他地址", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
||||
+9
-9
@@ -24,19 +24,19 @@ import java.util.List;
|
||||
* @date 2026-10-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/delegationToOther")
|
||||
@RequestMapping("/system/otherToDelegation")
|
||||
public class UsdtOtherToDelegationController extends BaseController {
|
||||
@Autowired
|
||||
private IUsdtOtherToProxyService usdtOtherToProxyService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:getByIds')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<UsdtOtherToDelegationPlus> list = usdtOtherToProxyService.getByIds(ids.getLongIds(), UsdtOtherToDelegationPlus::getToken, UsdtOtherToDelegationPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:select')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = usdtOtherToProxyService.select(keyword);
|
||||
@@ -46,7 +46,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 查询其他地址代理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:list')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UsdtOtherToDelegation usdtOtherToDelegation) {
|
||||
startPage();
|
||||
@@ -57,7 +57,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 导出其他地址代理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:export')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:export')")
|
||||
@Log(title = "其他地址代理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(UsdtOtherToDelegation usdtOtherToDelegation) {
|
||||
@@ -69,7 +69,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 获取其他地址代理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:query')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(usdtOtherToProxyService.selectUsdtOtherToDelegationById(id));
|
||||
@@ -78,7 +78,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 新增其他地址代理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:add')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:add')")
|
||||
@Log(title = "其他地址代理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UsdtOtherToDelegation usdtOtherToDelegation) {
|
||||
@@ -88,7 +88,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 修改其他地址代理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:edit')")
|
||||
@Log(title = "其他地址代理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UsdtOtherToDelegation usdtOtherToDelegation) {
|
||||
@@ -98,7 +98,7 @@ public class UsdtOtherToDelegationController extends BaseController {
|
||||
/**
|
||||
* 删除其他地址代理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:delegationToOther:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('system:otherToDelegation:remove')")
|
||||
@Log(title = "其他地址代理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user