Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:添加lombok,bean注入由autowired改为构造器注入 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<lombok.version>1.18.28</lombok.version>
</properties>

<!-- 依赖声明 -->
Expand Down Expand Up @@ -135,6 +136,13 @@
<version>${kaptcha.version}</version>
</dependency>

<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>

<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
Expand Down
6 changes: 6 additions & 0 deletions ruoyi-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>

<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package com.ruoyi.system.service.impl;

import java.util.Collection;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.UserConstants;
Expand All @@ -16,20 +11,25 @@
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.service.ISysConfigService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.List;

/**
* 参数配置 服务层实现
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysConfigServiceImpl implements ISysConfigService
{
@Autowired
private SysConfigMapper configMapper;
final SysConfigMapper configMapper;

@Autowired
private RedisCache redisCache;
final RedisCache redisCache;

/**
* 项目启动时,初始化参数到缓存
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.ruoyi.system.service.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.TreeSelect;
Expand All @@ -20,20 +14,26 @@
import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.service.ISysDeptService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

/**
* 部门管理 服务实现
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysDeptServiceImpl implements ISysDeptService
{
@Autowired
private SysDeptMapper deptMapper;
final SysDeptMapper deptMapper;

@Autowired
private SysRoleMapper roleMapper;
final SysRoleMapper roleMapper;

/**
* 查询部门管理数据
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.service.ISysDictDataService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 字典 业务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysDictDataServiceImpl implements ISysDictDataService
{
@Autowired
private SysDictDataMapper dictDataMapper;
final SysDictDataMapper dictDataMapper;

/**
* 根据条件分页查询字典数据
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package com.ruoyi.system.service.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysDictType;
Expand All @@ -17,20 +9,29 @@
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.mapper.SysDictTypeMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* 字典 业务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysDictTypeServiceImpl implements ISysDictTypeService
{
@Autowired
private SysDictTypeMapper dictTypeMapper;
final SysDictTypeMapper dictTypeMapper;


@Autowired
private SysDictDataMapper dictDataMapper;
final SysDictDataMapper dictDataMapper;

/**
* 项目启动时,初始化字典到缓存
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.mapper.SysLogininforMapper;
import com.ruoyi.system.service.ISysLogininforService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 系统访问日志情况信息 服务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysLogininforServiceImpl implements ISysLogininforService
{

@Autowired
private SysLogininforMapper logininforMapper;
final SysLogininforMapper logininforMapper;

/**
* 新增系统登录日志
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package com.ruoyi.system.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.TreeSelect;
Expand All @@ -24,25 +14,28 @@
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysRoleMenuMapper;
import com.ruoyi.system.service.ISysMenuService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;

/**
* 菜单 业务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysMenuServiceImpl implements ISysMenuService
{
public static final String PREMISSION_STRING = "perms[\"{0}\"]";

@Autowired
private SysMenuMapper menuMapper;
final SysMenuMapper menuMapper;

@Autowired
private SysRoleMapper roleMapper;
final SysRoleMapper roleMapper;

@Autowired
private SysRoleMenuMapper roleMenuMapper;
final SysRoleMenuMapper roleMenuMapper;

/**
* 根据用户查询系统菜单列表
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.mapper.SysNoticeMapper;
import com.ruoyi.system.service.ISysNoticeService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 公告 服务层实现
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysNoticeServiceImpl implements ISysNoticeService
{
@Autowired
private SysNoticeMapper noticeMapper;
final SysNoticeMapper noticeMapper;

/**
* 查询公告信息
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.mapper.SysOperLogMapper;
import com.ruoyi.system.service.ISysOperLogService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 操作日志 服务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysOperLogServiceImpl implements ISysOperLogService
{
@Autowired
private SysOperLogMapper operLogMapper;
final SysOperLogMapper operLogMapper;

/**
* 新增操作日志
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.mapper.SysPostMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.service.ISysPostService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 岗位信息 服务层处理
*
* @author ruoyi
*/
@Service
@AllArgsConstructor
public class SysPostServiceImpl implements ISysPostService
{
@Autowired
private SysPostMapper postMapper;
final SysPostMapper postMapper;

@Autowired
private SysUserPostMapper userPostMapper;
final SysUserPostMapper userPostMapper;

/**
* 查询岗位信息集合
Expand Down
Loading