mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-09-07 05:27:46 +00:00
移除 OAuth2 改为 Redis
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
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.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysClientDetails;
|
||||
import com.ruoyi.system.service.ISysClientDetailsService;
|
||||
|
||||
/**
|
||||
* 终端配置 信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/client")
|
||||
public class SysClientDetailsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysClientDetailsService sysClientDetailsService;
|
||||
|
||||
/**
|
||||
* 查询终端配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:client:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysClientDetails sysClientDetails)
|
||||
{
|
||||
startPage();
|
||||
List<SysClientDetails> list = sysClientDetailsService.selectSysClientDetailsList(sysClientDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取终端配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:client:query')")
|
||||
@GetMapping(value = "/{clientId}")
|
||||
public AjaxResult getInfo(@PathVariable("clientId") String clientId)
|
||||
{
|
||||
return AjaxResult.success(sysClientDetailsService.selectSysClientDetailsById(clientId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增终端配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:client:add')")
|
||||
@Log(title = "终端配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysClientDetails sysClientDetails)
|
||||
{
|
||||
String clientId = sysClientDetails.getClientId();
|
||||
if (StringUtils.isNotNull(sysClientDetailsService.selectSysClientDetailsById(clientId)))
|
||||
{
|
||||
return AjaxResult.error("新增终端'" + clientId + "'失败,编号已存在");
|
||||
}
|
||||
return toAjax(sysClientDetailsService.insertSysClientDetails(sysClientDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改终端配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:client:edit')")
|
||||
@Log(title = "终端配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysClientDetails sysClientDetails)
|
||||
{
|
||||
return toAjax(sysClientDetailsService.updateSysClientDetails(sysClientDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除终端配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:client:remove')")
|
||||
@Log(title = "终端配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{clientIds}")
|
||||
public AjaxResult remove(@PathVariable String[] clientIds)
|
||||
{
|
||||
return toAjax(sysClientDetailsService.deleteSysClientDetailsByIds(clientIds));
|
||||
}
|
||||
}
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -21,6 +20,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
@@ -40,7 +40,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@PreAuthorize(hasPermi = "system:config:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysConfig config)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ public class SysConfigController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||
@PreAuthorize(hasPermi = "system:config:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysConfig config) throws IOException
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@PreAuthorize(hasPermi = "system:config:add")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysConfig config)
|
||||
@@ -96,7 +96,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@PreAuthorize(hasPermi = "system:config:edit")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
||||
@@ -112,7 +112,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@PreAuthorize(hasPermi = "system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] configIds)
|
||||
@@ -123,7 +123,7 @@ public class SysConfigController extends BaseController
|
||||
/**
|
||||
* 清空缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@PreAuthorize(hasPermi = "system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clearCache")
|
||||
public AjaxResult clearCache()
|
||||
|
@@ -2,10 +2,8 @@ package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -15,13 +13,13 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
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.core.constant.UserConstants;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.api.domain.SysDept;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
@@ -41,7 +39,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 获取部门列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@PreAuthorize(hasPermi = "system:dept:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysDept dept)
|
||||
{
|
||||
@@ -52,7 +50,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 查询部门列表(排除节点)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||
@PreAuthorize(hasPermi = "system:dept:list")
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||
{
|
||||
@@ -73,7 +71,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 根据部门编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||
@PreAuthorize(hasPermi = "system:dept:query")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public AjaxResult getInfo(@PathVariable Long deptId)
|
||||
{
|
||||
@@ -106,7 +104,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||
@PreAuthorize(hasPermi = "system:dept:add")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
||||
@@ -122,7 +120,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 修改部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||
@PreAuthorize(hasPermi = "system:dept:edit")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
||||
@@ -147,7 +145,7 @@ public class SysDeptController extends BaseController
|
||||
/**
|
||||
* 删除部门
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||
@PreAuthorize(hasPermi = "system:dept:remove")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public AjaxResult remove(@PathVariable Long deptId)
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -20,6 +19,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
@@ -40,7 +40,7 @@ public class SysDictDataController extends BaseController
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@PreAuthorize(hasPermi = "system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictData dictData)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ public class SysDictDataController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PreAuthorize(hasPermi = "system:dict:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictData dictData) throws IOException
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class SysDictDataController extends BaseController
|
||||
/**
|
||||
* 查询字典数据详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@PreAuthorize(hasPermi = "system:dict:query")
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictCode)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public class SysDictDataController extends BaseController
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@PreAuthorize(hasPermi = "system:dict:add")
|
||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
||||
@@ -93,7 +93,7 @@ public class SysDictDataController extends BaseController
|
||||
/**
|
||||
* 修改保存字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@PreAuthorize(hasPermi = "system:dict:edit")
|
||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
||||
@@ -105,7 +105,7 @@ public class SysDictDataController extends BaseController
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize(hasPermi = "system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -21,6 +20,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
@@ -37,7 +37,7 @@ public class SysDictTypeController extends BaseController
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@PreAuthorize(hasPermi = "system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictType dictType)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class SysDictTypeController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PreAuthorize(hasPermi = "system:dict:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictType dictType) throws IOException
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@PreAuthorize(hasPermi = "system:dict:query")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 新增字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@PreAuthorize(hasPermi = "system:dict:add")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
||||
@@ -85,7 +85,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@PreAuthorize(hasPermi = "system:dict:edit")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
||||
@@ -101,7 +101,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 删除字典类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize(hasPermi = "system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
||||
@@ -112,7 +112,7 @@ public class SysDictTypeController extends BaseController
|
||||
/**
|
||||
* 清空缓存
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@PreAuthorize(hasPermi = "system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clearCache")
|
||||
public AjaxResult clearCache()
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -21,6 +20,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SysLogininforController extends BaseController
|
||||
@Autowired
|
||||
private ISysLogininforService logininforService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:logininfor:list')")
|
||||
@PreAuthorize(hasPermi = "system:logininfor:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysLogininfor logininfor)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class SysLogininforController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:logininfor:export')")
|
||||
@PreAuthorize(hasPermi = "system:logininfor:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor) throws IOException
|
||||
{
|
||||
@@ -55,7 +55,7 @@ public class SysLogininforController extends BaseController
|
||||
util.exportExcel(response, list, "登陆日志");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:logininfor:remove')")
|
||||
@PreAuthorize(hasPermi = "system:logininfor:remove")
|
||||
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] infoIds)
|
||||
@@ -63,7 +63,7 @@ public class SysLogininforController extends BaseController
|
||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:logininfor:remove')")
|
||||
@PreAuthorize(hasPermi = "system:logininfor:remove")
|
||||
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean()
|
||||
|
@@ -2,7 +2,6 @@ package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -19,7 +18,7 @@ import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.domain.LoginUser;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
@@ -39,12 +38,11 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 获取菜单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||
@PreAuthorize(hasPermi = "system:menu:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SysMenu menu)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long userId = loginUser.getUserId();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
||||
return AjaxResult.success(menus);
|
||||
}
|
||||
@@ -52,7 +50,7 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||
@PreAuthorize(hasPermi = "system:menu:query")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public AjaxResult getInfo(@PathVariable Long menuId)
|
||||
{
|
||||
@@ -65,8 +63,7 @@ public class SysMenuController extends BaseController
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(SysMenu menu)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long userId = loginUser.getUserId();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
||||
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
|
||||
}
|
||||
@@ -77,8 +74,7 @@ public class SysMenuController extends BaseController
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long userId = loginUser.getUserId();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(userId);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||
@@ -89,7 +85,7 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 新增菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||
@PreAuthorize(hasPermi = "system:menu:add")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
||||
@@ -110,7 +106,7 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||
@PreAuthorize(hasPermi = "system:menu:edit")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
||||
@@ -135,7 +131,7 @@ public class SysMenuController extends BaseController
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||
@PreAuthorize(hasPermi = "system:menu:remove")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
||||
@@ -159,7 +155,7 @@ public class SysMenuController extends BaseController
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters()
|
||||
{
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
return AjaxResult.success(menuService.buildMenus(menus));
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -17,6 +16,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
@@ -36,7 +36,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||
@PreAuthorize(hasPermi = "system:notice:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysNotice notice)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||
@PreAuthorize(hasPermi = "system:notice:query")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 新增通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||
@PreAuthorize(hasPermi = "system:notice:add")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
||||
@@ -70,7 +70,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 修改通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||
@PreAuthorize(hasPermi = "system:notice:edit")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
||||
@@ -82,7 +82,7 @@ public class SysNoticeController extends BaseController
|
||||
/**
|
||||
* 删除通知公告
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||
@PreAuthorize(hasPermi = "system:notice:remove")
|
||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] noticeIds)
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -18,6 +17,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.system.api.domain.SysOperLog;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SysOperlogController extends BaseController
|
||||
@Autowired
|
||||
private ISysOperLogService operLogService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:operlog:list')")
|
||||
@PreAuthorize(hasPermi = "system:operlog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOperLog operLog)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ public class SysOperlogController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:operlog:export')")
|
||||
@PreAuthorize(hasPermi = "system:operlog:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperLog operLog) throws IOException
|
||||
{
|
||||
@@ -52,14 +52,14 @@ public class SysOperlogController extends BaseController
|
||||
util.exportExcel(response, list, "操作日志");
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:operlog:remove')")
|
||||
@PreAuthorize(hasPermi = "system:operlog:remove")
|
||||
@DeleteMapping("/{operIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] operIds)
|
||||
{
|
||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:operlog:remove')")
|
||||
@PreAuthorize(hasPermi = "system:operlog:remove")
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public AjaxResult clean()
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -21,6 +20,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
@@ -40,7 +40,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 获取岗位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||
@PreAuthorize(hasPermi = "system:post:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysPost post)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ public class SysPostController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||
@PreAuthorize(hasPermi = "system:post:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post) throws IOException
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 根据岗位编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||
@PreAuthorize(hasPermi = "system:post:query")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public AjaxResult getInfo(@PathVariable Long postId)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 新增岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||
@PreAuthorize(hasPermi = "system:post:add")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysPost post)
|
||||
@@ -92,7 +92,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 修改岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||
@PreAuthorize(hasPermi = "system:post:edit")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
||||
@@ -112,7 +112,7 @@ public class SysPostController extends BaseController
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||
@PreAuthorize(hasPermi = "system:post:remove")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] postIds)
|
||||
|
@@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -21,6 +20,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.api.domain.SysRole;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
@@ -37,7 +37,7 @@ public class SysRoleController extends BaseController
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||
@PreAuthorize(hasPermi = "system:role:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRole role)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class SysRoleController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||
@PreAuthorize(hasPermi = "system:role:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role) throws IOException
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 根据角色编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@PreAuthorize(hasPermi = "system:role:query")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 新增角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||
@PreAuthorize(hasPermi = "system:role:add")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||
@@ -90,7 +90,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 修改保存角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@PreAuthorize(hasPermi = "system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
||||
@@ -111,7 +111,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@PreAuthorize(hasPermi = "system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
||||
@@ -123,7 +123,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
@PreAuthorize(hasPermi = "system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
||||
@@ -136,7 +136,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||
@PreAuthorize(hasPermi = "system:role:remove")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||
@@ -147,7 +147,7 @@ public class SysRoleController extends BaseController
|
||||
/**
|
||||
* 获取角色选择框列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||
@PreAuthorize(hasPermi = "system:role:query")
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
|
@@ -6,7 +6,6 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -26,10 +25,11 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.api.domain.SysRole;
|
||||
import com.ruoyi.system.api.domain.SysUser;
|
||||
import com.ruoyi.system.api.model.UserInfo;
|
||||
import com.ruoyi.system.api.model.LoginUser;
|
||||
import com.ruoyi.system.service.ISysPermissionService;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
@@ -59,7 +59,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@PreAuthorize(hasPermi = "system:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ public class SysUserController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@PreAuthorize(hasPermi = "system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user) throws IOException
|
||||
{
|
||||
@@ -79,7 +79,7 @@ public class SysUserController extends BaseController
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||
@PreAuthorize(hasPermi = "system:user:import")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public class SysUserController extends BaseController
|
||||
* 获取当前用户信息
|
||||
*/
|
||||
@GetMapping("/info/{username}")
|
||||
public R<UserInfo> info(@PathVariable("username") String username)
|
||||
public R<LoginUser> info(@PathVariable("username") String username)
|
||||
{
|
||||
SysUser sysUser = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(sysUser))
|
||||
@@ -112,7 +112,7 @@ public class SysUserController extends BaseController
|
||||
Set<String> roles = permissionService.getRolePermission(sysUser.getUserId());
|
||||
// 权限集合
|
||||
Set<String> permissions = permissionService.getMenuPermission(sysUser.getUserId());
|
||||
UserInfo sysUserVo = new UserInfo();
|
||||
LoginUser sysUserVo = new LoginUser();
|
||||
sysUserVo.setSysUser(sysUser);
|
||||
sysUserVo.setRoles(roles);
|
||||
sysUserVo.setPermissions(permissions);
|
||||
@@ -127,7 +127,7 @@ public class SysUserController extends BaseController
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(userId);
|
||||
// 权限集合
|
||||
@@ -142,7 +142,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@PreAuthorize(hasPermi = "system:user:query")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
@@ -162,7 +162,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||
@PreAuthorize(hasPermi = "system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user)
|
||||
@@ -187,7 +187,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@PreAuthorize(hasPermi = "system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||
@@ -208,7 +208,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
@PreAuthorize(hasPermi = "system:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
||||
@@ -219,7 +219,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@PreAuthorize(hasPermi = "system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
@@ -233,7 +233,7 @@ public class SysUserController extends BaseController
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@PreAuthorize(hasPermi = "system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||
|
@@ -1,213 +0,0 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 终端配置表 sys_oauth_client_details
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysClientDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 资源ID标识
|
||||
*/
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* 终端安全码
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 终端授权范围
|
||||
*/
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 终端授权类型
|
||||
*/
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 服务器回调地址
|
||||
*/
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* 访问资源所需权限
|
||||
*/
|
||||
private String authorities;
|
||||
|
||||
/**
|
||||
* 设定终端的access_token的有效时间值(秒)
|
||||
*/
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* 设定终端的refresh_token的有效时间值(秒)
|
||||
*/
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 附加信息
|
||||
*/
|
||||
private String additionalInformation;
|
||||
|
||||
/**
|
||||
* 是否登录时跳过授权
|
||||
*/
|
||||
private String autoapprove;
|
||||
|
||||
/**
|
||||
* 终端明文安全码
|
||||
*/
|
||||
private String originSecret;
|
||||
|
||||
public String getClientId()
|
||||
{
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId)
|
||||
{
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getResourceIds()
|
||||
{
|
||||
return resourceIds;
|
||||
}
|
||||
|
||||
public void setResourceIds(String resourceIds)
|
||||
{
|
||||
this.resourceIds = resourceIds;
|
||||
}
|
||||
|
||||
public String getClientSecret()
|
||||
{
|
||||
return clientSecret;
|
||||
}
|
||||
|
||||
public void setClientSecret(String clientSecret)
|
||||
{
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getAuthorizedGrantTypes()
|
||||
{
|
||||
return authorizedGrantTypes;
|
||||
}
|
||||
|
||||
public void setAuthorizedGrantTypes(String authorizedGrantTypes)
|
||||
{
|
||||
this.authorizedGrantTypes = authorizedGrantTypes;
|
||||
}
|
||||
|
||||
public String getWebServerRedirectUri()
|
||||
{
|
||||
return webServerRedirectUri;
|
||||
}
|
||||
|
||||
public void setWebServerRedirectUri(String webServerRedirectUri)
|
||||
{
|
||||
this.webServerRedirectUri = webServerRedirectUri;
|
||||
}
|
||||
|
||||
public String getAuthorities()
|
||||
{
|
||||
return authorities;
|
||||
}
|
||||
|
||||
public void setAuthorities(String authorities)
|
||||
{
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
public Integer getAccessTokenValidity()
|
||||
{
|
||||
return accessTokenValidity;
|
||||
}
|
||||
|
||||
public void setAccessTokenValidity(Integer accessTokenValidity)
|
||||
{
|
||||
this.accessTokenValidity = accessTokenValidity;
|
||||
}
|
||||
|
||||
public Integer getRefreshTokenValidity()
|
||||
{
|
||||
return refreshTokenValidity;
|
||||
}
|
||||
|
||||
public void setRefreshTokenValidity(Integer refreshTokenValidity)
|
||||
{
|
||||
this.refreshTokenValidity = refreshTokenValidity;
|
||||
}
|
||||
|
||||
public String getAdditionalInformation()
|
||||
{
|
||||
return additionalInformation;
|
||||
}
|
||||
|
||||
public void setAdditionalInformation(String additionalInformation)
|
||||
{
|
||||
this.additionalInformation = additionalInformation;
|
||||
}
|
||||
|
||||
public String getAutoapprove()
|
||||
{
|
||||
return autoapprove;
|
||||
}
|
||||
|
||||
public void setAutoapprove(String autoapprove)
|
||||
{
|
||||
this.autoapprove = autoapprove;
|
||||
}
|
||||
|
||||
public String getOriginSecret()
|
||||
{
|
||||
return originSecret;
|
||||
}
|
||||
|
||||
public void setOriginSecret(String originSecret)
|
||||
{
|
||||
this.originSecret = originSecret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("clientId", getClientId())
|
||||
.append("resourceIds", getResourceIds())
|
||||
.append("clientSecret", getClientSecret())
|
||||
.append("scope", getScope())
|
||||
.append("authorizedGrantTypes", getAuthorizedGrantTypes())
|
||||
.append("webServerRedirectUri", getWebServerRedirectUri())
|
||||
.append("authorities", getAuthorities())
|
||||
.append("accessTokenValidity", getAccessTokenValidity())
|
||||
.append("refreshTokenValidity", getRefreshTokenValidity())
|
||||
.append("additionalInformation", getAdditionalInformation())
|
||||
.append("autoapprove", getAutoapprove())
|
||||
.append("originSecret", getOriginSecret())
|
||||
.toString();
|
||||
}
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysClientDetails;
|
||||
|
||||
/**
|
||||
* 终端配置Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysClientDetailsMapper
|
||||
{
|
||||
/**
|
||||
* 查询终端配置
|
||||
*
|
||||
* @param clientId 终端配置ID
|
||||
* @return 终端配置
|
||||
*/
|
||||
public SysClientDetails selectSysClientDetailsById(String clientId);
|
||||
|
||||
/**
|
||||
* 查询终端配置列表
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 终端配置集合
|
||||
*/
|
||||
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 新增终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysClientDetails(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 修改终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysClientDetails(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 删除终端配置
|
||||
*
|
||||
* @param clientId 终端配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientDetailsById(String clientId);
|
||||
|
||||
/**
|
||||
* 批量删除终端配置
|
||||
*
|
||||
* @param clientIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientDetailsByIds(String[] clientIds);
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysClientDetails;
|
||||
|
||||
/**
|
||||
* 终端配置Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysClientDetailsService
|
||||
{
|
||||
/**
|
||||
* 查询终端配置
|
||||
*
|
||||
* @param clientId 终端配置ID
|
||||
* @return 终端配置
|
||||
*/
|
||||
public SysClientDetails selectSysClientDetailsById(String clientId);
|
||||
|
||||
/**
|
||||
* 查询终端配置列表
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 终端配置集合
|
||||
*/
|
||||
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 新增终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysClientDetails(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 修改终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysClientDetails(SysClientDetails sysClientDetails);
|
||||
|
||||
/**
|
||||
* 批量删除终端配置
|
||||
*
|
||||
* @param clientIds 需要删除的终端配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysClientDetailsByIds(String[] clientIds);
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.constant.CacheConstants;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.system.domain.SysClientDetails;
|
||||
import com.ruoyi.system.mapper.SysClientDetailsMapper;
|
||||
import com.ruoyi.system.service.ISysClientDetailsService;
|
||||
|
||||
/**
|
||||
* 终端配置Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class SysClientDetailsServiceImpl implements ISysClientDetailsService
|
||||
{
|
||||
@Autowired
|
||||
private SysClientDetailsMapper sysClientDetailsMapper;
|
||||
|
||||
/**
|
||||
* 查询终端配置
|
||||
*
|
||||
* @param clientId 终端配置ID
|
||||
* @return 终端配置
|
||||
*/
|
||||
@Override
|
||||
public SysClientDetails selectSysClientDetailsById(String clientId)
|
||||
{
|
||||
return sysClientDetailsMapper.selectSysClientDetailsById(clientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询终端配置列表
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 终端配置
|
||||
*/
|
||||
@Override
|
||||
public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails)
|
||||
{
|
||||
return sysClientDetailsMapper.selectSysClientDetailsList(sysClientDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysClientDetails(SysClientDetails sysClientDetails)
|
||||
{
|
||||
sysClientDetails.setClientSecret(SecurityUtils.encryptPassword(sysClientDetails.getOriginSecret()));
|
||||
return sysClientDetailsMapper.insertSysClientDetails(sysClientDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改终端配置
|
||||
*
|
||||
* @param sysClientDetails 终端配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#sysClientDetails.clientId")
|
||||
public int updateSysClientDetails(SysClientDetails sysClientDetails)
|
||||
{
|
||||
sysClientDetails.setClientSecret(SecurityUtils.encryptPassword(sysClientDetails.getOriginSecret()));
|
||||
return sysClientDetailsMapper.updateSysClientDetails(sysClientDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除终端配置
|
||||
*
|
||||
* @param clientIds 需要删除的终端配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, allEntries = true)
|
||||
public int deleteSysClientDetailsByIds(String[] clientIds)
|
||||
{
|
||||
return sysClientDetailsMapper.deleteSysClientDetailsByIds(clientIds);
|
||||
}
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysClientDetailsMapper">
|
||||
|
||||
<resultMap type="SysClientDetails" id="SysClientDetailsResult">
|
||||
<result property="clientId" column="client_id" />
|
||||
<result property="resourceIds" column="resource_ids" />
|
||||
<result property="clientSecret" column="client_secret" />
|
||||
<result property="scope" column="scope" />
|
||||
<result property="authorizedGrantTypes" column="authorized_grant_types" />
|
||||
<result property="webServerRedirectUri" column="web_server_redirect_uri" />
|
||||
<result property="authorities" column="authorities" />
|
||||
<result property="accessTokenValidity" column="access_token_validity" />
|
||||
<result property="refreshTokenValidity" column="refresh_token_validity" />
|
||||
<result property="additionalInformation" column="additional_information" />
|
||||
<result property="autoapprove" column="autoapprove" />
|
||||
<result property="originSecret" column="origin_secret" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysClientDetailsVo">
|
||||
select client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove, origin_secret from sys_oauth_client_details
|
||||
</sql>
|
||||
|
||||
<select id="selectSysClientDetailsList" parameterType="SysClientDetails" resultMap="SysClientDetailsResult">
|
||||
<include refid="selectSysClientDetailsVo"/>
|
||||
<where>
|
||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysClientDetailsById" parameterType="String" resultMap="SysClientDetailsResult">
|
||||
<include refid="selectSysClientDetailsVo"/>
|
||||
where client_id = #{clientId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysClientDetails" parameterType="SysClientDetails">
|
||||
insert into sys_oauth_client_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">client_id,</if>
|
||||
<if test="resourceIds != null">resource_ids,</if>
|
||||
<if test="clientSecret != null">client_secret,</if>
|
||||
<if test="scope != null">scope,</if>
|
||||
<if test="authorizedGrantTypes != null">authorized_grant_types,</if>
|
||||
<if test="webServerRedirectUri != null">web_server_redirect_uri,</if>
|
||||
<if test="authorities != null">authorities,</if>
|
||||
<if test="accessTokenValidity != null">access_token_validity,</if>
|
||||
<if test="refreshTokenValidity != null">refresh_token_validity,</if>
|
||||
<if test="additionalInformation != null">additional_information,</if>
|
||||
<if test="autoapprove != null">autoapprove,</if>
|
||||
<if test="originSecret != null">origin_secret,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="clientId != null">#{clientId},</if>
|
||||
<if test="resourceIds != null">#{resourceIds},</if>
|
||||
<if test="clientSecret != null">#{clientSecret},</if>
|
||||
<if test="scope != null">#{scope},</if>
|
||||
<if test="authorizedGrantTypes != null">#{authorizedGrantTypes},</if>
|
||||
<if test="webServerRedirectUri != null">#{webServerRedirectUri},</if>
|
||||
<if test="authorities != null">#{authorities},</if>
|
||||
<if test="accessTokenValidity != null">#{accessTokenValidity},</if>
|
||||
<if test="refreshTokenValidity != null">#{refreshTokenValidity},</if>
|
||||
<if test="additionalInformation != null">#{additionalInformation},</if>
|
||||
<if test="autoapprove != null ">#{autoapprove},</if>
|
||||
<if test="originSecret != null ">#{originSecret},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysClientDetails" parameterType="SysClientDetails">
|
||||
update sys_oauth_client_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resourceIds != null">resource_ids = #{resourceIds},</if>
|
||||
<if test="clientSecret != null">client_secret = #{clientSecret},</if>
|
||||
<if test="scope != null">scope = #{scope},</if>
|
||||
<if test="authorizedGrantTypes != null">authorized_grant_types = #{authorizedGrantTypes},</if>
|
||||
<if test="webServerRedirectUri != null">web_server_redirect_uri = #{webServerRedirectUri},</if>
|
||||
<if test="authorities != null">authorities = #{authorities},</if>
|
||||
<if test="accessTokenValidity != null">access_token_validity = #{accessTokenValidity},</if>
|
||||
<if test="refreshTokenValidity != null">refresh_token_validity = #{refreshTokenValidity},</if>
|
||||
<if test="additionalInformation != null">additional_information = #{additionalInformation},</if>
|
||||
<if test="autoapprove != null">autoapprove = #{autoapprove},</if>
|
||||
<if test="originSecret != null">origin_secret = #{originSecret},</if>
|
||||
</trim>
|
||||
where client_id = #{clientId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysClientDetailsById" parameterType="String">
|
||||
delete from sys_oauth_client_details where client_id = #{clientId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysClientDetailsByIds" parameterType="String">
|
||||
delete from sys_oauth_client_details where client_id in
|
||||
<foreach item="clientId" collection="array" open="(" separator="," close=")">
|
||||
#{clientId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user