108 lines
4.1 KiB
Java
108 lines
4.1 KiB
Java
package com.ruoyi.system.controller;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.common.select.Ids;
|
|
import com.ruoyi.common.select.SelectItem;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
import com.ruoyi.system.domain.UsdtDelegationToOther;
|
|
import com.ruoyi.system.domain.UsdtDelegationToOtherPlus;
|
|
import com.ruoyi.system.service.IUsdtProxyToOtherService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 代理给其他地址Controller
|
|
*
|
|
* @author luqj
|
|
* @date 2026-10-12
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/system/delegationToOther")
|
|
public class UsdtDelegationToOtherController extends BaseController {
|
|
@Autowired
|
|
private IUsdtProxyToOtherService usdtProxyToOtherService;
|
|
|
|
@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:delegationToOther:select')")
|
|
@GetMapping("/select")
|
|
public AjaxResult select(String keyword) {
|
|
List<SelectItem> list = usdtProxyToOtherService.select(keyword);
|
|
return AjaxResult.success(list);
|
|
}
|
|
|
|
/**
|
|
* 查询代理给其他地址列表
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:list')")
|
|
@GetMapping("/list")
|
|
public TableDataInfo list(UsdtDelegationToOther usdtDelegationToOther) {
|
|
startPage();
|
|
List<UsdtDelegationToOther> list = usdtProxyToOtherService.selectUsdtDelegationToOtherList(usdtDelegationToOther);
|
|
return getDataTable(list);
|
|
}
|
|
|
|
/**
|
|
* 导出代理给其他地址列表
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:export')")
|
|
@Log(title = "代理给其他地址", businessType = BusinessType.EXPORT)
|
|
@GetMapping("/export")
|
|
public AjaxResult export(UsdtDelegationToOther usdtDelegationToOther) {
|
|
List<UsdtDelegationToOther> list = usdtProxyToOtherService.selectUsdtDelegationToOtherList(usdtDelegationToOther);
|
|
ExcelUtil<UsdtDelegationToOther> util = new ExcelUtil<UsdtDelegationToOther>(UsdtDelegationToOther.class);
|
|
return util.exportExcel(list, "otherToDelegation");
|
|
}
|
|
|
|
/**
|
|
* 获取代理给其他地址详细信息
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:query')")
|
|
@GetMapping(value = "/{id}")
|
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
return AjaxResult.success(usdtProxyToOtherService.selectUsdtDelegationToOtherById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增代理给其他地址
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:add')")
|
|
@Log(title = "代理给其他地址", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
public AjaxResult add(@RequestBody UsdtDelegationToOther usdtDelegationToOther) {
|
|
return toAjax(usdtProxyToOtherService.insertUsdtDelegationToOther(usdtDelegationToOther));
|
|
}
|
|
|
|
/**
|
|
* 修改代理给其他地址
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:edit')")
|
|
@Log(title = "代理给其他地址", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
public AjaxResult edit(@RequestBody UsdtDelegationToOther usdtDelegationToOther) {
|
|
return toAjax(usdtProxyToOtherService.updateUsdtDelegationToOther(usdtDelegationToOther));
|
|
}
|
|
|
|
/**
|
|
* 删除代理给其他地址
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:delegationToOther:remove')")
|
|
@Log(title = "代理给其他地址", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
return toAjax(usdtProxyToOtherService.deleteUsdtDelegationToOtherByIds(ids));
|
|
}
|
|
}
|