mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-05-05 11:31:27 +08:00
add 整合 mybatis-plus 重写所有业务
This commit is contained in:
@@ -4,10 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.system.api.RemoteDictService;
|
||||
import com.ruoyi.system.api.domain.SysDictData;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,18 +16,18 @@ import java.util.List;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteDictServiceImpl implements RemoteDictService {
|
||||
|
||||
private final ISysDictDataService sysDictDataService;
|
||||
private final ISysDictTypeService sysDictTypeService;
|
||||
|
||||
|
||||
@Override
|
||||
public String getDictLabel(String dictType, String dictValue, String separator) {
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = sysDictDataService.selectDictDataByType(dictType);
|
||||
List<SysDictData> datas = sysDictTypeService.selectDictDataByType(dictType);
|
||||
|
||||
if (StringUtils.containsAny(dictValue, separator) && CollUtil.isNotEmpty(datas)) {
|
||||
for (SysDictData dict : datas) {
|
||||
@@ -52,7 +51,7 @@ public class RemoteDictServiceImpl implements RemoteDictService {
|
||||
@Override
|
||||
public String getDictValue(String dictType, String dictLabel, String separator) {
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = sysDictDataService.selectDictDataByType(dictType);
|
||||
List<SysDictData> datas = sysDictTypeService.selectDictDataByType(dictType);
|
||||
|
||||
if (StringUtils.containsAny(dictLabel, separator) && CollUtil.isNotEmpty(datas)) {
|
||||
for (SysDictData dict : datas) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.ruoyi.system.service.ISysLogininforService;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -15,7 +14,7 @@ import org.springframework.stereotype.Service;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteLogServiceImpl implements RemoteLogService {
|
||||
@@ -24,12 +23,12 @@ public class RemoteLogServiceImpl implements RemoteLogService {
|
||||
private final ISysLogininforService logininforService;
|
||||
|
||||
@Override
|
||||
public Boolean saveLog(SysOperLog sysOperLog, String source){
|
||||
public Boolean saveLog(SysOperLog sysOperLog) {
|
||||
return operLogService.insertOperlog(sysOperLog) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean saveLogininfor(SysLogininfor sysLogininfor, String source){
|
||||
public Boolean saveLogininfor(SysLogininfor sysLogininfor) {
|
||||
return logininforService.insertLogininfor(sysLogininfor) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.ruoyi.system.service.ISysPermissionService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Set;
|
||||
@@ -21,7 +20,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteUserServiceImpl implements RemoteUserService {
|
||||
@@ -31,7 +30,7 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
||||
private final ISysConfigService configService;
|
||||
|
||||
@Override
|
||||
public LoginUser getUserInfo(String username, String source) {
|
||||
public LoginUser getUserInfo(String username) {
|
||||
SysUser sysUser = userService.selectUserByUserName(username);
|
||||
if (ObjectUtil.isNull(sysUser)) {
|
||||
throw new ServiceException("用户名或密码错误");
|
||||
@@ -48,7 +47,7 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean registerUserInfo(SysUser sysUser, String source) {
|
||||
public Boolean registerUserInfo(SysUser sysUser) {
|
||||
String username = sysUser.getUserName();
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
throw new ServiceException("当前系统没有开启注册功能");
|
||||
|
||||
Reference in New Issue
Block a user