111
This commit is contained in:
1 parent
f9334dfc75
commit
81eca8933a
110 files changed
+13342
No files matched your search
@@ -0,0 +1,168 @@
|
||||
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.WalletAddress;
|
||||
import com.ruoyi.system.domain.WalletAddressPlus;
|
||||
import com.ruoyi.system.service.IWalletAddressService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* token管理Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/address" )
|
||||
public class WalletAddressController extends BaseController {
|
||||
@Autowired
|
||||
private IWalletAddressService walletAddressService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:address:getByIds')" )
|
||||
@PostMapping("/getByIds" )
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<WalletAddressPlus> list = walletAddressService.getByIds(ids.getLongIds(), false, WalletAddressPlus::getToken, WalletAddressPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-getByIds')" )
|
||||
@PostMapping("/user/getByIds" )
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids) {
|
||||
List<WalletAddressPlus> list = walletAddressService.getByIds(ids.getLongIds(), true, WalletAddressPlus::getToken,WalletAddressPlus::getUserId, WalletAddressPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:address:select')" )
|
||||
@GetMapping("/select" )
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = walletAddressService.select(keyword, false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-select')" )
|
||||
@GetMapping("/user/select" )
|
||||
public AjaxResult userSelect(String keyword) {
|
||||
List<SelectItem> list = walletAddressService.select(keyword, true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询token管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(WalletAddress walletAddress) {
|
||||
startPage();
|
||||
List<WalletAddress> list = walletAddressService.selectWalletAddressList(walletAddress, false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询token管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-list')" )
|
||||
@GetMapping("/user/list" )
|
||||
public TableDataInfo userList(WalletAddress walletAddress) {
|
||||
startPage();
|
||||
List<WalletAddress> list = walletAddressService.selectWalletAddressList(walletAddress, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出token管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:export')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(WalletAddress walletAddress) {
|
||||
List<WalletAddress> list = walletAddressService.selectWalletAddressList(walletAddress, false);
|
||||
ExcelUtil<WalletAddress> util = new ExcelUtil<WalletAddress>(WalletAddress.class);
|
||||
return util.exportExcel(list, "address" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取token管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(walletAddressService.selectWalletAddressById(id, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取token管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-query')" )
|
||||
@GetMapping(value = "/user/{id}" )
|
||||
public AjaxResult userGetInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(walletAddressService.selectWalletAddressById(id, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增token管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:add')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WalletAddress walletAddress) {
|
||||
return toAjax(walletAddressService.insertWalletAddress(walletAddress, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增token管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-add')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user" )
|
||||
public AjaxResult userAdd(@RequestBody WalletAddress walletAddress) {
|
||||
return toAjax(walletAddressService.insertWalletAddress(walletAddress, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改token管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:edit')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WalletAddress walletAddress) {
|
||||
return toAjax(walletAddressService.updateWalletAddress(walletAddress, false));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-edit')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user" )
|
||||
public AjaxResult userEdit(@RequestBody WalletAddress walletAddress) {
|
||||
return toAjax(walletAddressService.updateWalletAddress(walletAddress, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除token管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:remove')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(walletAddressService.deleteWalletAddressByIds(ids, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除token管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:address:user-remove')" )
|
||||
@Log(title = "token管理" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}" )
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids) {
|
||||
return toAjax(walletAddressService.deleteWalletAddressByIds(ids, true));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user