加入Mybatis-plus

master
dongzeliang 2023-11-13 14:18:13 +08:00
parent 9ebe0fc957
commit 29f17bf686
63 changed files with 205 additions and 755 deletions

105
README.md
View File

@ -1,29 +1,3 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">MuYu v3.6.3</h1>
<h4 align="center">基于 Vue/Element UI 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
<p align="center">
<a href="https://gitee.com/y_project/MuYu-Cloud/stargazers"><img src="https://gitee.com/y_project/MuYu-Cloud/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/MuYu-Cloud"><img src="https://img.shields.io/badge/MuYu-v3.6.3-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/MuYu-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 采用前后端分离的模式,微服务版本前端(基于 [MuYu-Vue](https://gitee.com/y_project/MuYu-Vue))。
* 后端采用Spring Boot、Spring Cloud & Alibaba。
* 注册中心、配置中心选型Nacos权限认证使用Redis。
* 流量控制框架选型Sentinel分布式事务选型Seata。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[MuYu-Cloud-Vue3](https://github.com/yangzongzhuan/MuYu-Cloud-Vue3),保持同步更新。
* 如需不分离应用,请移步 [MuYu](https://gitee.com/y_project/MuYu),如需分离应用,请移步 [MuYu-Vue](https://gitee.com/y_project/MuYu-Vue)
* 阿里云折扣场:[点我进入](http://aly.muyu.vip),腾讯云秒杀场:[点我进入](http://txy.muyu.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
#### 友情链接 [若依/MuYu-Cloud](https://gitee.com/zhangmrit/muyu-cloud) Ant Design版本。
## 系统模块
~~~
@ -40,6 +14,7 @@ com.muyu
│ └── muyu-common-seata // 分布式事务
│ └── muyu-common-security // 安全模块
│ └── muyu-common-swagger // 系统接口
│ └── muyu-common-system // 系统基础
├── muyu-modules // 业务模块
│ └── muyu-system // 系统模块 [9201]
│ └── muyu-gen // 代码生成 [9202]
@ -49,81 +24,3 @@ com.muyu
│ └── muyu-visual-monitor // 监控中心 [9100]
├──pom.xml // 公共依赖
~~~
## 架构图
<img src="https://oscimg.oschina.net/oscnet/up-82e9722ecb846786405a904bafcf19f73f3.png"/>
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 在线构建器拖动表单元素生成相应的HTML代码。
17. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
演示地址http://muyu.vip
文档地址http://doc.muyu.vip
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-4148b24f58660a9dc347761e4cf6162f28f.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-ece3fd37a3d4bb75a3926e905a3c5629055.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-ff9e3066561574aca73005c5730c6a41f15.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依微服务交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-42799195-blue.svg)](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [![加入QQ群](https://img.shields.io/badge/已满-170157040-blue.svg)](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [![加入QQ群](https://img.shields.io/badge/已满-130643120-blue.svg)](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [![加入QQ群](https://img.shields.io/badge/已满-225920371-blue.svg)](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) [![加入QQ群](https://img.shields.io/badge/已满-201705537-blue.svg)](https://jq.qq.com/?_wv=1027&k=FnHHP4TT) [![加入QQ群](https://img.shields.io/badge/已满-236543183-blue.svg)](https://jq.qq.com/?_wv=1027&k=qdT1Ojpz) [![加入QQ群](https://img.shields.io/badge/已满-213618602-blue.svg)](https://jq.qq.com/?_wv=1027&k=nw3OiyXs) [![加入QQ群](https://img.shields.io/badge/已满-148794840-blue.svg)](https://jq.qq.com/?_wv=1027&k=kiU5WDls) [![加入QQ群](https://img.shields.io/badge/已满-118752664-blue.svg)](https://jq.qq.com/?_wv=1027&k=MtBy6YfT) [![加入QQ群](https://img.shields.io/badge/已满-101038945-blue.svg)](https://jq.qq.com/?_wv=1027&k=FqImHgH2) [![加入QQ群](https://img.shields.io/badge/128355254-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G4jZ4EtdT50PhnMBudTnEwgonxkXOscJ&authKey=FkGHYfoTKlGE6wHdKdjH9bVoOgQjtLP9WM%2Fj7pqGY1msoqw9uxDiBo39E2mLgzYg&noverify=0&group_code=128355254) 点击按钮入群。

View File

@ -1,5 +1,6 @@
package com.muyu.gen.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.gen.domain.GenTableColumn;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface GenTableColumnMapper {
public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.gen.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.gen.domain.GenTable;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface GenTableMapper {
public interface GenTableMapper extends BaseMapper<GenTable> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.job.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.job.domain.SysJobLog;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysJobLogMapper {
public interface SysJobLogMapper extends BaseMapper<SysJobLog> {
/**
* quartz
*

View File

@ -1,5 +1,6 @@
package com.muyu.job.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.job.domain.SysJob;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysJobMapper {
public interface SysJobMapper extends BaseMapper<SysJob> {
/**
*
*

View File

@ -1,21 +1,21 @@
package com.muyu.system.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.SysConfig;
import com.muyu.system.service.ISysConfigService;
import org.apache.poi.ss.formula.functions.T;
import com.muyu.system.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
@ -26,8 +26,9 @@ import java.util.List;
@RestController
@RequestMapping("/config")
public class SysConfigController extends BaseController {
@Autowired
private ISysConfigService configService;
private SysConfigService configService;
/**
*
@ -36,7 +37,7 @@ public class SysConfigController extends BaseController {
@GetMapping("/list")
public Result<TableDataInfo<SysConfig>> list (SysConfig config) {
startPage();
List<SysConfig> list = configService.selectConfigList(config);
List<SysConfig> list = configService.pageQuery(config);
return getDataTable(list);
}
@ -44,7 +45,7 @@ public class SysConfigController extends BaseController {
@RequiresPermissions("system:config:export")
@PostMapping("/export")
public void export (HttpServletResponse response, SysConfig config) {
List<SysConfig> list = configService.selectConfigList(config);
List<SysConfig> list = configService.pageQuery(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
@ -54,7 +55,7 @@ public class SysConfigController extends BaseController {
*/
@GetMapping(value = "/{configId}")
public Result getInfo (@PathVariable Long configId) {
return success(configService.selectConfigById(configId));
return success(configService.getById(configId));
}
/**
@ -76,7 +77,7 @@ public class SysConfigController extends BaseController {
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(SecurityUtils.getUsername());
return toAjax(configService.insertConfig(config));
return toAjax(configService.save(config));
}
/**
@ -90,7 +91,7 @@ public class SysConfigController extends BaseController {
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(SecurityUtils.getUsername());
return toAjax(configService.updateConfig(config));
return toAjax(configService.updateById(config));
}
/**
@ -100,7 +101,7 @@ public class SysConfigController extends BaseController {
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public Result remove (@PathVariable Long[] configIds) {
configService.deleteConfigByIds(configIds);
configService.removeBatchByIds(Arrays.asList(configIds));
return success();
}

View File

@ -1,118 +0,0 @@
package com.muyu.system.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.SysConfig;
import com.muyu.system.service.SysConfigPlusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
*
*
* @author muyu
*/
@RestController
@RequestMapping("/config/plus")
public class SysConfigPlusController extends BaseController {
@Autowired
private SysConfigPlusService configService;
/**
*
*/
@RequiresPermissions("system:config:list")
@GetMapping("/list")
public Result<TableDataInfo<SysConfig>> list (SysConfig config) {
startPage();
List<SysConfig> list = configService.pageQuery(config);
return getDataTable(list);
}
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
public void export (HttpServletResponse response, SysConfig config) {
List<SysConfig> list = configService.pageQuery(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
/**
*
*/
@GetMapping(value = "/{configId}")
public Result getInfo (@PathVariable Long configId) {
return success(configService.getById(configId));
}
/**
*
*/
@GetMapping(value = "/configKey/{configKey}")
public Result getConfigKey (@PathVariable String configKey) {
return success(configService.selectConfigByKey(configKey));
}
/**
*
*/
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
public Result add (@Validated @RequestBody SysConfig config) {
if (!configService.checkConfigKeyUnique(config)) {
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(SecurityUtils.getUsername());
return toAjax(configService.save(config));
}
/**
*
*/
@RequiresPermissions("system:config:edit")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping
public Result edit (@Validated @RequestBody SysConfig config) {
if (!configService.checkConfigKeyUnique(config)) {
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(SecurityUtils.getUsername());
return toAjax(configService.updateById(config));
}
/**
*
*/
@RequiresPermissions("system:config:remove")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public Result remove (@PathVariable Long[] configIds) {
configService.removeBatchByIds(Arrays.asList(configIds));
return success();
}
/**
*
*/
@RequiresPermissions("system:config:remove")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public Result refreshCache () {
configService.resetConfigCache();
return success();
}
}

View File

@ -9,7 +9,7 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.SysDept;
import com.muyu.system.service.ISysDeptService;
import com.muyu.system.service.SysDeptService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@ -25,8 +25,9 @@ import java.util.List;
@RestController
@RequestMapping("/dept")
public class SysDeptController extends BaseController {
@Autowired
private ISysDeptService deptService;
private SysDeptService deptService;
/**
*

View File

@ -10,8 +10,8 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.SysDictData;
import com.muyu.system.service.ISysDictDataService;
import com.muyu.system.service.ISysDictTypeService;
import com.muyu.system.service.SysDictDataService;
import com.muyu.system.service.SysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -29,10 +29,10 @@ import java.util.List;
@RequestMapping("/dict/data")
public class SysDictDataController extends BaseController {
@Autowired
private ISysDictDataService dictDataService;
private SysDictDataService dictDataService;
@Autowired
private ISysDictTypeService dictTypeService;
private SysDictTypeService dictTypeService;
@RequiresPermissions("system:dict:list")
@GetMapping("/list")

View File

@ -9,7 +9,7 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.SysDictType;
import com.muyu.system.service.ISysDictTypeService;
import com.muyu.system.service.SysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -26,7 +26,7 @@ import java.util.List;
@RequestMapping("/dict/type")
public class SysDictTypeController extends BaseController {
@Autowired
private ISysDictTypeService dictTypeService;
private SysDictTypeService dictTypeService;
@RequiresPermissions("system:dict:list")
@GetMapping("/list")

View File

@ -11,7 +11,7 @@ import com.muyu.common.redis.service.RedisService;
import com.muyu.common.security.annotation.InnerAuth;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.system.domain.SysLogininfor;
import com.muyu.system.service.ISysLogininforService;
import com.muyu.system.service.SysLogininforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -27,7 +27,7 @@ import java.util.List;
@RequestMapping("/logininfor")
public class SysLogininforController extends BaseController {
@Autowired
private ISysLogininforService logininforService;
private SysLogininforService logininforService;
@Autowired
private RedisService redisService;

View File

@ -10,7 +10,7 @@ import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.SysMenu;
import com.muyu.system.domain.resp.RoleMenuTreeResp;
import com.muyu.system.service.ISysMenuService;
import com.muyu.system.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -26,7 +26,7 @@ import java.util.List;
@RequestMapping("/menu")
public class SysMenuController extends BaseController {
@Autowired
private ISysMenuService menuService;
private SysMenuService menuService;
/**
*

View File

@ -8,7 +8,7 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.SysNotice;
import com.muyu.system.service.ISysNoticeService;
import com.muyu.system.service.SysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -24,7 +24,7 @@ import java.util.List;
@RequestMapping("/notice")
public class SysNoticeController extends BaseController {
@Autowired
private ISysNoticeService noticeService;
private SysNoticeService noticeService;
/**
*

View File

@ -9,7 +9,7 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.InnerAuth;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.system.domain.SysOperLog;
import com.muyu.system.service.ISysOperLogService;
import com.muyu.system.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -25,7 +25,7 @@ import java.util.List;
@RequestMapping("/operlog")
public class SysOperlogController extends BaseController {
@Autowired
private ISysOperLogService operLogService;
private SysOperLogService operLogService;
@RequiresPermissions("system:operlog:list")
@GetMapping("/list")

View File

@ -9,7 +9,7 @@ import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.SysPost;
import com.muyu.system.service.ISysPostService;
import com.muyu.system.service.SysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -26,7 +26,7 @@ import java.util.List;
@RequestMapping("/post")
public class SysPostController extends BaseController {
@Autowired
private ISysPostService postService;
private SysPostService postService;
/**
*

View File

@ -14,7 +14,7 @@ import com.muyu.common.system.domain.SysFile;
import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.domain.LoginUser;
import com.muyu.system.domain.resp.ProfileResp;
import com.muyu.system.service.ISysUserService;
import com.muyu.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -30,7 +30,7 @@ import java.util.Arrays;
@RequestMapping("/user/profile")
public class SysProfileController extends BaseController {
@Autowired
private ISysUserService userService;
private SysUserService userService;
@Autowired
private TokenService tokenService;

View File

@ -13,9 +13,9 @@ import com.muyu.common.system.domain.SysRole;
import com.muyu.common.system.domain.SysUser;
import com.muyu.system.domain.SysUserRole;
import com.muyu.system.domain.resp.DeptTreeResp;
import com.muyu.system.service.ISysDeptService;
import com.muyu.system.service.ISysRoleService;
import com.muyu.system.service.ISysUserService;
import com.muyu.system.service.SysDeptService;
import com.muyu.system.service.SysRoleService;
import com.muyu.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -32,13 +32,13 @@ import java.util.List;
@RequestMapping("/role")
public class SysRoleController extends BaseController {
@Autowired
private ISysRoleService roleService;
private SysRoleService roleService;
@Autowired
private ISysUserService userService;
private SysUserService userService;
@Autowired
private ISysDeptService deptService;
private SysDeptService deptService;
@RequiresPermissions("system:role:list")
@GetMapping("/list")

View File

@ -39,22 +39,22 @@ import java.util.stream.Collectors;
@RequestMapping("/user")
public class SysUserController extends BaseController {
@Autowired
private ISysUserService userService;
private SysUserService userService;
@Autowired
private ISysRoleService roleService;
private SysRoleService roleService;
@Autowired
private ISysDeptService deptService;
private SysDeptService deptService;
@Autowired
private ISysPostService postService;
private SysPostService postService;
@Autowired
private ISysPermissionService permissionService;
private SysPermissionService permissionService;
@Autowired
private ISysConfigService configService;
private SysConfigService configService;
/**
*

View File

@ -11,7 +11,7 @@ import com.muyu.common.redis.service.RedisService;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.system.domain.LoginUser;
import com.muyu.system.domain.SysUserOnline;
import com.muyu.system.service.ISysUserOnlineService;
import com.muyu.system.service.SysUserOnlineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -29,7 +29,7 @@ import java.util.List;
@RequestMapping("/online")
public class SysUserOnlineController extends BaseController {
@Autowired
private ISysUserOnlineService userOnlineService;
private SysUserOnlineService userOnlineService;
@Autowired
private RedisService redisService;

View File

@ -1,84 +1,12 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysConfig;
import java.util.List;
/**
*
*
* @author muyu
* @author DongZl
* @description: mybatis
* @Date 2023-11-13 10:05
*/
public interface SysConfigMapper {
/**
*
*
* @param config
*
* @return
*/
public SysConfig selectConfig (SysConfig config);
/**
* ID
*
* @param configId ID
*
* @return
*/
public SysConfig selectConfigById (Long configId);
/**
*
*
* @param config
*
* @return
*/
public List<SysConfig> selectConfigList (SysConfig config);
/**
*
*
* @param configKey
*
* @return
*/
public SysConfig checkConfigKeyUnique (String configKey);
/**
*
*
* @param config
*
* @return
*/
public int insertConfig (SysConfig config);
/**
*
*
* @param config
*
* @return
*/
public int updateConfig (SysConfig config);
/**
*
*
* @param configId ID
*
* @return
*/
public int deleteConfigById (Long configId);
/**
*
*
* @param configIds ID
*
* @return
*/
public int deleteConfigByIds (Long[] configIds);
public interface SysConfigMapper extends BaseMapper<SysConfig> {
}

View File

@ -1,12 +0,0 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysConfig;
/**
* @author DongZl
* @description: mybatis
* @Date 2023-11-13 10:05
*/
public interface SysConfigPlusMapper extends BaseMapper<SysConfig> {
}

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysDept;
import org.apache.ibatis.annotations.Param;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysDeptMapper {
public interface SysDeptMapper extends BaseMapper<SysDept> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysDictData;
import org.apache.ibatis.annotations.Param;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysDictDataMapper {
public interface SysDictDataMapper extends BaseMapper<SysDictData> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysDictType;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysDictTypeMapper {
public interface SysDictTypeMapper extends BaseMapper<SysDictType> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysLogininfor;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysLogininforMapper {
public interface SysLogininforMapper extends BaseMapper<SysLogininfor> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysMenu;
import org.apache.ibatis.annotations.Param;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysMenuMapper {
public interface SysMenuMapper extends BaseMapper<SysMenu> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysNotice;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysNoticeMapper {
public interface SysNoticeMapper extends BaseMapper<SysNotice> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysOperLog;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysOperLogMapper {
public interface SysOperLogMapper extends BaseMapper<SysOperLog> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysPost;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysPostMapper {
public interface SysPostMapper extends BaseMapper<SysPost> {
/**
*
*

View File

@ -1,6 +1,7 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysRoleDept;
import java.util.List;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysRoleDeptMapper {
public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> {
/**
* ID
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysRole;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysRoleMapper {
public interface SysRoleMapper extends BaseMapper<SysRole> {
/**
*
*

View File

@ -1,6 +1,7 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysRoleMenu;
import java.util.List;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysRoleMenuMapper {
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
/**
* 使
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.system.domain.SysUser;
import org.apache.ibatis.annotations.Param;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysUserMapper {
public interface SysUserMapper extends BaseMapper<SysUser> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysUserPost;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysUserPostMapper {
public interface SysUserPostMapper extends BaseMapper<SysUserPost> {
/**
* ID
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.system.domain.SysUserRole;
import org.apache.ibatis.annotations.Param;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface SysUserRoleMapper {
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
/**
* ID
*

View File

@ -1,88 +0,0 @@
package com.muyu.system.service;
import com.muyu.system.domain.SysConfig;
import java.util.List;
/**
*
*
* @author muyu
*/
public interface ISysConfigService {
/**
*
*
* @param configId ID
*
* @return
*/
public SysConfig selectConfigById (Long configId);
/**
*
*
* @param configKey
*
* @return
*/
public String selectConfigByKey (String configKey);
/**
*
*
* @param config
*
* @return
*/
public List<SysConfig> selectConfigList (SysConfig config);
/**
*
*
* @param config
*
* @return
*/
public int insertConfig (SysConfig config);
/**
*
*
* @param config
*
* @return
*/
public int updateConfig (SysConfig config);
/**
*
*
* @param configIds ID
*/
public void deleteConfigByIds (Long[] configIds);
/**
*
*/
public void loadingConfigCache ();
/**
*
*/
public void clearConfigCache ();
/**
*
*/
public void resetConfigCache ();
/**
*
*
* @param config
*
* @return
*/
public boolean checkConfigKeyUnique (SysConfig config);
}

View File

@ -1,7 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.system.domain.SysConfig;
import java.util.List;
@ -11,7 +10,7 @@ import java.util.List;
* @description: plus
* @Date 2023-11-13 10:06
*/
public interface SysConfigPlusService extends IService<SysConfig> {
public interface SysConfigService extends IService<SysConfig> {
List<SysConfig> pageQuery (SysConfig config);
/**

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysDept;
import com.muyu.system.domain.vo.TreeSelect;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysDeptService {
public interface SysDeptService extends IService<SysDept> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysDictData;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysDictDataService {
public interface SysDictDataService extends IService<SysDictData> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysDictData;
import com.muyu.common.system.domain.SysDictType;
@ -10,7 +11,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysDictTypeService {
public interface SysDictTypeService extends IService<SysDictType> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysLogininfor;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysLogininforService {
public interface SysLogininforService extends IService<SysLogininfor> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.system.domain.SysMenu;
import com.muyu.system.domain.vo.RouterVo;
import com.muyu.system.domain.vo.TreeSelect;
@ -12,7 +13,7 @@ import java.util.Set;
*
* @author muyu
*/
public interface ISysMenuService {
public interface SysMenuService extends IService<SysMenu> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.system.domain.SysNotice;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysNoticeService {
public interface SysNoticeService extends IService<SysNotice> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysOperLog;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysOperLogService {
public interface SysOperLogService extends IService<SysOperLog> {
/**
*
*

View File

@ -9,7 +9,7 @@ import java.util.Set;
*
* @author muyu
*/
public interface ISysPermissionService {
public interface SysPermissionService {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.system.domain.SysPost;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysPostService {
public interface SysPostService extends IService<SysPost> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysRole;
import com.muyu.system.domain.SysUserRole;
@ -11,7 +12,7 @@ import java.util.Set;
*
* @author muyu
*/
public interface ISysRoleService {
public interface SysRoleService extends IService<SysRole> {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.LoginUser;
import com.muyu.system.domain.SysUserOnline;
@ -8,7 +9,7 @@ import com.muyu.system.domain.SysUserOnline;
*
* @author muyu
*/
public interface ISysUserOnlineService {
public interface SysUserOnlineService {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.system.domain.SysUser;
import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
*
* @author muyu
*/
public interface ISysUserService {
public interface SysUserService extends IService<SysUser> {
/**
*
*

View File

@ -1,114 +0,0 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.CacheConstants;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.redis.service.RedisService;
import com.muyu.system.domain.SysConfig;
import com.muyu.system.mapper.SysConfigPlusMapper;
import com.muyu.system.service.SysConfigPlusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author DongZl
* @description: plus
* @Date 2023-11-13 10:06
*/
@Service
public class SysConfigPlusServiceImpl extends ServiceImpl<SysConfigPlusMapper, SysConfig>
implements SysConfigPlusService {
@Autowired
private RedisService redisService;
@Override
public List<SysConfig> pageQuery (SysConfig config) {
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(config.getConfigName())){
queryWrapper.like(SysConfig::getConfigName, config.getConfigName());
}
if (StringUtils.isNotEmpty(config.getConfigType())){
queryWrapper.like(SysConfig::getConfigType, config.getConfigType());
}
if (StringUtils.isNotEmpty(config.getConfigKey())){
queryWrapper.like(SysConfig::getConfigKey, config.getConfigKey());
}
Object beginTime = config.getParams().get("beginTime");
if (Objects.nonNull(beginTime) && beginTime instanceof Date beginDate){
queryWrapper.gt(SysConfig::getCreateTime, beginDate);
}
Object endTime = config.getParams().get("endTime");
if (Objects.nonNull(endTime) && endTime instanceof Date endDate){
queryWrapper.lt(SysConfig::getCreateTime, endDate);
}
return this.list(queryWrapper);
}
/**
* Key
*
* @param configKey
*
* @return
*/
@Override
public String selectConfigByKey (String configKey) {
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
Assert.notNull(configKey, "key不可为空");
queryWrapper.eq(SysConfig::getConfigKey, configKey);
SysConfig sysConfig = this.getOne(queryWrapper);
return sysConfig.getConfigValue();
}
@Override
public boolean checkConfigKeyUnique (SysConfig config) {
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysConfig::getConfigKey, config.getConfigKey());
return this.count(queryWrapper) > 0;
}
@Override
public void resetConfigCache () {
this.clearConfigCache();
this.loadingConfigCache();
}
/**
*
*/
@Override
public void clearConfigCache () {
Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*");
redisService.deleteObject(keys);
}
/**
*
*/
@Override
public void loadingConfigCache () {
List<SysConfig> configsList = this.list();
for (SysConfig config : configsList) {
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
}
}
/**
* cache key
*
* @param configKey
*
* @return key
*/
private String getCacheKey (String configKey) {
return CacheConstants.SYS_CONFIG_KEY + configKey;
}
}

View File

@ -1,154 +1,84 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.CacheConstants;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.text.Convert;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.redis.service.RedisService;
import com.muyu.system.domain.SysConfig;
import com.muyu.system.mapper.SysConfigMapper;
import com.muyu.system.service.ISysConfigService;
import com.muyu.system.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
*
*
* @author muyu
* @author DongZl
* @description: plus
* @Date 2023-11-13 10:06
*/
@Service
public class SysConfigServiceImpl implements ISysConfigService {
@Autowired
private SysConfigMapper configMapper;
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig>
implements SysConfigService {
@Autowired
private RedisService redisService;
/**
*
*/
@PostConstruct
public void init () {
loadingConfigCache();
}
/**
*
*
* @param configId ID
*
* @return
*/
@Override
public SysConfig selectConfigById (Long configId) {
SysConfig config = new SysConfig();
config.setConfigId(configId);
return configMapper.selectConfig(config);
public List<SysConfig> pageQuery (SysConfig config) {
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(config.getConfigName())){
queryWrapper.like(SysConfig::getConfigName, config.getConfigName());
}
if (StringUtils.isNotEmpty(config.getConfigType())){
queryWrapper.like(SysConfig::getConfigType, config.getConfigType());
}
if (StringUtils.isNotEmpty(config.getConfigKey())){
queryWrapper.like(SysConfig::getConfigKey, config.getConfigKey());
}
Object beginTime = config.getParams().get("beginTime");
if (Objects.nonNull(beginTime) && beginTime instanceof Date beginDate){
queryWrapper.gt(SysConfig::getCreateTime, beginDate);
}
Object endTime = config.getParams().get("endTime");
if (Objects.nonNull(endTime) && endTime instanceof Date endDate){
queryWrapper.lt(SysConfig::getCreateTime, endDate);
}
return this.list(queryWrapper);
}
/**
*
* Key
*
* @param configKey key
* @param configKey
*
* @return
* @return
*/
@Override
public String selectConfigByKey (String configKey) {
String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey)));
if (StringUtils.isNotEmpty(configValue)) {
return configValue;
}
SysConfig config = new SysConfig();
config.setConfigKey(configKey);
SysConfig retConfig = configMapper.selectConfig(config);
if (StringUtils.isNotNull(retConfig)) {
redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
return retConfig.getConfigValue();
}
return StringUtils.EMPTY;
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
Assert.notNull(configKey, "key不可为空");
queryWrapper.eq(SysConfig::getConfigKey, configKey);
SysConfig sysConfig = this.getOne(queryWrapper);
return sysConfig.getConfigValue();
}
/**
*
*
* @param config
*
* @return
*/
@Override
public List<SysConfig> selectConfigList (SysConfig config) {
return configMapper.selectConfigList(config);
public boolean checkConfigKeyUnique (SysConfig config) {
LambdaQueryWrapper<SysConfig> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysConfig::getConfigKey, config.getConfigKey());
return this.count(queryWrapper) > 0;
}
/**
*
*
* @param config
*
* @return
*/
@Override
public int insertConfig (SysConfig config) {
int row = configMapper.insertConfig(config);
if (row > 0) {
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
}
return row;
}
/**
*
*
* @param config
*
* @return
*/
@Override
public int updateConfig (SysConfig config) {
SysConfig temp = configMapper.selectConfigById(config.getConfigId());
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
redisService.deleteObject(getCacheKey(temp.getConfigKey()));
}
int row = configMapper.updateConfig(config);
if (row > 0) {
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
}
return row;
}
/**
*
*
* @param configIds ID
*/
@Override
public void deleteConfigByIds (Long[] configIds) {
for (Long configId : configIds) {
SysConfig config = selectConfigById(configId);
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
}
configMapper.deleteConfigById(configId);
redisService.deleteObject(getCacheKey(config.getConfigKey()));
}
}
/**
*
*/
@Override
public void loadingConfigCache () {
List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig());
for (SysConfig config : configsList) {
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
}
public void resetConfigCache () {
this.clearConfigCache();
this.loadingConfigCache();
}
/**
@ -161,29 +91,14 @@ public class SysConfigServiceImpl implements ISysConfigService {
}
/**
*
*
*/
@Override
public void resetConfigCache () {
clearConfigCache();
loadingConfigCache();
}
/**
*
*
* @param config
*
* @return
*/
@Override
public boolean checkConfigKeyUnique (SysConfig config) {
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
return UserConstants.NOT_UNIQUE;
public void loadingConfigCache () {
List<SysConfig> configsList = this.list();
for (SysConfig config : configsList) {
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
}
return UserConstants.UNIQUE;
}
/**

View File

@ -1,5 +1,6 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.text.Convert;
@ -13,7 +14,7 @@ import com.muyu.common.system.domain.SysUser;
import com.muyu.system.domain.vo.TreeSelect;
import com.muyu.system.mapper.SysDeptMapper;
import com.muyu.system.mapper.SysRoleMapper;
import com.muyu.system.service.ISysDeptService;
import com.muyu.system.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -28,7 +29,7 @@ import java.util.stream.Collectors;
* @author muyu
*/
@Service
public class SysDeptServiceImpl implements ISysDeptService {
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
@Autowired
private SysDeptMapper deptMapper;

View File

@ -1,9 +1,10 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.security.utils.DictUtils;
import com.muyu.common.system.domain.SysDictData;
import com.muyu.system.mapper.SysDictDataMapper;
import com.muyu.system.service.ISysDictDataService;
import com.muyu.system.service.SysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -15,7 +16,7 @@ import java.util.List;
* @author muyu
*/
@Service
public class SysDictDataServiceImpl implements ISysDictDataService {
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
@Autowired
private SysDictDataMapper dictDataMapper;

View File

@ -1,5 +1,6 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.StringUtils;
@ -8,7 +9,7 @@ import com.muyu.common.system.domain.SysDictData;
import com.muyu.common.system.domain.SysDictType;
import com.muyu.system.mapper.SysDictDataMapper;
import com.muyu.system.mapper.SysDictTypeMapper;
import com.muyu.system.service.ISysDictTypeService;
import com.muyu.system.service.SysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,7 +26,7 @@ import java.util.stream.Collectors;
* @author muyu
*/
@Service
public class SysDictTypeServiceImpl implements ISysDictTypeService {
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService {
@Autowired
private SysDictTypeMapper dictTypeMapper;

View File

@ -1,8 +1,9 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.system.domain.SysLogininfor;
import com.muyu.system.mapper.SysLogininforMapper;
import com.muyu.system.service.ISysLogininforService;
import com.muyu.system.service.SysLogininforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,7 +15,7 @@ import java.util.List;
* @author muyu
*/
@Service
public class SysLogininforServiceImpl implements ISysLogininforService {
public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements SysLogininforService {
@Autowired
private SysLogininforMapper logininforMapper;

View File

@ -1,5 +1,6 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.Constants;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.utils.StringUtils;
@ -13,7 +14,7 @@ import com.muyu.system.domain.vo.TreeSelect;
import com.muyu.system.mapper.SysMenuMapper;
import com.muyu.system.mapper.SysRoleMapper;
import com.muyu.system.mapper.SysRoleMenuMapper;
import com.muyu.system.service.ISysMenuService;
import com.muyu.system.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,7 +27,7 @@ import java.util.stream.Collectors;
* @author muyu
*/
@Service
public class SysMenuServiceImpl implements ISysMenuService {
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
@Autowired

View File

@ -1,8 +1,9 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.system.domain.SysNotice;
import com.muyu.system.mapper.SysNoticeMapper;
import com.muyu.system.service.ISysNoticeService;
import com.muyu.system.service.SysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,7 +15,7 @@ import java.util.List;
* @author muyu
*/
@Service
public class SysNoticeServiceImpl implements ISysNoticeService {
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
@Autowired
private SysNoticeMapper noticeMapper;

View File

@ -1,8 +1,9 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.system.domain.SysOperLog;
import com.muyu.system.mapper.SysOperLogMapper;
import com.muyu.system.service.ISysOperLogService;
import com.muyu.system.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,7 +15,7 @@ import java.util.List;
* @author muyu
*/
@Service
public class SysOperLogServiceImpl implements ISysOperLogService {
public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService {
@Autowired
private SysOperLogMapper operLogMapper;

View File

@ -1,10 +1,11 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.system.domain.SysRole;
import com.muyu.common.system.domain.SysUser;
import com.muyu.system.service.ISysMenuService;
import com.muyu.system.service.ISysPermissionService;
import com.muyu.system.service.ISysRoleService;
import com.muyu.system.service.SysMenuService;
import com.muyu.system.service.SysPermissionService;
import com.muyu.system.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -19,12 +20,12 @@ import java.util.Set;
* @author muyu
*/
@Service
public class SysPermissionServiceImpl implements ISysPermissionService {
public class SysPermissionServiceImpl implements SysPermissionService {
@Autowired
private ISysRoleService roleService;
private SysRoleService roleService;
@Autowired
private ISysMenuService menuService;
private SysMenuService menuService;
/**
*

View File

@ -1,12 +1,13 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.system.domain.SysPost;
import com.muyu.system.mapper.SysPostMapper;
import com.muyu.system.mapper.SysUserPostMapper;
import com.muyu.system.service.ISysPostService;
import com.muyu.system.service.SysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,7 +19,7 @@ import java.util.List;
* @author muyu
*/
@Service
public class SysPostServiceImpl implements ISysPostService {
public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements SysPostService {
@Autowired
private SysPostMapper postMapper;

View File

@ -1,5 +1,6 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.SpringUtils;
@ -15,7 +16,7 @@ import com.muyu.system.mapper.SysRoleDeptMapper;
import com.muyu.system.mapper.SysRoleMapper;
import com.muyu.system.mapper.SysRoleMenuMapper;
import com.muyu.system.mapper.SysUserRoleMapper;
import com.muyu.system.service.ISysRoleService;
import com.muyu.system.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -28,7 +29,7 @@ import java.util.*;
* @author muyu
*/
@Service
public class SysRoleServiceImpl implements ISysRoleService {
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
@Autowired
private SysRoleMapper roleMapper;

View File

@ -1,9 +1,10 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.system.domain.LoginUser;
import com.muyu.system.domain.SysUserOnline;
import com.muyu.system.service.ISysUserOnlineService;
import com.muyu.system.service.SysUserOnlineService;
import org.springframework.stereotype.Service;
/**
@ -12,7 +13,7 @@ import org.springframework.stereotype.Service;
* @author muyu
*/
@Service
public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
public class SysUserOnlineServiceImpl implements SysUserOnlineService {
/**
*
*

View File

@ -1,5 +1,6 @@
package com.muyu.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.SpringUtils;
@ -13,8 +14,8 @@ import com.muyu.system.domain.SysPost;
import com.muyu.system.domain.SysUserPost;
import com.muyu.system.domain.SysUserRole;
import com.muyu.system.mapper.*;
import com.muyu.system.service.ISysConfigService;
import com.muyu.system.service.ISysUserService;
import com.muyu.system.service.SysUserService;
import com.muyu.system.service.SysConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,7 +34,7 @@ import java.util.stream.Collectors;
* @author muyu
*/
@Service
public class SysUserServiceImpl implements ISysUserService {
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
@Autowired
protected Validator validator;
@ -48,7 +49,7 @@ public class SysUserServiceImpl implements ISysUserService {
@Autowired
private SysUserPostMapper userPostMapper;
@Autowired
private ISysConfigService configService;
private SysConfigService configService;
/**
*