mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-30 17:11:28 +08:00
Revert "[重大更新] 使用 spring 新特性 HttpServiceClient 替代 Dubbo 降低框架使用难度(半成本 数据权限不好使)"
This reverts commit b6d2274b
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.system;
|
||||
|
||||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||
@@ -9,6 +10,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableDubbo
|
||||
@SpringBootApplication
|
||||
public class RuoYiSystemApplication {
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.dromara.system.controller.system;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.service.DictService;
|
||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||
@@ -31,7 +32,8 @@ public class SysNoticeController extends BaseController {
|
||||
private final ISysNoticeService noticeService;
|
||||
private final DictService dictService;
|
||||
|
||||
private final RemoteMessageService remoteMessageService;
|
||||
@DubboReference
|
||||
private RemoteMessageService remoteMessageService;
|
||||
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.crypto.digest.BCrypt;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
@@ -45,7 +46,8 @@ public class SysProfileController extends BaseController {
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
private final RemoteFileService remoteFileService;
|
||||
@DubboReference
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package org.dromara.system.remote;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteClientService;
|
||||
import org.dromara.system.api.domain.vo.RemoteClientVo;
|
||||
import org.dromara.system.domain.vo.SysClientVo;
|
||||
import org.dromara.system.service.ISysClientService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 客户端服务
|
||||
@@ -14,7 +15,8 @@ import org.dromara.system.service.ISysClientService;
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteClientServiceImpl implements RemoteClientService {
|
||||
|
||||
private final ISysClientService sysClientService;
|
||||
|
||||
@@ -2,10 +2,11 @@ package org.dromara.system.remote;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.json.utils.JsonUtils;
|
||||
import org.dromara.system.api.RemoteConfigService;
|
||||
import org.dromara.system.service.ISysConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,7 +16,8 @@ import java.util.List;
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteConfigServiceImpl implements RemoteConfigService {
|
||||
|
||||
private final ISysConfigService configService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.constant.CacheNames;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.system.api.RemoteDataScopeService;
|
||||
@@ -13,6 +13,7 @@ import org.dromara.system.domain.SysRoleDept;
|
||||
import org.dromara.system.mapper.SysDeptMapper;
|
||||
import org.dromara.system.mapper.SysRoleDeptMapper;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,7 +26,8 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteDataScopeServiceImpl implements RemoteDataScopeService {
|
||||
|
||||
private final SysRoleDeptMapper roleDeptMapper;
|
||||
|
||||
@@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.system.api.RemoteDeptService;
|
||||
@@ -13,6 +13,7 @@ import org.dromara.system.domain.SysDept;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.mapper.SysDeptMapper;
|
||||
import org.dromara.system.service.ISysDeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -25,7 +26,8 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteDeptServiceImpl implements RemoteDeptService {
|
||||
|
||||
private final ISysDeptService deptService;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.system.remote;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteDictService;
|
||||
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
||||
@@ -9,6 +9,7 @@ import org.dromara.system.api.domain.vo.RemoteDictTypeVo;
|
||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||
import org.dromara.system.domain.vo.SysDictTypeVo;
|
||||
import org.dromara.system.service.ISysDictTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,7 +19,8 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteDictServiceImpl implements RemoteDictService {
|
||||
|
||||
private final ISysDictTypeService sysDictTypeService;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.system.remote;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteLogService;
|
||||
import org.dromara.system.api.domain.bo.RemoteLoginInfoBo;
|
||||
@@ -11,7 +11,7 @@ import org.dromara.system.domain.bo.SysOperLogBo;
|
||||
import org.dromara.system.service.ISysLoginInfoService;
|
||||
import org.dromara.system.service.ISysOperLogService;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
@@ -19,7 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteLogServiceImpl implements RemoteLogService {
|
||||
|
||||
private final ISysOperLogService operLogService;
|
||||
@@ -31,7 +32,6 @@ public class RemoteLogServiceImpl implements RemoteLogService {
|
||||
* @param remoteOperLogBo 日志实体
|
||||
*/
|
||||
@Async
|
||||
@PostMapping("/save-log")
|
||||
@Override
|
||||
public void saveLog(RemoteOperLogBo remoteOperLogBo) {
|
||||
SysOperLogBo sysOperLogBo = MapstructUtils.convert(remoteOperLogBo, SysOperLogBo.class);
|
||||
@@ -44,7 +44,6 @@ public class RemoteLogServiceImpl implements RemoteLogService {
|
||||
* @param remoteLoginInfoBo 访问实体
|
||||
*/
|
||||
@Async
|
||||
@PostMapping("/save-login-info")
|
||||
@Override
|
||||
public void saveLoginInfo(RemoteLoginInfoBo remoteLoginInfoBo) {
|
||||
SysLoginInfoBo sysLoginInfoBo = MapstructUtils.convert(remoteLoginInfoBo, SysLoginInfoBo.class);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.dromara.system.remote;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.system.api.RemotePermissionService;
|
||||
import org.dromara.system.service.ISysPermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@@ -13,7 +14,8 @@ import java.util.Set;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemotePermissionServiceImpl implements RemotePermissionService {
|
||||
|
||||
private final ISysPermissionService permissionService;
|
||||
|
||||
@@ -3,11 +3,12 @@ package org.dromara.system.remote;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.system.api.RemotePostService;
|
||||
import org.dromara.system.domain.SysPost;
|
||||
import org.dromara.system.mapper.SysPostMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -20,7 +21,8 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemotePostServiceImpl implements RemotePostService {
|
||||
|
||||
private final SysPostMapper postMapper;
|
||||
|
||||
@@ -3,11 +3,12 @@ package org.dromara.system.remote;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.system.api.RemoteRoleService;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -20,7 +21,8 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteRoleServiceImpl implements RemoteRoleService {
|
||||
|
||||
private final SysRoleMapper roleMapper;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.dromara.system.remote;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.system.api.RemoteSocialService;
|
||||
import org.dromara.system.api.domain.bo.RemoteSocialBo;
|
||||
@@ -9,6 +9,7 @@ import org.dromara.system.api.domain.vo.RemoteSocialVo;
|
||||
import org.dromara.system.domain.bo.SysSocialBo;
|
||||
import org.dromara.system.domain.vo.SysSocialVo;
|
||||
import org.dromara.system.service.ISysSocialService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,7 +19,8 @@ import java.util.List;
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteSocialServiceImpl implements RemoteSocialService {
|
||||
|
||||
private final ISysSocialService sysSocialService;
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.dromara.system.remote;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.PageResult;
|
||||
@@ -21,6 +21,7 @@ import org.dromara.system.service.ISysDeptService;
|
||||
import org.dromara.system.service.ISysPostService;
|
||||
import org.dromara.system.service.ISysRoleService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,7 +32,8 @@ import java.util.Map;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteTaskAssigneeServiceImpl implements RemoteTaskAssigneeService {
|
||||
|
||||
// 上级Service注入下级Service 其他Service永远不可能注入当前类 避免循环注入
|
||||
|
||||
@@ -6,7 +6,7 @@ import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.http.annotation.RemoteServiceController;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.constant.SystemConstants;
|
||||
import org.dromara.common.core.enums.UserStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
@@ -32,6 +32,7 @@ import org.dromara.system.mapper.SysUserMapper;
|
||||
import org.dromara.system.mapper.SysUserPostMapper;
|
||||
import org.dromara.system.mapper.SysUserRoleMapper;
|
||||
import org.dromara.system.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -41,7 +42,8 @@ import java.util.*;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RemoteServiceController
|
||||
@Service
|
||||
@DubboService
|
||||
public class RemoteUserServiceImpl implements RemoteUserService {
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
Reference in New Issue
Block a user