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.AppApiKeys;
|
||||
import com.ruoyi.system.domain.AppApiKeysPlus;
|
||||
import com.ruoyi.system.service.IAppApiKeysService;
|
||||
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 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/keys" )
|
||||
public class AppApiKeysController extends BaseController {
|
||||
@Autowired
|
||||
private IAppApiKeysService appApiKeysService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:getByIds')" )
|
||||
@PostMapping("/getByIds" )
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<AppApiKeysPlus> list = appApiKeysService.getByIds(ids.getLongIds(), false, AppApiKeysPlus::getApiSecret, AppApiKeysPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-getByIds')" )
|
||||
@PostMapping("/user/getByIds" )
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids) {
|
||||
List<AppApiKeysPlus> list = appApiKeysService.getByIds(ids.getLongIds(), true, AppApiKeysPlus::getApiSecret,AppApiKeysPlus::getUserId, AppApiKeysPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:select')" )
|
||||
@GetMapping("/select" )
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = appApiKeysService.select(keyword, false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-select')" )
|
||||
@GetMapping("/user/select" )
|
||||
public AjaxResult userSelect(String keyword) {
|
||||
List<SelectItem> list = appApiKeysService.select(keyword, true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(AppApiKeys appApiKeys) {
|
||||
startPage();
|
||||
List<AppApiKeys> list = appApiKeysService.selectAppApiKeysList(appApiKeys, false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-list')" )
|
||||
@GetMapping("/user/list" )
|
||||
public TableDataInfo userList(AppApiKeys appApiKeys) {
|
||||
startPage();
|
||||
List<AppApiKeys> list = appApiKeysService.selectAppApiKeysList(appApiKeys, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出应用密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:export')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(AppApiKeys appApiKeys) {
|
||||
List<AppApiKeys> list = appApiKeysService.selectAppApiKeysList(appApiKeys, false);
|
||||
ExcelUtil<AppApiKeys> util = new ExcelUtil<AppApiKeys>(AppApiKeys.class);
|
||||
return util.exportExcel(list, "keys" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用密钥详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(appApiKeysService.selectAppApiKeysById(id, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用密钥详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-query')" )
|
||||
@GetMapping(value = "/user/{id}" )
|
||||
public AjaxResult userGetInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(appApiKeysService.selectAppApiKeysById(id, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增应用密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:add')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppApiKeys appApiKeys) {
|
||||
return toAjax(appApiKeysService.insertAppApiKeys(appApiKeys, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增应用密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-add')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user" )
|
||||
public AjaxResult userAdd(@RequestBody AppApiKeys appApiKeys) {
|
||||
return toAjax(appApiKeysService.insertAppApiKeys(appApiKeys, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:edit')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppApiKeys appApiKeys) {
|
||||
return toAjax(appApiKeysService.updateAppApiKeys(appApiKeys, false));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-edit')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user" )
|
||||
public AjaxResult userEdit(@RequestBody AppApiKeys appApiKeys) {
|
||||
return toAjax(appApiKeysService.updateAppApiKeys(appApiKeys, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:remove')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(appApiKeysService.deleteAppApiKeysByIds(ids, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:keys:user-remove')" )
|
||||
@Log(title = "应用密钥" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}" )
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids) {
|
||||
return toAjax(appApiKeysService.deleteAppApiKeysByIds(ids, true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.ruoyi.system.controller;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.Apps;
|
||||
import com.ruoyi.system.domain.AppsPlus;
|
||||
import com.ruoyi.system.service.IAppsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 应用管理Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/apps")
|
||||
public class AppsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAppsService appsService;
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(),false,AppsPlus::getName,AppsPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-getByIds')")
|
||||
@PostMapping("/user/getByIds")
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<AppsPlus> list = appsService.getByIds(ids.getLongIds(),true,AppsPlus::getName,AppsPlus::getUserId,AppsPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = appsService.select(keyword,false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-select')")
|
||||
@GetMapping("/user/select")
|
||||
public AjaxResult userSelect(String keyword)
|
||||
{
|
||||
List<SelectItem> list = appsService.select(keyword,true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Apps apps)
|
||||
{
|
||||
startPage();
|
||||
List<Apps> list = appsService.selectAppsList(apps,false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 查询应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo userList(Apps apps)
|
||||
{
|
||||
startPage();
|
||||
List<Apps> list = appsService.selectAppsList(apps,true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出应用管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:export')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(Apps apps)
|
||||
{
|
||||
List<Apps> list = appsService.selectAppsList(apps,false);
|
||||
ExcelUtil<Apps> util = new ExcelUtil<Apps>(Apps.class);
|
||||
return util.exportExcel(list, "apps");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(appsService.selectAppsById(id,false));
|
||||
}
|
||||
/**
|
||||
* 获取应用管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-query')")
|
||||
@GetMapping(value = "/user/{id}")
|
||||
public AjaxResult userGetInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(appsService.selectAppsById(id,true));
|
||||
}
|
||||
/**
|
||||
* 新增应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:add')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.insertApps(apps,false));
|
||||
}
|
||||
/**
|
||||
* 新增应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-add')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user")
|
||||
public AjaxResult userAdd(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.insertApps(apps,true));
|
||||
}
|
||||
/**
|
||||
* 修改应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:edit')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.updateApps(apps,false));
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-edit')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user")
|
||||
public AjaxResult userEdit(@RequestBody Apps apps)
|
||||
{
|
||||
return toAjax(appsService.updateApps(apps,true));
|
||||
}
|
||||
/**
|
||||
* 删除应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:remove')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(appsService.deleteAppsByIds(ids,false));
|
||||
}
|
||||
/**
|
||||
* 删除应用管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apps:user-remove')")
|
||||
@Log(title = "应用管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}")
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(appsService.deleteAppsByIds(ids,true));
|
||||
}
|
||||
}
|
||||
@@ -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.UserAuth;
|
||||
import com.ruoyi.system.domain.UserAuthPlus;
|
||||
import com.ruoyi.system.service.IUserAuthService;
|
||||
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 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/auth" )
|
||||
public class UserAuthController extends BaseController {
|
||||
@Autowired
|
||||
private IUserAuthService userAuthService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:getByIds')" )
|
||||
@PostMapping("/getByIds" )
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<UserAuthPlus> list = userAuthService.getByIds(ids.getLongIds(), false, UserAuthPlus::getName, UserAuthPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-getByIds')" )
|
||||
@PostMapping("/user/getByIds" )
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids) {
|
||||
List<UserAuthPlus> list = userAuthService.getByIds(ids.getLongIds(), true, UserAuthPlus::getName,UserAuthPlus::getUserId, UserAuthPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:select')" )
|
||||
@GetMapping("/select" )
|
||||
public AjaxResult select(String keyword) {
|
||||
List<SelectItem> list = userAuthService.select(keyword, false);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-select')" )
|
||||
@GetMapping("/user/select" )
|
||||
public AjaxResult userSelect(String keyword) {
|
||||
List<SelectItem> list = userAuthService.select(keyword, true);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户授权列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(UserAuth userAuth) {
|
||||
startPage();
|
||||
List<UserAuth> list = userAuthService.selectUserAuthList(userAuth, false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户授权列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-list')" )
|
||||
@GetMapping("/user/list" )
|
||||
public TableDataInfo userList(UserAuth userAuth) {
|
||||
startPage();
|
||||
List<UserAuth> list = userAuthService.selectUserAuthList(userAuth, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户授权列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:export')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(UserAuth userAuth) {
|
||||
List<UserAuth> list = userAuthService.selectUserAuthList(userAuth, false);
|
||||
ExcelUtil<UserAuth> util = new ExcelUtil<UserAuth>(UserAuth.class);
|
||||
return util.exportExcel(list, "auth" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户授权详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(userAuthService.selectUserAuthById(id, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户授权详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-query')" )
|
||||
@GetMapping(value = "/user/{id}" )
|
||||
public AjaxResult userGetInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(userAuthService.selectUserAuthById(id, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:add')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UserAuth userAuth) {
|
||||
return toAjax(userAuthService.insertUserAuth(userAuth, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-add')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user" )
|
||||
public AjaxResult userAdd(@RequestBody UserAuth userAuth) {
|
||||
return toAjax(userAuthService.insertUserAuth(userAuth, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:edit')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UserAuth userAuth) {
|
||||
return toAjax(userAuthService.updateUserAuth(userAuth, false));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-edit')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user" )
|
||||
public AjaxResult userEdit(@RequestBody UserAuth userAuth) {
|
||||
return toAjax(userAuthService.updateUserAuth(userAuth, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:remove')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(userAuthService.deleteUserAuthByIds(ids, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户授权
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:auth:user-remove')" )
|
||||
@Log(title = "用户授权" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}" )
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids) {
|
||||
return toAjax(userAuthService.deleteUserAuthByIds(ids, true));
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
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.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.Web3Wallet;
|
||||
import com.ruoyi.system.domain.Web3WalletPlus;
|
||||
import com.ruoyi.system.service.IWeb3WalletService;
|
||||
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 2025-11-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/wallet" )
|
||||
public class Web3WalletController extends BaseController {
|
||||
@Autowired
|
||||
private IWeb3WalletService web3WalletService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:getByIds')" )
|
||||
@PostMapping("/getByIds" )
|
||||
public AjaxResult getByIds(@RequestBody Ids ids) {
|
||||
List<Web3WalletPlus> list = web3WalletService.getByIds(ids.getLongIds(), false, Web3WalletPlus::getUsdtBalance, Web3WalletPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-getByIds')" )
|
||||
@PostMapping("/user/getByIds" )
|
||||
public AjaxResult userGetByIds(@RequestBody Ids ids) {
|
||||
List<Web3WalletPlus> list = web3WalletService.getByIds(ids.getLongIds(), true, Web3WalletPlus::getUsdtBalance, Web3WalletPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询钱包管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(Web3Wallet web3Wallet) {
|
||||
startPage();
|
||||
List<Web3Wallet> list = web3WalletService.selectWeb3WalletList(web3Wallet, false);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询钱包管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-list')" )
|
||||
@GetMapping("/user/list" )
|
||||
public TableDataInfo userList(Web3Wallet web3Wallet) {
|
||||
startPage();
|
||||
List<Web3Wallet> list = web3WalletService.selectWeb3WalletList(web3Wallet, true);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出钱包管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:export')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(Web3Wallet web3Wallet) {
|
||||
List<Web3Wallet> list = web3WalletService.selectWeb3WalletList(web3Wallet, false);
|
||||
ExcelUtil<Web3Wallet> util = new ExcelUtil<Web3Wallet>(Web3Wallet.class);
|
||||
return util.exportExcel(list, "wallet" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取钱包管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(web3WalletService.selectWeb3WalletById(id, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取钱包管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-query')" )
|
||||
@GetMapping(value = "/user/{id}" )
|
||||
public AjaxResult userGetInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(web3WalletService.selectWeb3WalletById(id, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钱包管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:add')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Web3Wallet web3Wallet) {
|
||||
return toAjax(web3WalletService.insertWeb3Wallet(web3Wallet, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钱包管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-add')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping("/user" )
|
||||
public AjaxResult userAdd(@RequestBody Web3Wallet web3Wallet) {
|
||||
return toAjax(web3WalletService.insertWeb3Wallet(web3Wallet, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改钱包管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:edit')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Web3Wallet web3Wallet) {
|
||||
return toAjax(web3WalletService.updateWeb3Wallet(web3Wallet, false));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-edit')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/user" )
|
||||
public AjaxResult userEdit(@RequestBody Web3Wallet web3Wallet) {
|
||||
return toAjax(web3WalletService.updateWeb3Wallet(web3Wallet, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钱包管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:remove')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(web3WalletService.deleteWeb3WalletByIds(ids, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钱包管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wallet:user-remove')" )
|
||||
@Log(title = "钱包管理" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/user/{ids}" )
|
||||
public AjaxResult userRemove(@PathVariable Long[] ids) {
|
||||
return toAjax(web3WalletService.deleteWeb3WalletByIds(ids, true));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user