system改造
This commit is contained in:
parent
341404eafa
commit
db27985036
@ -2,20 +2,20 @@ package cn.iocoder.mall.security.admin.core.interceptor;
|
||||
|
||||
import cn.iocoder.common.framework.enums.UserTypeEnum;
|
||||
import cn.iocoder.common.framework.exception.GlobalException;
|
||||
import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.common.framework.util.CollectionUtils;
|
||||
import cn.iocoder.common.framework.util.HttpUtil;
|
||||
import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.security.admin.core.context.AdminSecurityContext;
|
||||
import cn.iocoder.mall.security.admin.core.context.AdminSecurityContextHolder;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuth2Rpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuthFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
import cn.iocoder.mall.web.core.util.CommonWebUtil;
|
||||
import cn.iocoder.security.annotations.RequiresNone;
|
||||
import cn.iocoder.security.annotations.RequiresPermissions;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
@ -28,11 +28,11 @@ import static cn.iocoder.mall.systemservice.enums.SystemErrorCodeConstants.OAUTH
|
||||
|
||||
public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.OAuth2Rpc.version}")
|
||||
private OAuth2Rpc oauth2Rpc;
|
||||
@Reference(version = "${dubbo.consumer.PermissionRpc.version}")
|
||||
private PermissionRpc permissionRpc;
|
||||
|
||||
@Autowired
|
||||
private OAuthFeign oAuthFeign;
|
||||
@Autowired
|
||||
private PermissionFeign permissionFeign;
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
// 获得访问令牌
|
||||
@ -48,7 +48,7 @@ public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
String accessToken = HttpUtil.obtainAuthorization(request);
|
||||
Integer adminId = null;
|
||||
if (accessToken != null) {
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessTokenResult = oauth2Rpc.checkAccessToken(accessToken);
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessTokenResult = oAuthFeign.checkAccessToken(accessToken);
|
||||
checkAccessTokenResult.checkError();
|
||||
// 校验用户类型正确
|
||||
if (!UserTypeEnum.ADMIN.getValue().equals(checkAccessTokenResult.getData().getUserType())) {
|
||||
@ -83,7 +83,7 @@ public class AdminSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
return;
|
||||
}
|
||||
// 权限验证
|
||||
permissionRpc.checkPermission(new PermissionCheckDTO().setAdminId(adminId).setPermissions(Arrays.asList(permissions)))
|
||||
permissionFeign.checkPermission(new PermissionCheckDTO().setAdminId(adminId).setPermissions(Arrays.asList(permissions)))
|
||||
.checkError();
|
||||
}
|
||||
|
||||
|
@ -6,12 +6,12 @@ import cn.iocoder.common.framework.util.HttpUtil;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.security.user.core.context.UserSecurityContext;
|
||||
import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuth2Rpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuthFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.web.core.util.CommonWebUtil;
|
||||
import cn.iocoder.security.annotations.RequiresAuthenticate;
|
||||
import cn.iocoder.security.annotations.RequiresPermissions;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
@ -23,8 +23,8 @@ import static cn.iocoder.mall.systemservice.enums.SystemErrorCodeConstants.OAUTH
|
||||
|
||||
public class UserSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.OAuth2Rpc.version}")
|
||||
private OAuth2Rpc oauth2Rpc;
|
||||
@Autowired
|
||||
private OAuthFeign oAuthFeign;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
@ -39,7 +39,7 @@ public class UserSecurityInterceptor extends HandlerInterceptorAdapter {
|
||||
String accessToken = HttpUtil.obtainAuthorization(request);
|
||||
Integer userId = null;
|
||||
if (accessToken != null) {
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessTokenResult = oauth2Rpc.checkAccessToken(accessToken);
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessTokenResult = oAuthFeign.checkAccessToken(accessToken);
|
||||
checkAccessTokenResult.checkError();
|
||||
// 校验用户类型正确
|
||||
if (!UserTypeEnum.USER.getValue().equals(checkAccessTokenResult.getData().getUserType())) {
|
||||
|
@ -3,11 +3,11 @@ package cn.iocoder.mall.system.errorcode.core;
|
||||
import cn.iocoder.common.framework.exception.ErrorCode;
|
||||
import cn.iocoder.common.framework.util.StringUtils;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeAutoGenerateDTO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@ -29,9 +29,9 @@ public class ErrorCodeAutoGenerator {
|
||||
*/
|
||||
private String errorCodeConstantsClass;
|
||||
|
||||
@Reference(version = "${dubbo.consumer.ErrorCodeRpc.version}")
|
||||
private ErrorCodeRpc errorCodeRpc;
|
||||
|
||||
@Autowired
|
||||
private ErrorCodeFeign errorCodeFeign;
|
||||
public ErrorCodeAutoGenerator(String group) {
|
||||
this.group = group;
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class ErrorCodeAutoGenerator {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
CommonResult<Boolean> autoGenerateErrorCodesResult = errorCodeRpc.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
CommonResult<Boolean> autoGenerateErrorCodesResult = errorCodeFeign.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
if (autoGenerateErrorCodesResult.isSuccess()) {
|
||||
logger.info("[execute][自动将 ({}) 类的错误码,成功写入到 system-service 服务]", errorCodeConstantsClass);
|
||||
} else {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package cn.iocoder.mall.system.errorcode.core;
|
||||
|
||||
import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.common.framework.util.CollectionUtils;
|
||||
import cn.iocoder.common.framework.util.DateUtil;
|
||||
import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
@ -27,9 +27,8 @@ public class ErrorCodeRemoteLoader {
|
||||
*/
|
||||
private final String group;
|
||||
|
||||
@Reference(version = "${dubbo.consumer.ErrorCodeRpc.version}")
|
||||
private ErrorCodeRpc errorCodeRpc;
|
||||
|
||||
@Autowired
|
||||
private ErrorCodeFeign errorCodeFeign;
|
||||
private Date maxUpdateTime;
|
||||
|
||||
public ErrorCodeRemoteLoader(String group) {
|
||||
@ -38,8 +37,8 @@ public class ErrorCodeRemoteLoader {
|
||||
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void loadErrorCodes() {
|
||||
// 从 ErrorCodeRpc 全量加载 ErrorCode 错误码
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodesResult = errorCodeRpc.listErrorCodes(group, null);
|
||||
// 从 errorCodeFeign 全量加载 ErrorCode 错误码
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodesResult = errorCodeFeign.listErrorCodes(group, null);
|
||||
listErrorCodesResult.checkError();
|
||||
logger.info("[loadErrorCodes][从 group({}) 全量加载到 {} 个 ErrorCode 错误码]", group, listErrorCodesResult.getData().size());
|
||||
// 写入到 ServiceExceptionUtil 到
|
||||
@ -52,9 +51,9 @@ public class ErrorCodeRemoteLoader {
|
||||
|
||||
@Scheduled(fixedDelay = REFRESH_ERROR_CODE_PERIOD, initialDelay = REFRESH_ERROR_CODE_PERIOD)
|
||||
public void refreshErrorCodes() {
|
||||
// 从 ErrorCodeRpc 增量加载 ErrorCode 错误码
|
||||
// 从 errorCodeFeign 增量加载 ErrorCode 错误码
|
||||
// TODO 优化点:假设删除错误码的配置,会存在问题;
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodesResult = errorCodeRpc.listErrorCodes(group, maxUpdateTime);
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodesResult = errorCodeFeign.listErrorCodes(group, maxUpdateTime);
|
||||
listErrorCodesResult.checkError();
|
||||
if (CollectionUtils.isEmpty(listErrorCodesResult.getData())) {
|
||||
return;
|
||||
|
@ -48,7 +48,7 @@ public class CommonWebAutoConfiguration implements WebMvcConfigurer {
|
||||
// ========== 拦截器相关 ==========
|
||||
|
||||
@Bean
|
||||
@ConditionalOnClass(name = {"cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogRpc", "org.apache.dubbo.config.annotation.Reference"})
|
||||
@ConditionalOnClass(name = {"cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogFeign", "org.apache.dubbo.config.annotation.Reference"})
|
||||
@ConditionalOnMissingBean(AccessLogInterceptor.class)
|
||||
public AccessLogInterceptor accessLogInterceptor() {
|
||||
return new AccessLogInterceptor();
|
||||
|
@ -7,14 +7,14 @@ import cn.iocoder.common.framework.util.ExceptionUtil;
|
||||
import cn.iocoder.common.framework.util.HttpUtil;
|
||||
import cn.iocoder.common.framework.util.MallUtils;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateDTO;
|
||||
import cn.iocoder.mall.web.core.util.CommonWebUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.util.Assert;
|
||||
@ -34,7 +34,8 @@ import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.ValidationException;
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.common.framework.exception.enums.GlobalErrorCodeConstants.*;
|
||||
import static cn.iocoder.common.framework.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
|
||||
import static cn.iocoder.common.framework.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
|
||||
/**
|
||||
* 全局异常处理器,将 Exception 翻译成 CommonResult + 对应的异常编号
|
||||
@ -55,9 +56,9 @@ public class GlobalExceptionHandler {
|
||||
private String applicationName;
|
||||
|
||||
// TODO 目前存在一个问题,如果未引入 system-rpc-api 依赖,GlobalExceptionHandler 会报类不存在。未来封装出 Repository 解决该问题
|
||||
@Reference(version = "${dubbo.consumer.SystemExceptionLogRpc.version}")
|
||||
private SystemExceptionLogRpc systemExceptionLogRpc;
|
||||
|
||||
@Autowired
|
||||
private SystemExceptionLogFeign systemExceptionLogFeign;
|
||||
/**
|
||||
* 处理 SpringMVC 请求参数缺失
|
||||
*
|
||||
@ -216,7 +217,7 @@ public class GlobalExceptionHandler {
|
||||
@Async
|
||||
public void createExceptionLog(SystemExceptionLogCreateDTO exceptionLog) {
|
||||
try {
|
||||
systemExceptionLogRpc.createSystemExceptionLog(exceptionLog);
|
||||
systemExceptionLogFeign.createSystemExceptionLog(exceptionLog);
|
||||
} catch (Throwable th) {
|
||||
logger.error("[addAccessLog][插入异常日志({}) 发生异常({})", JSON.toJSONString(exceptionLog), ExceptionUtils.getRootCauseMessage(th));
|
||||
}
|
||||
|
@ -3,14 +3,14 @@ package cn.iocoder.mall.web.core.interceptor;
|
||||
import cn.iocoder.common.framework.util.HttpUtil;
|
||||
import cn.iocoder.common.framework.util.MallUtils;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemAccessLogRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemAccessLogFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.web.core.util.CommonWebUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
@ -26,9 +26,9 @@ public class AccessLogInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Reference(version = "${dubbo.consumer.SystemAccessLogRpc.version}")
|
||||
private SystemAccessLogRpc systemAccessLogRpc;
|
||||
|
||||
@Autowired
|
||||
private SystemAccessLogFeign systemAccessLogFeign;
|
||||
@Value("${spring.application.name}")
|
||||
private String applicationName;
|
||||
|
||||
@ -81,7 +81,7 @@ public class AccessLogInterceptor extends HandlerInterceptorAdapter {
|
||||
@Async // 异步入库
|
||||
public void addAccessLog(SystemAccessLogCreateDTO accessLog) {
|
||||
try {
|
||||
systemAccessLogRpc.createSystemAccessLog(accessLog);
|
||||
systemAccessLogFeign.createSystemAccessLog(accessLog);
|
||||
} catch (Throwable th) {
|
||||
logger.error("[addAccessLog][插入访问日志({}) 发生异常({})", JSON.toJSONString(accessLog), ExceptionUtils.getRootCauseMessage(th));
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.productservice.rpc","cn.iocoder.mall.payservice.rpc"
|
||||
,"cn.iocoder.mall.promotion.api.rpc"})
|
||||
,"cn.iocoder.mall.promotion.api.rpc","cn.iocoder.mall.systemservice.rpc"})
|
||||
public class ManagementWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -10,13 +10,13 @@ import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateStatusDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.admin.vo.AdminPageItemVO;
|
||||
import cn.iocoder.mall.managementweb.controller.admin.vo.AdminVO;
|
||||
import cn.iocoder.mall.managementweb.convert.admin.AdminConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.DepartmentRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.DepartmentFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -27,18 +27,18 @@ import java.util.*;
|
||||
@Validated
|
||||
public class AdminManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.AdminRpc.version}")
|
||||
private AdminRpc adminRpc;
|
||||
@Reference(version = "${dubbo.consumer.RoleRpc.version}")
|
||||
private RoleRpc roleRpc;
|
||||
@Reference(version = "${dubbo.consumer.DepartmentRpc.version}")
|
||||
private DepartmentRpc departmentRpc;
|
||||
@Reference(version = "${dubbo.consumer.PermissionRpc.version}")
|
||||
private PermissionRpc permissionRpc;
|
||||
@Autowired
|
||||
private AdminFeign adminFeign;
|
||||
@Autowired
|
||||
private RoleFeign roleFeign;
|
||||
@Autowired
|
||||
private DepartmentFeign departmentFeign;
|
||||
@Autowired
|
||||
private PermissionFeign permissionFeign;
|
||||
|
||||
public PageResult<AdminPageItemVO> pageAdmin(AdminPageDTO pageDTO) {
|
||||
CommonResult<PageResult<cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO>> pageResult =
|
||||
adminRpc.pageAdmin(AdminConvert.INSTANCE.convert(pageDTO));
|
||||
adminFeign.pageAdmin(AdminConvert.INSTANCE.convert(pageDTO));
|
||||
pageResult.checkError();
|
||||
// 转换结果
|
||||
PageResult<AdminPageItemVO> adminPageVO = new PageResult<>();
|
||||
@ -50,7 +50,7 @@ public class AdminManager {
|
||||
Map<Integer, List<RoleVO>> adminRoleMap = this.listAdminRoles(CollectionUtils.convertList(pageResult.getData().getList(),
|
||||
cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO::getId));
|
||||
// 查询部门
|
||||
CommonResult<List<DepartmentVO>> listDepartmentsResult = departmentRpc.listDepartments(
|
||||
CommonResult<List<DepartmentVO>> listDepartmentsResult = departmentFeign.listDepartments(
|
||||
CollectionUtils.convertSet(pageResult.getData().getList(),
|
||||
cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO::getDepartmentId));
|
||||
listDepartmentsResult.checkError();
|
||||
@ -72,12 +72,12 @@ public class AdminManager {
|
||||
|
||||
private Map<Integer, List<RoleVO>> listAdminRoles(List<Integer> adminIds) {
|
||||
// 获得管理员拥有的角色
|
||||
CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIdsResult = permissionRpc.mapAdminRoleIds(adminIds);
|
||||
CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIdsResult = permissionFeign.mapAdminRoleIds(adminIds);
|
||||
mapAdminRoleIdsResult.checkError();
|
||||
// 获得角色列表
|
||||
Set<Integer> roleIds = new HashSet<>();
|
||||
mapAdminRoleIdsResult.getData().values().forEach(roleIds::addAll);
|
||||
CommonResult<List<RoleVO>> listRolesResult = roleRpc.listRoles(roleIds);
|
||||
CommonResult<List<RoleVO>> listRolesResult = roleFeign.listRoles(roleIds);
|
||||
listRolesResult.checkError();
|
||||
Map<Integer, RoleVO> roleVOMap = CollectionUtils.convertMap(listRolesResult.getData(), RoleVO::getId);
|
||||
// 拼接结果
|
||||
@ -96,24 +96,24 @@ public class AdminManager {
|
||||
}
|
||||
|
||||
public Integer createAdmin(AdminCreateDTO createDTO, Integer createAdminId, String createIp) {
|
||||
CommonResult<Integer> createAdminResult = adminRpc.createAdmin(AdminConvert.INSTANCE.convert(createDTO)
|
||||
CommonResult<Integer> createAdminResult = adminFeign.createAdmin(AdminConvert.INSTANCE.convert(createDTO)
|
||||
.setCreateAdminId(createAdminId).setCreateIp(createIp));
|
||||
createAdminResult.checkError();
|
||||
return createAdminResult.getData();
|
||||
}
|
||||
|
||||
public void updateAdmin(AdminUpdateInfoDTO updateInfoDTO) {
|
||||
CommonResult<Boolean> updateAdminResult = adminRpc.updateAdmin(AdminConvert.INSTANCE.convert(updateInfoDTO));
|
||||
CommonResult<Boolean> updateAdminResult = adminFeign.updateAdmin(AdminConvert.INSTANCE.convert(updateInfoDTO));
|
||||
updateAdminResult.checkError();
|
||||
}
|
||||
|
||||
public void updateAdminStatus(@Valid AdminUpdateStatusDTO updateStatusDTO) {
|
||||
CommonResult<Boolean> updateAdminResult = adminRpc.updateAdmin(AdminConvert.INSTANCE.convert(updateStatusDTO));
|
||||
CommonResult<Boolean> updateAdminResult = adminFeign.updateAdmin(AdminConvert.INSTANCE.convert(updateStatusDTO));
|
||||
updateAdminResult.checkError();
|
||||
}
|
||||
|
||||
public AdminVO getAdmin(Integer adminId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO> getAdminResult = adminRpc.getAdmin(adminId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO> getAdminResult = adminFeign.getAdmin(adminId);
|
||||
getAdminResult.checkError();
|
||||
return AdminConvert.INSTANCE.convert(getAdminResult.getData());
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ import cn.iocoder.mall.managementweb.controller.admin.vo.DepartmentTreeNodeVO;
|
||||
import cn.iocoder.mall.managementweb.controller.admin.vo.DepartmentVO;
|
||||
import cn.iocoder.mall.managementweb.convert.admin.DepartmentConvert;
|
||||
import cn.iocoder.mall.systemservice.enums.admin.DepartmentIdEnum;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.DepartmentRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.DepartmentFeign;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@ -22,9 +22,8 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class DepartmentManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.DepartmentRpc.version}")
|
||||
private DepartmentRpc departmentRpc;
|
||||
|
||||
@Autowired
|
||||
private DepartmentFeign departmentFeign;
|
||||
/**
|
||||
* 创建部门
|
||||
*
|
||||
@ -32,7 +31,7 @@ public class DepartmentManager {
|
||||
* @return 部门
|
||||
*/
|
||||
public Integer createDepartment(DepartmentCreateDTO createDTO) {
|
||||
CommonResult<Integer> createDepartmentResult = departmentRpc.createDepartment(DepartmentConvert.INSTANCE.convert(createDTO));
|
||||
CommonResult<Integer> createDepartmentResult = departmentFeign.createDepartment(DepartmentConvert.INSTANCE.convert(createDTO));
|
||||
createDepartmentResult.checkError();
|
||||
return createDepartmentResult.getData();
|
||||
}
|
||||
@ -43,7 +42,7 @@ public class DepartmentManager {
|
||||
* @param updateDTO 更新部门 DTO
|
||||
*/
|
||||
public void updateDepartment(DepartmentUpdateDTO updateDTO) {
|
||||
CommonResult<Boolean> updateDepartmentResult = departmentRpc.updateDepartment(DepartmentConvert.INSTANCE.convert(updateDTO));
|
||||
CommonResult<Boolean> updateDepartmentResult = departmentFeign.updateDepartment(DepartmentConvert.INSTANCE.convert(updateDTO));
|
||||
updateDepartmentResult.checkError();
|
||||
}
|
||||
|
||||
@ -53,7 +52,7 @@ public class DepartmentManager {
|
||||
* @param departmentId 部门编号
|
||||
*/
|
||||
public void deleteDepartment(Integer departmentId) {
|
||||
CommonResult<Boolean> deleteDepartmentResult = departmentRpc.deleteDepartment(departmentId);
|
||||
CommonResult<Boolean> deleteDepartmentResult = departmentFeign.deleteDepartment(departmentId);
|
||||
deleteDepartmentResult.checkError();
|
||||
}
|
||||
|
||||
@ -64,7 +63,7 @@ public class DepartmentManager {
|
||||
* @return 部门
|
||||
*/
|
||||
public DepartmentVO getDepartment(Integer departmentId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO> getDepartmentResult = departmentRpc.getDepartment(departmentId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO> getDepartmentResult = departmentFeign.getDepartment(departmentId);
|
||||
getDepartmentResult.checkError();
|
||||
return DepartmentConvert.INSTANCE.convert(getDepartmentResult.getData());
|
||||
}
|
||||
@ -76,7 +75,7 @@ public class DepartmentManager {
|
||||
* @return 部门列表
|
||||
*/
|
||||
public List<DepartmentVO> listDepartments(List<Integer> departmentIds) {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO>> listDepartmentResult = departmentRpc.listDepartments(departmentIds);
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO>> listDepartmentResult = departmentFeign.listDepartments(departmentIds);
|
||||
listDepartmentResult.checkError();
|
||||
return DepartmentConvert.INSTANCE.convertList(listDepartmentResult.getData());
|
||||
}
|
||||
@ -88,7 +87,7 @@ public class DepartmentManager {
|
||||
*/
|
||||
public List<DepartmentTreeNodeVO> treeDepartment() {
|
||||
// 获得资源全列表
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO>> listDepartmentResult = departmentRpc.listDepartments();
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO>> listDepartmentResult = departmentFeign.listDepartments();
|
||||
listDepartmentResult.checkError();
|
||||
// 构建菜单树
|
||||
return buildDepartmentTree(listDepartmentResult.getData());
|
||||
|
@ -6,8 +6,8 @@ import cn.iocoder.mall.managementweb.controller.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.datadict.vo.DataDictSimpleVO;
|
||||
import cn.iocoder.mall.managementweb.controller.datadict.vo.DataDictVO;
|
||||
import cn.iocoder.mall.managementweb.convert.datadict.DataDictConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.DataDictRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.DataDictFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Comparator;
|
||||
@ -23,9 +23,8 @@ public class DataDictManager {
|
||||
.comparing(cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO::getEnumValue)
|
||||
.thenComparingInt(cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO::getSort);
|
||||
|
||||
@Reference(version = "${dubbo.consumer.DataDictRpc.version}")
|
||||
private DataDictRpc dataDictRpc;
|
||||
|
||||
@Autowired
|
||||
private DataDictFeign dataDictFeign;
|
||||
/**
|
||||
* 创建数据字典
|
||||
*
|
||||
@ -33,7 +32,7 @@ public class DataDictManager {
|
||||
* @return 数据字典
|
||||
*/
|
||||
public Integer createDataDict(DataDictCreateDTO createDTO) {
|
||||
CommonResult<Integer> createDataDictResult = dataDictRpc.createDataDict(DataDictConvert.INSTANCE.convert(createDTO));
|
||||
CommonResult<Integer> createDataDictResult = dataDictFeign.createDataDict(DataDictConvert.INSTANCE.convert(createDTO));
|
||||
createDataDictResult.checkError();
|
||||
return createDataDictResult.getData();
|
||||
}
|
||||
@ -44,7 +43,7 @@ public class DataDictManager {
|
||||
* @param updateDTO 更新数据字典 DTO
|
||||
*/
|
||||
public void updateDataDict(DataDictUpdateDTO updateDTO) {
|
||||
CommonResult<Boolean> updateDataDictResult = dataDictRpc.updateDataDict(DataDictConvert.INSTANCE.convert(updateDTO));
|
||||
CommonResult<Boolean> updateDataDictResult = dataDictFeign.updateDataDict(DataDictConvert.INSTANCE.convert(updateDTO));
|
||||
updateDataDictResult.checkError();
|
||||
}
|
||||
|
||||
@ -54,7 +53,7 @@ public class DataDictManager {
|
||||
* @param dataDictId 数据字典编号
|
||||
*/
|
||||
public void deleteDataDict(Integer dataDictId) {
|
||||
CommonResult<Boolean> deleteDataDictResult = dataDictRpc.deleteDataDict(dataDictId);
|
||||
CommonResult<Boolean> deleteDataDictResult = dataDictFeign.deleteDataDict(dataDictId);
|
||||
deleteDataDictResult.checkError();
|
||||
}
|
||||
|
||||
@ -65,7 +64,7 @@ public class DataDictManager {
|
||||
* @return 数据字典
|
||||
*/
|
||||
public DataDictVO getDataDict(Integer dataDictId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO> getDataDictResult = dataDictRpc.getDataDict(dataDictId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO> getDataDictResult = dataDictFeign.getDataDict(dataDictId);
|
||||
getDataDictResult.checkError();
|
||||
return DataDictConvert.INSTANCE.convert(getDataDictResult.getData());
|
||||
}
|
||||
@ -77,7 +76,7 @@ public class DataDictManager {
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
public List<DataDictVO> listDataDicts(List<Integer> dataDictIds) {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictRpc.listDataDicts(dataDictIds);
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictFeign.listDataDicts(dataDictIds);
|
||||
listDataDictResult.checkError();
|
||||
return DataDictConvert.INSTANCE.convertList(listDataDictResult.getData());
|
||||
}
|
||||
@ -88,7 +87,7 @@ public class DataDictManager {
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
public List<DataDictVO> listDataDicts() {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictRpc.listDataDicts();
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictFeign.listDataDicts();
|
||||
listDataDictResult.checkError();
|
||||
// 按照 enumValue 和 sort 排序
|
||||
listDataDictResult.getData().sort(COMPARATOR_ENUM_VALUE_SORT);
|
||||
@ -103,7 +102,7 @@ public class DataDictManager {
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
public List<DataDictSimpleVO> listSimpleDataDicts() {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictRpc.listDataDicts();
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO>> listDataDictResult = dataDictFeign.listDataDicts();
|
||||
listDataDictResult.checkError();
|
||||
// 按照 enumValue 和 sort 排序
|
||||
listDataDictResult.getData().sort(COMPARATOR_ENUM_VALUE_SORT);
|
||||
|
@ -8,8 +8,8 @@ import cn.iocoder.mall.managementweb.controller.errorcode.dto.ErrorCodeUpdateDTO
|
||||
import cn.iocoder.mall.managementweb.controller.errorcode.vo.ErrorCodeVO;
|
||||
import cn.iocoder.mall.managementweb.convert.errorcode.ErrorCodeConvert;
|
||||
import cn.iocoder.mall.systemservice.enums.errorcode.ErrorCodeTypeEnum;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.ErrorCodeFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,9 +20,8 @@ import java.util.List;
|
||||
@Service
|
||||
public class ErrorCodeManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.ErrorCodeRpc.version}", validation = "false")
|
||||
private ErrorCodeRpc errorCodeRpc;
|
||||
|
||||
@Autowired
|
||||
private ErrorCodeFeign errorCodeFeign;
|
||||
/**
|
||||
* 创建错误码
|
||||
*
|
||||
@ -30,7 +29,7 @@ public class ErrorCodeManager {
|
||||
* @return 错误码
|
||||
*/
|
||||
public Integer createErrorCode(ErrorCodeCreateDTO createDTO) {
|
||||
CommonResult<Integer> createErrorCodeResult = errorCodeRpc.createErrorCode(ErrorCodeConvert.INSTANCE.convert(createDTO)
|
||||
CommonResult<Integer> createErrorCodeResult = errorCodeFeign.createErrorCode(ErrorCodeConvert.INSTANCE.convert(createDTO)
|
||||
.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType()));
|
||||
createErrorCodeResult.checkError();
|
||||
return createErrorCodeResult.getData();
|
||||
@ -42,7 +41,7 @@ public class ErrorCodeManager {
|
||||
* @param updateDTO 更新错误码 DTO
|
||||
*/
|
||||
public void updateErrorCode(ErrorCodeUpdateDTO updateDTO) {
|
||||
CommonResult<Boolean> updateErrorCodeResult = errorCodeRpc.updateErrorCode(ErrorCodeConvert.INSTANCE.convert(updateDTO)
|
||||
CommonResult<Boolean> updateErrorCodeResult = errorCodeFeign.updateErrorCode(ErrorCodeConvert.INSTANCE.convert(updateDTO)
|
||||
.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType()));
|
||||
updateErrorCodeResult.checkError();
|
||||
}
|
||||
@ -53,7 +52,7 @@ public class ErrorCodeManager {
|
||||
* @param errorCodeId 错误码编号
|
||||
*/
|
||||
public void deleteErrorCode(Integer errorCodeId) {
|
||||
CommonResult<Boolean> deleteErrorCodeResult = errorCodeRpc.deleteErrorCode(errorCodeId);
|
||||
CommonResult<Boolean> deleteErrorCodeResult = errorCodeFeign.deleteErrorCode(errorCodeId);
|
||||
deleteErrorCodeResult.checkError();
|
||||
}
|
||||
|
||||
@ -64,7 +63,7 @@ public class ErrorCodeManager {
|
||||
* @return 错误码
|
||||
*/
|
||||
public ErrorCodeVO getErrorCode(Integer errorCodeId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO> getErrorCodeResult = errorCodeRpc.getErrorCode(errorCodeId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO> getErrorCodeResult = errorCodeFeign.getErrorCode(errorCodeId);
|
||||
getErrorCodeResult.checkError();
|
||||
return ErrorCodeConvert.INSTANCE.convert(getErrorCodeResult.getData());
|
||||
}
|
||||
@ -76,7 +75,7 @@ public class ErrorCodeManager {
|
||||
* @return 错误码列表
|
||||
*/
|
||||
public List<ErrorCodeVO> listErrorCodes(List<Integer> errorCodeIds) {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO>> listErrorCodeResult = errorCodeRpc.listErrorCodes(errorCodeIds);
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO>> listErrorCodeResult = errorCodeFeign.listErrorCodes(errorCodeIds);
|
||||
listErrorCodeResult.checkError();
|
||||
return ErrorCodeConvert.INSTANCE.convertList(listErrorCodeResult.getData());
|
||||
}
|
||||
@ -89,7 +88,7 @@ public class ErrorCodeManager {
|
||||
*/
|
||||
public PageResult<ErrorCodeVO> pageErrorCode(ErrorCodePageDTO pageDTO) {
|
||||
CommonResult<PageResult<cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO>> pageErrorCodeResult
|
||||
= errorCodeRpc.pageErrorCode(ErrorCodeConvert.INSTANCE.convert(pageDTO));
|
||||
= errorCodeFeign.pageErrorCode(ErrorCodeConvert.INSTANCE.convert(pageDTO));
|
||||
pageErrorCodeResult.checkError();
|
||||
return ErrorCodeConvert.INSTANCE.convertPage(pageErrorCodeResult.getData());
|
||||
}
|
||||
|
@ -12,16 +12,16 @@ import cn.iocoder.mall.managementweb.convert.passport.AdminPassportConvert;
|
||||
import cn.iocoder.mall.managementweb.convert.permission.ResourceConvert;
|
||||
import cn.iocoder.mall.managementweb.manager.permission.ResourceManager;
|
||||
import cn.iocoder.mall.systemservice.enums.permission.ResourceTypeEnum;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuth2Rpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuthFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.ResourceRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.ResourceFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -31,22 +31,22 @@ import java.util.Set;
|
||||
@Service
|
||||
public class PassportManager {
|
||||
|
||||
@DubboReference(version = "${dubbo.consumer.AdminRpc.version}")
|
||||
private AdminRpc adminRpc;
|
||||
@DubboReference(version = "${dubbo.consumer.OAuth2Rpc.version}")
|
||||
private OAuth2Rpc oauth2Rpc;
|
||||
@DubboReference(version = "${dubbo.consumer.RoleRpc.version}")
|
||||
private RoleRpc roleRpc;
|
||||
@DubboReference(version = "${dubbo.consumer.ResourceRpc.version}")
|
||||
private ResourceRpc resourceRpc;
|
||||
|
||||
@Autowired
|
||||
private AdminFeign adminFeign;
|
||||
@Autowired
|
||||
private OAuthFeign oAuthFeign;
|
||||
@Autowired
|
||||
private RoleFeign roleFeign;
|
||||
@Autowired
|
||||
private ResourceFeign resourceFeign;
|
||||
public PassportAccessTokenVO login(PassportLoginDTO loginDTO, String ip) {
|
||||
// 校验管理员密码
|
||||
// CommonResult<AdminVO> verifyPasswordResult = adminRpc.verifyPassword(AdminPassportConvert.INSTANCE.convert(loginDTO).setIp(ip));
|
||||
CommonResult<AdminVO> verifyPasswordResult = adminRpc.verifyPassword(AdminPassportConvert.INSTANCE.convert(loginDTO).setIp(ip));
|
||||
// CommonResult<AdminVO> verifyPasswordResult = adminFeign.verifyPassword(AdminPassportConvert.INSTANCE.convert(loginDTO).setIp(ip));
|
||||
CommonResult<AdminVO> verifyPasswordResult = adminFeign.verifyPassword(AdminPassportConvert.INSTANCE.convert(loginDTO).setIp(ip));
|
||||
verifyPasswordResult.checkError();
|
||||
// 创建访问令牌
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessTokenResult = oauth2Rpc.createAccessToken(
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessTokenResult = oAuthFeign.createAccessToken(
|
||||
new OAuth2CreateAccessTokenReqDTO().setUserId(verifyPasswordResult.getData().getId())
|
||||
.setUserType(UserTypeEnum.ADMIN.getValue()).setCreateIp(ip));
|
||||
createAccessTokenResult.checkError();
|
||||
@ -55,13 +55,13 @@ public class PassportManager {
|
||||
}
|
||||
|
||||
public PassportAdminVO getAdmin(Integer adminId) {
|
||||
CommonResult<AdminVO> getAdminResult = adminRpc.getAdmin(adminId);
|
||||
CommonResult<AdminVO> getAdminResult = adminFeign.getAdmin(adminId);
|
||||
getAdminResult.checkError();
|
||||
return AdminPassportConvert.INSTANCE.convert(getAdminResult.getData());
|
||||
}
|
||||
|
||||
public PassportAccessTokenVO refreshToken(String refreshToken, String ip) {
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessTokenResult = oauth2Rpc.refreshAccessToken(
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessTokenResult = oAuthFeign.refreshAccessToken(
|
||||
new OAuth2RefreshAccessTokenReqDTO().setRefreshToken(refreshToken).setCreateIp(ip));
|
||||
refreshAccessTokenResult.checkError();
|
||||
return AdminPassportConvert.INSTANCE.convert(refreshAccessTokenResult.getData());
|
||||
@ -75,13 +75,13 @@ public class PassportManager {
|
||||
*/
|
||||
public Set<String> listAdminPermission(Integer adminId) {
|
||||
// 获得管理员拥有的角色编号列表
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = roleRpc.listAdminRoleIds(adminId);
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = roleFeign.listAdminRoleIds(adminId);
|
||||
listAdminRoleIdsResult.checkError();
|
||||
if (CollectionUtils.isEmpty(listAdminRoleIdsResult.getData())) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
// 获得角色拥有的资源列表
|
||||
CommonResult<List<ResourceVO>> resourceVOResult = resourceRpc.listRoleResource(
|
||||
CommonResult<List<ResourceVO>> resourceVOResult = resourceFeign.listRoleResource(
|
||||
listAdminRoleIdsResult.getData(), null);
|
||||
resourceVOResult.checkError();
|
||||
return CollectionUtils.convertSet(resourceVOResult.getData(), cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO::getPermission);
|
||||
@ -95,13 +95,13 @@ public class PassportManager {
|
||||
*/
|
||||
public List<PassportAdminMenuTreeNodeVO> treeAdminMenu(Integer adminId) {
|
||||
// 获得管理员拥有的角色编号列表
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = roleRpc.listAdminRoleIds(adminId);
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = roleFeign.listAdminRoleIds(adminId);
|
||||
listAdminRoleIdsResult.checkError();
|
||||
if (CollectionUtils.isEmpty(listAdminRoleIdsResult.getData())) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 获得角色拥有的资源(菜单)列表
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> resourceVOResult = resourceRpc.listRoleResource(
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> resourceVOResult = resourceFeign.listRoleResource(
|
||||
listAdminRoleIdsResult.getData(), ResourceTypeEnum.MENU.getType());
|
||||
resourceVOResult.checkError();
|
||||
// 构建菜单树
|
||||
|
@ -4,8 +4,8 @@ import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.managementweb.controller.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.managementweb.convert.permission.PermissionConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.PermissionFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Set;
|
||||
@ -16,9 +16,9 @@ import java.util.Set;
|
||||
@Service
|
||||
public class PermissionManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.PermissionRpc.version}")
|
||||
private PermissionRpc permissionRpc;
|
||||
|
||||
@Autowired
|
||||
private PermissionFeign permissionFeign;
|
||||
/**
|
||||
* 获得角色拥有的资源编号列表
|
||||
*
|
||||
@ -26,7 +26,7 @@ public class PermissionManager {
|
||||
* @return 资源编号列表
|
||||
*/
|
||||
public Set<Integer> listRoleResources(Integer roleId) {
|
||||
CommonResult<Set<Integer>> listRoleResourceIdsResult = permissionRpc.listRoleResourceIds(roleId);
|
||||
CommonResult<Set<Integer>> listRoleResourceIdsResult = permissionFeign.listRoleResourceIds(roleId);
|
||||
listRoleResourceIdsResult.checkError();
|
||||
return listRoleResourceIdsResult.getData();
|
||||
}
|
||||
@ -37,7 +37,7 @@ public class PermissionManager {
|
||||
* @param assignRoleResourceDTO 赋予角色资源 DTO
|
||||
*/
|
||||
public void assignRoleResource(PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
CommonResult<Boolean> assignRoleResourceResult = permissionRpc.assignRoleResource(
|
||||
CommonResult<Boolean> assignRoleResourceResult = permissionFeign.assignRoleResource(
|
||||
PermissionConvert.INSTANCE.convert(assignRoleResourceDTO));
|
||||
assignRoleResourceResult.checkError();
|
||||
}
|
||||
@ -48,7 +48,7 @@ public class PermissionManager {
|
||||
* @param assignAdminRoleDTO 赋予用户角色 DTO
|
||||
*/
|
||||
public void assignAdminRole(PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
CommonResult<Boolean> assignAdminRoleResult = permissionRpc.assignAdminRole(
|
||||
CommonResult<Boolean> assignAdminRoleResult = permissionFeign.assignAdminRole(
|
||||
PermissionConvert.INSTANCE.convert(assignAdminRoleDTO));
|
||||
assignAdminRoleResult.checkError();
|
||||
}
|
||||
@ -60,7 +60,7 @@ public class PermissionManager {
|
||||
* @return 角色编号列表
|
||||
*/
|
||||
public Set<Integer> listAdminRoles(Integer adminId) {
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = permissionRpc.listAdminRoleIds(adminId);
|
||||
CommonResult<Set<Integer>> listAdminRoleIdsResult = permissionFeign.listAdminRoleIds(adminId);
|
||||
listAdminRoleIdsResult.checkError();
|
||||
return listAdminRoleIdsResult.getData();
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ import cn.iocoder.mall.managementweb.controller.permission.vo.ResourceTreeNodeVO
|
||||
import cn.iocoder.mall.managementweb.controller.permission.vo.ResourceVO;
|
||||
import cn.iocoder.mall.managementweb.convert.permission.ResourceConvert;
|
||||
import cn.iocoder.mall.systemservice.enums.permission.ResourceIdEnum;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.ResourceRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.ResourceFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleFeign;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@ -23,11 +23,11 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class ResourceManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.ResourceRpc.version}")
|
||||
private ResourceRpc resourceRpc;
|
||||
@Reference(version = "${dubbo.consumer.RoleRpc.version}")
|
||||
private RoleRpc roleRpc;
|
||||
|
||||
@Autowired
|
||||
private ResourceFeign resourceFeign;
|
||||
@Autowired
|
||||
private RoleFeign roleFeign;
|
||||
/**
|
||||
* 创建资源
|
||||
*
|
||||
@ -35,7 +35,7 @@ public class ResourceManager {
|
||||
* @return 资源
|
||||
*/
|
||||
public Integer createResource(ResourceCreateDTO createDTO, Integer createAdminId) {
|
||||
CommonResult<Integer> createResourceResult = resourceRpc.createResource(ResourceConvert.INSTANCE.convert(createDTO)
|
||||
CommonResult<Integer> createResourceResult = resourceFeign.createResource(ResourceConvert.INSTANCE.convert(createDTO)
|
||||
.setCreateAdminId(createAdminId));
|
||||
createResourceResult.checkError();
|
||||
return createResourceResult.getData();
|
||||
@ -47,7 +47,7 @@ public class ResourceManager {
|
||||
* @param updateDTO 更新资源 DTO
|
||||
*/
|
||||
public void updateResource(ResourceUpdateDTO updateDTO) {
|
||||
CommonResult<Boolean> updateResourceResult = resourceRpc.updateResource(ResourceConvert.INSTANCE.convert(updateDTO));
|
||||
CommonResult<Boolean> updateResourceResult = resourceFeign.updateResource(ResourceConvert.INSTANCE.convert(updateDTO));
|
||||
updateResourceResult.checkError();
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class ResourceManager {
|
||||
* @param resourceId 资源编号
|
||||
*/
|
||||
public void deleteResource(Integer resourceId) {
|
||||
CommonResult<Boolean> deleteResourceResult = resourceRpc.deleteResource(resourceId);
|
||||
CommonResult<Boolean> deleteResourceResult = resourceFeign.deleteResource(resourceId);
|
||||
deleteResourceResult.checkError();
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public class ResourceManager {
|
||||
* @return 资源
|
||||
*/
|
||||
public ResourceVO getResource(Integer resourceId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO> getResourceResult = resourceRpc.getResource(resourceId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO> getResourceResult = resourceFeign.getResource(resourceId);
|
||||
getResourceResult.checkError();
|
||||
return ResourceConvert.INSTANCE.convert(getResourceResult.getData());
|
||||
}
|
||||
@ -80,7 +80,7 @@ public class ResourceManager {
|
||||
* @return 资源列表
|
||||
*/
|
||||
public List<ResourceVO> listResources(List<Integer> resourceIds) {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> listResourceResult = resourceRpc.listResource(resourceIds);
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> listResourceResult = resourceFeign.listResource(resourceIds);
|
||||
return ResourceConvert.INSTANCE.convertList(listResourceResult.getData());
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class ResourceManager {
|
||||
*/
|
||||
public List<ResourceTreeNodeVO> treeResource() {
|
||||
// 获得资源全列表
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> listResourceResult = resourceRpc.listResource();
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO>> listResourceResult = resourceFeign.listResource();
|
||||
listResourceResult.checkError();
|
||||
// 构建菜单树
|
||||
return buildResourceTree(listResourceResult.getData());
|
||||
|
@ -7,8 +7,8 @@ import cn.iocoder.mall.managementweb.controller.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.permission.vo.RoleVO;
|
||||
import cn.iocoder.mall.managementweb.convert.permission.RoleConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.RoleFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -19,9 +19,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class RoleManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.RoleRpc.version}")
|
||||
private RoleRpc roleRpc;
|
||||
|
||||
@Autowired
|
||||
private RoleFeign roleFeign;
|
||||
/**
|
||||
* 创建角色
|
||||
*
|
||||
@ -29,7 +29,7 @@ public class RoleManager {
|
||||
* @return 角色
|
||||
*/
|
||||
public Integer createRole(RoleCreateDTO createDTO, Integer createAdminId) {
|
||||
CommonResult<Integer> createRoleResult = roleRpc.createRole(RoleConvert.INSTANCE.convert(createDTO).setCreateAdminId(createAdminId));
|
||||
CommonResult<Integer> createRoleResult = roleFeign.createRole(RoleConvert.INSTANCE.convert(createDTO).setCreateAdminId(createAdminId));
|
||||
createRoleResult.checkError();
|
||||
return createRoleResult.getData();
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class RoleManager {
|
||||
* @param updateDTO 更新角色 DTO
|
||||
*/
|
||||
public void updateRole(RoleUpdateDTO updateDTO) {
|
||||
CommonResult<Boolean> updateRoleResult = roleRpc.updateRole(RoleConvert.INSTANCE.convert(updateDTO));
|
||||
CommonResult<Boolean> updateRoleResult = roleFeign.updateRole(RoleConvert.INSTANCE.convert(updateDTO));
|
||||
updateRoleResult.checkError();
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class RoleManager {
|
||||
* @param roleId 角色编号
|
||||
*/
|
||||
public void deleteRole(Integer roleId) {
|
||||
CommonResult<Boolean> deleteRoleResult = roleRpc.deleteRole(roleId);
|
||||
CommonResult<Boolean> deleteRoleResult = roleFeign.deleteRole(roleId);
|
||||
deleteRoleResult.checkError();
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ public class RoleManager {
|
||||
* @return 角色
|
||||
*/
|
||||
public RoleVO getRole(Integer roleId) {
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO> getRoleResult = roleRpc.getRole(roleId);
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO> getRoleResult = roleFeign.getRole(roleId);
|
||||
getRoleResult.checkError();
|
||||
return RoleConvert.INSTANCE.convert(getRoleResult.getData());
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class RoleManager {
|
||||
* @return 角色列表
|
||||
*/
|
||||
public List<RoleVO> listAllRoles() {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO>> listRoleResult = roleRpc.listAllRoles();
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO>> listRoleResult = roleFeign.listAllRoles();
|
||||
listRoleResult.checkError();
|
||||
return RoleConvert.INSTANCE.convertList(listRoleResult.getData());
|
||||
}
|
||||
@ -84,7 +84,7 @@ public class RoleManager {
|
||||
* @return 角色列表
|
||||
*/
|
||||
public List<RoleVO> listRoles(List<Integer> roleIds) {
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO>> listRoleResult = roleRpc.listRoles(roleIds);
|
||||
CommonResult<List<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO>> listRoleResult = roleFeign.listRoles(roleIds);
|
||||
listRoleResult.checkError();
|
||||
return RoleConvert.INSTANCE.convertList(listRoleResult.getData());
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class RoleManager {
|
||||
*/
|
||||
public PageResult<RoleVO> pageRole(RolePageDTO pageDTO) {
|
||||
CommonResult<PageResult<cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO>> pageRoleResult =
|
||||
roleRpc.pageRole(RoleConvert.INSTANCE.convert(pageDTO));
|
||||
roleFeign.pageRole(RoleConvert.INSTANCE.convert(pageDTO));
|
||||
pageRoleResult.checkError();
|
||||
return RoleConvert.INSTANCE.convertPage(pageRoleResult.getData());
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.dto.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.vo.SystemAccessLogVO;
|
||||
import cn.iocoder.mall.managementweb.convert.systemlog.SystemAccessLogConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemAccessLogRpc;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemAccessLogFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -15,9 +15,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SystemAccessLogManager {
|
||||
|
||||
@DubboReference(version = "${dubbo.consumer.SystemAccessLogRpc.version}")
|
||||
private SystemAccessLogRpc systemAccessLogRpc;
|
||||
|
||||
@Autowired
|
||||
private SystemAccessLogFeign systemAccessLogFeign;
|
||||
/**
|
||||
* 获得系统访问日志分页
|
||||
*
|
||||
@ -26,7 +25,7 @@ public class SystemAccessLogManager {
|
||||
*/
|
||||
public PageResult<SystemAccessLogVO> pageSystemAccessLog(SystemAccessLogPageDTO pageDTO) {
|
||||
CommonResult<PageResult<cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO>> pageSystemAccessLogResult =
|
||||
systemAccessLogRpc.pageSystemAccessLog(SystemAccessLogConvert.INSTANCE.convert(pageDTO));
|
||||
systemAccessLogFeign.pageSystemAccessLog(SystemAccessLogConvert.INSTANCE.convert(pageDTO));
|
||||
pageSystemAccessLogResult.checkError();
|
||||
return SystemAccessLogConvert.INSTANCE.convertPage(pageSystemAccessLogResult.getData());
|
||||
}
|
||||
|
@ -7,22 +7,23 @@ import cn.iocoder.mall.managementweb.controller.systemlog.dto.SystemExceptionLog
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.vo.SystemExceptionLogDetailVO;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.vo.SystemExceptionLogVO;
|
||||
import cn.iocoder.mall.managementweb.convert.systemlog.SystemExceptionLogConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogFeign;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 系统异常日志 Manager
|
||||
*/
|
||||
@Service
|
||||
public class SystemExceptionLogManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.SystemExceptionLogRpc.version}")
|
||||
private SystemExceptionLogRpc systemExceptionLogRpc;
|
||||
@Reference(version = "${dubbo.consumer.AdminRpc.version}")
|
||||
private AdminRpc adminRpc;
|
||||
@Autowired
|
||||
private AdminFeign adminFeign;
|
||||
@Autowired
|
||||
private SystemExceptionLogFeign systemExceptionLogFeign;
|
||||
|
||||
/**
|
||||
* 获得系统异常日志
|
||||
@ -33,12 +34,12 @@ public class SystemExceptionLogManager {
|
||||
public SystemExceptionLogDetailVO getSystemExceptionLogDetail(Integer systemExceptionLogId) {
|
||||
// 获得系统异常明细
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO> getSystemExceptionLogResult
|
||||
= systemExceptionLogRpc.getSystemExceptionLog(systemExceptionLogId);
|
||||
= systemExceptionLogFeign.getSystemExceptionLog(systemExceptionLogId);
|
||||
getSystemExceptionLogResult.checkError();
|
||||
SystemExceptionLogDetailVO logDetailVO = SystemExceptionLogConvert.INSTANCE.convert(getSystemExceptionLogResult.getData());
|
||||
// 拼接处理管理员信息
|
||||
if (getSystemExceptionLogResult.getData().getProcessAdminId() != null) {
|
||||
CommonResult<AdminVO> adminVOResult = adminRpc.getAdmin(getSystemExceptionLogResult.getData().getProcessAdminId());
|
||||
CommonResult<AdminVO> adminVOResult = adminFeign.getAdmin(getSystemExceptionLogResult.getData().getProcessAdminId());
|
||||
adminVOResult.checkError();
|
||||
if (adminVOResult.getData() != null) {
|
||||
SystemExceptionLogDetailVO.Admin admin = SystemExceptionLogConvert.INSTANCE.convert(adminVOResult.getData());
|
||||
@ -56,7 +57,7 @@ public class SystemExceptionLogManager {
|
||||
*/
|
||||
public PageResult<SystemExceptionLogVO> pageSystemExceptionLog(SystemExceptionLogPageDTO pageDTO) {
|
||||
CommonResult<PageResult<cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO>> pageSystemExceptionLogResult
|
||||
= systemExceptionLogRpc.pageSystemExceptionLog(SystemExceptionLogConvert.INSTANCE.convert(pageDTO));
|
||||
= systemExceptionLogFeign.pageSystemExceptionLog(SystemExceptionLogConvert.INSTANCE.convert(pageDTO));
|
||||
pageSystemExceptionLogResult.checkError();
|
||||
return SystemExceptionLogConvert.INSTANCE.convertPage(pageSystemExceptionLogResult.getData());
|
||||
}
|
||||
@ -68,7 +69,7 @@ public class SystemExceptionLogManager {
|
||||
* @param processDTO 处理系统异常日志 DTO
|
||||
*/
|
||||
public void processSystemExceptionLog(Integer processAdminId, SystemExceptionLogProcessDTO processDTO) {
|
||||
CommonResult<Boolean> processSystemExceptionLogResult = systemExceptionLogRpc.processSystemExceptionLog(
|
||||
CommonResult<Boolean> processSystemExceptionLogResult = systemExceptionLogFeign.processSystemExceptionLog(
|
||||
SystemExceptionLogConvert.INSTANCE.convert(processDTO).setProcessAdminId(processAdminId));
|
||||
processSystemExceptionLogResult.checkError();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package controller;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
@ -8,7 +8,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.productservice.rpc","cn.iocoder.mall.searchservice.rpc",
|
||||
"cn.iocoder.mall.tradeservice.rpc","cn.iocoder.mall.payservice.rpc","cn.iocoder.mall.promotion.api.rpc"})
|
||||
"cn.iocoder.mall.tradeservice.rpc","cn.iocoder.mall.payservice.rpc","cn.iocoder.mall.promotion.api.rpc",
|
||||
"cn.iocoder.mall.systemservice.rpc"})
|
||||
public class ShopWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -6,7 +6,7 @@ import cn.iocoder.mall.shopweb.controller.user.vo.passport.PassportAccessTokenRe
|
||||
import cn.iocoder.mall.shopweb.controller.user.vo.passport.PassportLoginBySmsReqVO;
|
||||
import cn.iocoder.mall.shopweb.controller.user.vo.passport.PassportSendSmsRespVO;
|
||||
import cn.iocoder.mall.shopweb.convert.user.PassportConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuth2Rpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuthFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
@ -15,6 +15,7 @@ import cn.iocoder.mall.userservice.rpc.sms.UserSmsCodeRpc;
|
||||
import cn.iocoder.mall.userservice.rpc.user.UserRpc;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserRespDTO;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -24,8 +25,9 @@ public class PassportManager {
|
||||
private UserSmsCodeRpc userSmsCodeRpc;
|
||||
@DubboReference(version = "${dubbo.consumer.UserRpc.version}", validation = "false")
|
||||
private UserRpc userRpc;
|
||||
@DubboReference(version = "${dubbo.consumer.OAuth2Rpc.version}", validation = "false")
|
||||
private OAuth2Rpc oauth2Rpc;
|
||||
|
||||
@Autowired
|
||||
private OAuthFeign oAuthFeign;
|
||||
|
||||
public PassportAccessTokenRespVO loginBySms(PassportLoginBySmsReqVO loginBySmsDTO, String ip) {
|
||||
// 校验验证码
|
||||
@ -37,7 +39,7 @@ public class PassportManager {
|
||||
PassportConvert.INSTANCE.convert02(loginBySmsDTO).setIp(ip));
|
||||
createUserResult.checkError();
|
||||
// 创建访问令牌
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessTokenResult = oauth2Rpc.createAccessToken(
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessTokenResult = oAuthFeign.createAccessToken(
|
||||
new OAuth2CreateAccessTokenReqDTO().setUserId(createUserResult.getData().getId())
|
||||
.setUserType(UserTypeEnum.USER.getValue()).setCreateIp(ip));
|
||||
createAccessTokenResult.checkError();
|
||||
@ -52,7 +54,7 @@ public class PassportManager {
|
||||
}
|
||||
|
||||
public PassportAccessTokenRespVO refreshToken(String refreshToken, String ip) {
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessTokenResult = oauth2Rpc.refreshAccessToken(
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessTokenResult = oAuthFeign.refreshAccessToken(
|
||||
new OAuth2RefreshAccessTokenReqDTO().setRefreshToken(refreshToken).setCreateIp(ip));
|
||||
refreshAccessTokenResult.checkError();
|
||||
return PassportConvert.INSTANCE.convert(refreshAccessTokenResult.getData());
|
||||
|
@ -31,6 +31,10 @@
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface AdminFeign {
|
||||
@PostMapping("/system/admin/verifyPassword")
|
||||
public CommonResult<AdminVO> verifyPassword(@RequestBody AdminVerifyPasswordDTO verifyPasswordDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/createAdmin")
|
||||
public CommonResult<Integer> createAdmin(@RequestBody AdminCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/updateAdmin")
|
||||
public CommonResult<Boolean> updateAdmin(@RequestBody AdminUpdateDTO updateDTO) ;
|
||||
|
||||
@PostMapping("/system/admin/pageAdmin")
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(@RequestBody AdminPageDTO pageDTO);
|
||||
|
||||
@GetMapping("/system/admin/getAdmin")
|
||||
public CommonResult<AdminVO> getAdmin(@RequestParam("adminId") Integer adminId) ;
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
|
||||
/**
|
||||
* 管理员 RPC 接口
|
||||
*/
|
||||
public interface AdminRpc {
|
||||
|
||||
CommonResult<AdminVO> verifyPassword(AdminVerifyPasswordDTO verifyPasswordDTO);
|
||||
|
||||
CommonResult<Integer> createAdmin(AdminCreateDTO createDTO);
|
||||
|
||||
CommonResult<Boolean> updateAdmin(AdminUpdateDTO updateDTO);
|
||||
|
||||
CommonResult<PageResult<AdminVO>> pageAdmin(AdminPageDTO pageDTO);
|
||||
|
||||
CommonResult<AdminVO> getAdmin(Integer adminId);
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface DepartmentFeign {
|
||||
@PostMapping("/system/department/createDepartment")
|
||||
public CommonResult<Integer> createDepartment(@RequestBody DepartmentCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/department/updateDepartment")
|
||||
public CommonResult<Boolean> updateDepartment(@RequestBody DepartmentUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/department/deleteDepartment")
|
||||
public CommonResult<Boolean> deleteDepartment(@RequestParam("departmentId")Integer departmentId);
|
||||
|
||||
@GetMapping("/system/department/getDepartment")
|
||||
public CommonResult<DepartmentVO> getDepartment(@RequestParam("departmentId") Integer departmentId) ;
|
||||
|
||||
@GetMapping("/system/department/listDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(@RequestParam("departmentIds")Collection<Integer> departmentIds) ;
|
||||
|
||||
@GetMapping("/system/department/listAllDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments();
|
||||
|
||||
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
public interface DepartmentRpc {
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*
|
||||
* @param createDTO 创建部门 DTO
|
||||
* @return 部门编号
|
||||
*/
|
||||
CommonResult<Integer> createDepartment(DepartmentCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
*
|
||||
* @param updateDTO 更新部门 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateDepartment(DepartmentUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*
|
||||
* @param departmentId 部门编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteDepartment(Integer departmentId);
|
||||
|
||||
/**
|
||||
* 获得部门
|
||||
*
|
||||
* @param departmentId 部门编号
|
||||
* @return 部门
|
||||
*/
|
||||
CommonResult<DepartmentVO> getDepartment(Integer departmentId);
|
||||
|
||||
/**
|
||||
* 获得部门列表
|
||||
*
|
||||
* @param departmentIds 部门编号列表
|
||||
* @return 部门列表
|
||||
*/
|
||||
CommonResult<List<DepartmentVO>> listDepartments(Collection<Integer> departmentIds);
|
||||
|
||||
/**
|
||||
* 获得部门全列表
|
||||
*
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<DepartmentVO>> listDepartments();
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface DataDictFeign {
|
||||
@PostMapping("/system/datadict/createDataDict")
|
||||
public CommonResult<Integer> createDataDict(@RequestBody DataDictCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/datadict/updateDataDict")
|
||||
public CommonResult<Boolean> updateDataDict(@RequestBody DataDictUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/datadict/deleteDataDict")
|
||||
public CommonResult<Boolean> deleteDataDict(@RequestParam("dataDictId") Integer dataDictId);
|
||||
|
||||
@GetMapping("/system/datadict/getDataDict")
|
||||
public CommonResult<DataDictVO> getDataDict(@RequestParam("dataDictId") Integer dataDictId);
|
||||
|
||||
@GetMapping("/system/datadict/listAllDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts() ;
|
||||
|
||||
@GetMapping("/system/datadict/listDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(@RequestParam("dataDictIds") List<Integer> dataDictIds);
|
||||
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据字典 Rpc 接口
|
||||
*/
|
||||
public interface DataDictRpc {
|
||||
|
||||
/**
|
||||
* 创建数据字典
|
||||
*
|
||||
* @param createDTO 创建数据字典 DTO
|
||||
* @return 数据字典编号
|
||||
*/
|
||||
CommonResult<Integer> createDataDict(DataDictCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新数据字典
|
||||
*
|
||||
* @param updateDTO 更新数据字典 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateDataDict(DataDictUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除数据字典
|
||||
*
|
||||
* @param dataDictId 数据字典编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteDataDict(Integer dataDictId);
|
||||
|
||||
/**
|
||||
* 获得数据字典
|
||||
*
|
||||
* @param dataDictId 数据字典编号
|
||||
* @return 数据字典
|
||||
*/
|
||||
CommonResult<DataDictVO> getDataDict(Integer dataDictId);
|
||||
|
||||
/**
|
||||
* 获得全部数据字典
|
||||
*
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
CommonResult<List<DataDictVO>> listDataDicts();
|
||||
|
||||
/**
|
||||
* 获得数据字典列表
|
||||
*
|
||||
* @param dataDictIds 数据字典编号列表
|
||||
* @return 数据字典列表
|
||||
*/
|
||||
CommonResult<List<DataDictVO>> listDataDicts(List<Integer> dataDictIds);
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeAutoGenerateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface ErrorCodeFeign {
|
||||
|
||||
@GetMapping("/system/errorcode/listErrorCodes")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("group") String group, @RequestParam("minUpdateTime") Date minUpdateTime) ;
|
||||
|
||||
@PostMapping("/system/errorcode/autoGenerateErrorCodes")
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(@RequestBody List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs);
|
||||
|
||||
@PostMapping("/system/errorcode/createErrorCode")
|
||||
public CommonResult<Integer> createErrorCode(@RequestBody ErrorCodeCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/errorcode/updateErrorCode")
|
||||
public CommonResult<Boolean> updateErrorCode(@RequestBody ErrorCodeUpdateDTO updateDTO) ;
|
||||
|
||||
@GetMapping("/system/errorcode/deleteErrorCode")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) ;
|
||||
|
||||
@GetMapping("/system/errorcode/getErrorCode")
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) ;
|
||||
|
||||
@GetMapping("/system/errorcode/listErrorCodesByIds")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("errorCodeIds")List<Integer> errorCodeIds) ;
|
||||
|
||||
@PostMapping("/system/errorcode/pageErrorCode")
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(@RequestBody ErrorCodePageDTO pageDTO);
|
||||
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeAutoGenerateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface ErrorCodeRpc {
|
||||
|
||||
/**
|
||||
* 获得指定分组下的错误码列表
|
||||
*
|
||||
* @param group 错误码分组
|
||||
* @param minUpdateTime 最小更新时间,允许为空。
|
||||
* 通过该参数,我们可以增量获取超过 minUpdateTime 时间的错误码
|
||||
* @return 错误码列表
|
||||
*/
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodes(@NotNull(message = "错误码分组不能为空") String group, Date minUpdateTime);
|
||||
|
||||
/**
|
||||
* 自动生成错误码
|
||||
*
|
||||
* @param autoGenerateDTOs 自动生成信息 DTO
|
||||
*/
|
||||
CommonResult<Boolean> autoGenerateErrorCodes(List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs);
|
||||
|
||||
/**
|
||||
* 创建错误码
|
||||
*
|
||||
* @param createDTO 创建错误码 DTO
|
||||
* @return 错误码编号
|
||||
*/
|
||||
CommonResult<Integer> createErrorCode(ErrorCodeCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新错误码
|
||||
*
|
||||
* @param updateDTO 更新错误码 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateErrorCode(ErrorCodeUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除错误码
|
||||
*
|
||||
* @param errorCodeId 错误码编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteErrorCode(Integer errorCodeId);
|
||||
|
||||
/**
|
||||
* 获得错误码
|
||||
*
|
||||
* @param errorCodeId 错误码编号
|
||||
* @return 错误码
|
||||
*/
|
||||
CommonResult<ErrorCodeVO> getErrorCode(Integer errorCodeId);
|
||||
|
||||
/**
|
||||
* 获得错误码列表
|
||||
*
|
||||
* @param errorCodeIds 错误码编号列表
|
||||
* @return 错误码列表
|
||||
*/
|
||||
CommonResult<List<ErrorCodeVO>> listErrorCodes(List<Integer> errorCodeIds);
|
||||
|
||||
/**
|
||||
* 获得错误码分页
|
||||
*
|
||||
* @param pageDTO 错误码分页查询
|
||||
* @return 错误码分页结果
|
||||
*/
|
||||
CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(ErrorCodePageDTO pageDTO);
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
|
||||
public interface OAuth2Rpc {
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2CreateAccessTokenReqDTO createAccessTokenDTO);
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(String accessToken);
|
||||
|
||||
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO);
|
||||
|
||||
CommonResult<Boolean> removeToken(OAuth2RemoveTokenByUserReqDTO removeTokenDTO);
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface OAuthFeign {
|
||||
|
||||
@PostMapping("ccreateAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@RequestBody OAuth2CreateAccessTokenReqDTO createAccessTokenDTO);
|
||||
|
||||
@PostMapping("/system/oauthcheckAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken) ;
|
||||
|
||||
@PostMapping("/system/oauthrefreshAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestBody OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO);
|
||||
@PostMapping("/system/oauthremoveToken")
|
||||
public CommonResult<Boolean> removeToken(@RequestBody OAuth2RemoveTokenByUserReqDTO removeTokenDTO);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface PermissionFeign {
|
||||
|
||||
@GetMapping("/system/permission/listRoleResourceIds")
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(@RequestParam("roleId")Integer roleId) ;
|
||||
|
||||
@PostMapping("/system/permission/assignRoleResource")
|
||||
public CommonResult<Boolean> assignRoleResource(@RequestBody PermissionAssignRoleResourceDTO assignRoleResourceDTO);
|
||||
|
||||
@GetMapping("/system/permission/listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId")Integer adminId);
|
||||
|
||||
@GetMapping("/system/permission/mapAdminRoleIds")
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(@RequestParam("adminIds") Collection<Integer> adminIds);
|
||||
|
||||
@PostMapping("/system/permission/assignAdminRole")
|
||||
public CommonResult<Boolean> assignAdminRole(@RequestBody PermissionAssignAdminRoleDTO assignAdminRoleDTO);
|
||||
|
||||
@PostMapping("/system/permission/scheckPermission")
|
||||
public CommonResult<Boolean> checkPermission(@RequestBody PermissionCheckDTO checkDTO) ;
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 权限 Rpc 接口
|
||||
*/
|
||||
public interface PermissionRpc {
|
||||
|
||||
/**
|
||||
* 获得角色拥有的资源编号
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
* @return 资源编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listRoleResourceIds(Integer roleId);
|
||||
|
||||
/**
|
||||
* 赋予角色资源
|
||||
*
|
||||
* @param assignRoleResourceDTO 赋予角色资源 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> assignRoleResource(PermissionAssignRoleResourceDTO assignRoleResourceDTO);
|
||||
|
||||
/**
|
||||
* 获得管理员拥有的角色编号列表
|
||||
*
|
||||
* @param adminId 管理员编号
|
||||
* @return 资源编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId);
|
||||
|
||||
/**
|
||||
* 获得每个管理员拥有的角色编号
|
||||
* 返回的结果,key 为管理员编号
|
||||
*
|
||||
* @param adminIds 管理员编号列表
|
||||
* @return 每个管理员拥有的角色编号
|
||||
*/
|
||||
CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(Collection<Integer> adminIds);
|
||||
|
||||
/**
|
||||
* 赋予管理员角色
|
||||
*
|
||||
* @param assignAdminRoleDTO 赋予管理员角色 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> assignAdminRole(PermissionAssignAdminRoleDTO assignAdminRoleDTO);
|
||||
|
||||
/**
|
||||
* 校验管理员是否拥有指定权限。
|
||||
*
|
||||
* 如果没有,则抛出 {@link cn.iocoder.common.framework.exception.ServiceException} 异常
|
||||
*
|
||||
* @param checkDTO 校验权限 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> checkPermission(PermissionCheckDTO checkDTO);
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface ResourceFeign {
|
||||
|
||||
@PostMapping("/system/resource/createResource")
|
||||
public CommonResult<Integer> createResource(@RequestBody ResourceCreateDTO createDTO);
|
||||
|
||||
@PostMapping("/system/resource/updateResource")
|
||||
public CommonResult<Boolean> updateResource(@RequestBody ResourceUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/resource/deleteResource")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("resourceId") Integer resourceId) ;
|
||||
@GetMapping("/system/resource/getResource")
|
||||
public CommonResult<ResourceVO> getResource(@RequestParam("resourceId") Integer resourceId);
|
||||
|
||||
@GetMapping("/system/resource/listAllResource")
|
||||
public CommonResult<List<ResourceVO>> listResource() ;
|
||||
|
||||
@GetMapping("/system/resource/listResource")
|
||||
public CommonResult<List<ResourceVO>> listResource(@RequestParam("resourceIds") List<Integer> resourceIds);
|
||||
|
||||
@GetMapping("/system/resource/listRoleResource")
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(@RequestParam("roleIds") Collection<Integer> roleIds, @RequestParam("type") Integer type) ;
|
||||
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源 Rpc 接口
|
||||
*/
|
||||
public interface ResourceRpc {
|
||||
|
||||
/**
|
||||
* 创建资源
|
||||
*
|
||||
* @param createDTO 创建资源 DTO
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<Integer> createResource(ResourceCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新资源
|
||||
*
|
||||
* @param updateDTO 更新资源 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateResource(ResourceUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源
|
||||
*
|
||||
* @param resourceId 资源编号
|
||||
* @return 资源
|
||||
*/
|
||||
CommonResult<ResourceVO> getResource(Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获得资源全列表
|
||||
*
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listResource();
|
||||
|
||||
/**
|
||||
* 获得资源列表
|
||||
*
|
||||
* @param resourceIds 资源编号列表
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listResource(List<Integer> resourceIds);
|
||||
|
||||
/**
|
||||
* 获得指定角色的资源列表
|
||||
*
|
||||
* @param roleIds 角色编号列表
|
||||
* @param type 资源类型
|
||||
* @return 资源列表
|
||||
*/
|
||||
CommonResult<List<ResourceVO>> listRoleResource(@NotNull(message = "角色编号列表不能为空") Collection<Integer> roleIds, Integer type);
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface RoleFeign {
|
||||
|
||||
|
||||
@PostMapping("/system/role/createRole")
|
||||
public CommonResult<Integer> createRole(@RequestBody RoleCreateDTO createDTO) ;
|
||||
|
||||
@PostMapping("/system/role/updateRole")
|
||||
public CommonResult<Boolean> updateRole(@RequestBody RoleUpdateDTO updateDTO);
|
||||
|
||||
@GetMapping("/system/role/deleteRole")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("roleId")Integer roleId) ;
|
||||
|
||||
@GetMapping("/system/role/getRole")
|
||||
public CommonResult<RoleVO> getRole(@RequestParam("roleId")Integer roleId);
|
||||
|
||||
@GetMapping("/system/role/listAllRoles")
|
||||
public CommonResult<List<RoleVO>> listAllRoles() ;
|
||||
|
||||
@GetMapping("/system/role/listRoles")
|
||||
public CommonResult<List<RoleVO>> listRoles(@RequestParam("roleIds")Collection<Integer> roleIds) ;
|
||||
|
||||
@PostMapping("/system/role/pageRole")
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(@RequestBody RolePageDTO pageDTO);
|
||||
|
||||
@GetMapping("/system/role/listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId") Integer adminId) ;
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 角色 Rpc 接口
|
||||
*/
|
||||
public interface RoleRpc {
|
||||
|
||||
/**
|
||||
* 创建角色
|
||||
*
|
||||
* @param createDTO 创建角色 DTO
|
||||
* @return 角色编号
|
||||
*/
|
||||
CommonResult<Integer> createRole(RoleCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 更新角色
|
||||
*
|
||||
* @param updateDTO 更新角色 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateRole(RoleUpdateDTO updateDTO);
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteRole(Integer roleId);
|
||||
|
||||
/**
|
||||
* 获得角色
|
||||
*
|
||||
* @param roleId 角色编号
|
||||
* @return 角色
|
||||
*/
|
||||
CommonResult<RoleVO> getRole(Integer roleId);
|
||||
|
||||
/**
|
||||
* 获得所有角色
|
||||
*
|
||||
* @return 角色列表
|
||||
*/
|
||||
CommonResult<List<RoleVO>> listAllRoles();
|
||||
|
||||
/**
|
||||
* 获得角色列表
|
||||
*
|
||||
* @param roleIds 角色编号列表
|
||||
* @return 角色列表
|
||||
*/
|
||||
CommonResult<List<RoleVO>> listRoles(Collection<Integer> roleIds);
|
||||
|
||||
/**
|
||||
* 获得角色分页
|
||||
*
|
||||
* @param pageDTO 角色分页查询
|
||||
* @return 角色分页结果
|
||||
*/
|
||||
CommonResult<PageResult<RoleVO>> pageRole(RolePageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 获得管理员拥有的角色编号列表
|
||||
*
|
||||
* @param adminId 管理员编号
|
||||
* @return 角色编号列表
|
||||
*/
|
||||
CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface SystemAccessLogFeign {
|
||||
|
||||
@PostMapping("/system/accesslog/createSystemAccessLog")
|
||||
public CommonResult<Boolean> createSystemAccessLog(@RequestBody SystemAccessLogCreateDTO createDTO);
|
||||
|
||||
@PostMapping("/system/accesslog/pageSystemAccessLog")
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(@RequestBody SystemAccessLogPageDTO pageDTO);
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
|
||||
/**
|
||||
* 系统访问日志 Rpc 接口
|
||||
*/
|
||||
public interface SystemAccessLogRpc {
|
||||
|
||||
/**
|
||||
* 创建系统访问日志
|
||||
*
|
||||
* @param createDTO 创建系统访问日志 DTO
|
||||
* @return 系统访问日志编号
|
||||
*/
|
||||
CommonResult<Boolean> createSystemAccessLog(SystemAccessLogCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 获得系统访问日志分页
|
||||
*
|
||||
* @param pageDTO 系统访问日志分页查询
|
||||
* @return 系统访问日志分页结果
|
||||
*/
|
||||
CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(SystemAccessLogPageDTO pageDTO);
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 接口
|
||||
*/
|
||||
@FeignClient("system-service")
|
||||
public interface SystemExceptionLogFeign {
|
||||
|
||||
@PostMapping("/system/exceptionlog/createSystemExceptionLog")
|
||||
public CommonResult<Boolean> createSystemExceptionLog(@RequestBody SystemExceptionLogCreateDTO createDTO);
|
||||
|
||||
@GetMapping("/system/exceptionlog/getSystemExceptionLog")
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(@RequestParam("systemExceptionLogId") Integer systemExceptionLogId);
|
||||
@PostMapping("/system/exceptionlog/pageSystemExceptionLog")
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(@RequestBody SystemExceptionLogPageDTO pageDTO) ;
|
||||
|
||||
@PostMapping("/system/exceptionlog/processSystemExceptionLog")
|
||||
public CommonResult<Boolean> processSystemExceptionLog(@RequestBody SystemExceptionLogProcessDTO processDTO) ;
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
|
||||
/**
|
||||
* 系统异常日志 Rpc 接口
|
||||
*/
|
||||
public interface SystemExceptionLogRpc {
|
||||
|
||||
/**
|
||||
* 创建系统异常日志
|
||||
*
|
||||
* @param createDTO 创建系统异常日志 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> createSystemExceptionLog(SystemExceptionLogCreateDTO createDTO);
|
||||
|
||||
/**
|
||||
* 获得系统异常日志
|
||||
*
|
||||
* @param systemExceptionLogId 系统异常日志编号
|
||||
* @return 系统异常日志
|
||||
*/
|
||||
CommonResult<SystemExceptionLogVO> getSystemExceptionLog(Integer systemExceptionLogId);
|
||||
|
||||
/**
|
||||
* 获得系统异常日志分页
|
||||
*
|
||||
* @param pageDTO 系统异常日志分页查询
|
||||
* @return 系统异常日志分页结果
|
||||
*/
|
||||
CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(SystemExceptionLogPageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 处理系统异常日志,完成或者忽略
|
||||
*
|
||||
* @param processDTO 处理 DTO
|
||||
* @return 成功
|
||||
*/
|
||||
CommonResult<Boolean> processSystemExceptionLog(SystemExceptionLogProcessDTO processDTO);
|
||||
|
||||
}
|
@ -86,7 +86,10 @@
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -2,8 +2,12 @@ package cn.iocoder.mall.systemservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.systemservice.rpc"})
|
||||
public class SystemServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@ -8,41 +8,49 @@ import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminVerifyPasswordDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.AdminRpc.version}")
|
||||
public class AdminRpcImpl implements AdminRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/admin")
|
||||
public class AdminController {
|
||||
@Autowired
|
||||
private AdminManager adminManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminVO> verifyPassword(AdminVerifyPasswordDTO verifyPasswordDTO) {
|
||||
|
||||
@PostMapping("verifyPassword")
|
||||
public CommonResult<AdminVO> verifyPassword(@RequestBody AdminVerifyPasswordDTO verifyPasswordDTO) {
|
||||
return success(adminManager.verifyPassword(verifyPasswordDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createAdmin(AdminCreateDTO createDTO) {
|
||||
@PostMapping("createAdmin")
|
||||
public CommonResult<Integer> createAdmin(@RequestBody AdminCreateDTO createDTO) {
|
||||
AdminVO adminVO = adminManager.createAdmin(createDTO);
|
||||
return success(adminVO.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateAdmin(AdminUpdateDTO updateDTO) {
|
||||
@PostMapping("updateAdmin")
|
||||
public CommonResult<Boolean> updateAdmin(@RequestBody AdminUpdateDTO updateDTO) {
|
||||
adminManager.updateAdmin(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(AdminPageDTO pageDTO) {
|
||||
@PostMapping("pageAdmin")
|
||||
public CommonResult<PageResult<AdminVO>> pageAdmin(@RequestBody AdminPageDTO pageDTO) {
|
||||
return success(adminManager.pageAdmin(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminVO> getAdmin(Integer adminId) {
|
||||
@GetMapping("getAdmin")
|
||||
public CommonResult<AdminVO> getAdmin(@RequestParam("adminId") Integer adminId) {
|
||||
return success(adminManager.getAdmin(adminId));
|
||||
}
|
||||
|
@ -1,55 +1,59 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.datadict;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.datadict.DataDictManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.dto.DataDictUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.datadict.vo.DataDictVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 数据字典 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.DataDictRpc.version}")
|
||||
public class DataDictRpcImpl implements DataDictRpc {
|
||||
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/datadict")
|
||||
public class DataDictController {
|
||||
@Autowired
|
||||
private DataDictManager dataDictManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createDataDict(DataDictCreateDTO createDTO) {
|
||||
@PostMapping("createDataDict")
|
||||
public CommonResult<Integer> createDataDict(@RequestBody DataDictCreateDTO createDTO) {
|
||||
return success(dataDictManager.createDataDict(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateDataDict(DataDictUpdateDTO updateDTO) {
|
||||
@PostMapping("updateDataDict")
|
||||
public CommonResult<Boolean> updateDataDict(@RequestBody DataDictUpdateDTO updateDTO) {
|
||||
dataDictManager.updateDataDict(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDataDict(Integer dataDictId) {
|
||||
@GetMapping("deleteDataDict")
|
||||
public CommonResult<Boolean> deleteDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
dataDictManager.deleteDataDict(dataDictId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DataDictVO> getDataDict(Integer dataDictId) {
|
||||
@GetMapping("getDataDict")
|
||||
public CommonResult<DataDictVO> getDataDict(@RequestParam("dataDictId") Integer dataDictId) {
|
||||
return success(dataDictManager.getDataDict(dataDictId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts() {
|
||||
return success(dataDictManager.listDataDicts());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(List<Integer> dataDictIds) {
|
||||
@GetMapping("listDataDicts")
|
||||
public CommonResult<List<DataDictVO>> listDataDicts(@RequestParam("dataDictIds") List<Integer> dataDictIds) {
|
||||
return success(dataDictManager.listDataDicts(dataDictIds));
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.admin.DepartmentManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.*;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/department")
|
||||
public class DepartmentController {
|
||||
@Autowired
|
||||
private DepartmentManager departmentManager;
|
||||
|
||||
@PostMapping("createDepartment")
|
||||
public CommonResult<Integer> createDepartment(@RequestBody DepartmentCreateDTO createDTO) {
|
||||
return success(departmentManager.createDepartment(createDTO));
|
||||
}
|
||||
|
||||
@PostMapping("updateDepartment")
|
||||
public CommonResult<Boolean> updateDepartment(@RequestBody DepartmentUpdateDTO updateDTO) {
|
||||
departmentManager.updateDepartment(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("deleteDepartment")
|
||||
public CommonResult<Boolean> deleteDepartment(@RequestParam("departmentId")Integer departmentId) {
|
||||
departmentManager.deleteDepartment(departmentId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("getDepartment")
|
||||
public CommonResult<DepartmentVO> getDepartment(@RequestParam("departmentId") Integer departmentId) {
|
||||
return success(departmentManager.getDepartment(departmentId));
|
||||
}
|
||||
|
||||
@GetMapping("listDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(@RequestParam("departmentIds")Collection<Integer> departmentIds) {
|
||||
return success(departmentManager.listDepartments(departmentIds));
|
||||
}
|
||||
|
||||
@GetMapping("listAllDepartments")
|
||||
public CommonResult<List<DepartmentVO>> listDepartments() {
|
||||
return success(departmentManager.listDepartments());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.errorcode;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@ -8,61 +8,67 @@ import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.dto.ErrorCodeUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.errorcode.vo.ErrorCodeVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.ErrorCodeRpc.version}")
|
||||
public class ErrorCodeRpcImpl implements ErrorCodeRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/errorcode")
|
||||
public class ErrorCodeController {
|
||||
@Autowired
|
||||
private ErrorCodeManager errorCodeManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(String group, Date minUpdateTime) {
|
||||
@GetMapping("listErrorCodes")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("group") String group, @RequestParam("minUpdateTime") Date minUpdateTime) {
|
||||
return success(errorCodeManager.listErrorCodes(group, minUpdateTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs) {
|
||||
@PostMapping("autoGenerateErrorCodes")
|
||||
public CommonResult<Boolean> autoGenerateErrorCodes(@RequestBody List<ErrorCodeAutoGenerateDTO> autoGenerateDTOs) {
|
||||
errorCodeManager.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createErrorCode(ErrorCodeCreateDTO createDTO) {
|
||||
@PostMapping("createErrorCode")
|
||||
public CommonResult<Integer> createErrorCode(@RequestBody ErrorCodeCreateDTO createDTO) {
|
||||
return success(errorCodeManager.createErrorCode(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateErrorCode(ErrorCodeUpdateDTO updateDTO) {
|
||||
@PostMapping("updateErrorCode")
|
||||
public CommonResult<Boolean> updateErrorCode(@RequestBody ErrorCodeUpdateDTO updateDTO) {
|
||||
errorCodeManager.updateErrorCode(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteErrorCode(Integer errorCodeId) {
|
||||
@GetMapping("deleteErrorCode")
|
||||
public CommonResult<Boolean> deleteErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
errorCodeManager.deleteErrorCode(errorCodeId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(Integer errorCodeId) {
|
||||
@GetMapping("getErrorCode")
|
||||
public CommonResult<ErrorCodeVO> getErrorCode(@RequestParam("errorCodeId")Integer errorCodeId) {
|
||||
return success(errorCodeManager.getErrorCode(errorCodeId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(List<Integer> errorCodeIds) {
|
||||
@GetMapping("listErrorCodesByIds")
|
||||
public CommonResult<List<ErrorCodeVO>> listErrorCodes(@RequestParam("errorCodeIds")List<Integer> errorCodeIds) {
|
||||
return success(errorCodeManager.listErrorCodes(errorCodeIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(ErrorCodePageDTO pageDTO) {
|
||||
@PostMapping("pageErrorCode")
|
||||
public CommonResult<PageResult<ErrorCodeVO>> pageErrorCode(@RequestBody ErrorCodePageDTO pageDTO) {
|
||||
return success(errorCodeManager.pageErrorCode(pageDTO));
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.oauth;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2AccessTokenRespDTO;
|
||||
@ -6,36 +6,43 @@ import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2CreateAccessTokenReqDTO
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RefreshAccessTokenReqDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
import cn.iocoder.mall.systemservice.service.oauth.OAuth2Service;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@DubboService
|
||||
public class OAuth2RpcImpl implements OAuth2Rpc {
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/oauth")
|
||||
public class OAuthController {
|
||||
|
||||
@Autowired
|
||||
private OAuth2Service oAuth2Service;
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2CreateAccessTokenReqDTO createAccessTokenDTO) {
|
||||
@PostMapping("createAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@RequestBody OAuth2CreateAccessTokenReqDTO createAccessTokenDTO) {
|
||||
return success(oAuth2Service.createAccessToken(createAccessTokenDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(String accessToken) {
|
||||
@PostMapping("checkAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> checkAccessToken(@RequestParam("accessToken") String accessToken) {
|
||||
return success(oAuth2Service.checkAccessToken(accessToken));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO) {
|
||||
@PostMapping("refreshAccessToken")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestBody OAuth2RefreshAccessTokenReqDTO refreshAccessTokenDTO) {
|
||||
return success(oAuth2Service.refreshAccessToken(refreshAccessTokenDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> removeToken(OAuth2RemoveTokenByUserReqDTO removeTokenDTO) {
|
||||
@PostMapping("removeToken")
|
||||
public CommonResult<Boolean> removeToken(@RequestBody OAuth2RemoveTokenByUserReqDTO removeTokenDTO) {
|
||||
oAuth2Service.removeToken(removeTokenDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.permission.PermissionManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignAdminRoleDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionAssignRoleResourceDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.PermissionCheckDTO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@ -15,45 +15,48 @@ import java.util.Set;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 权限 Rpc 实现类
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.PermissionRpc.version}")
|
||||
public class PermissionRpcImpl implements PermissionRpc {
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system/permission")
|
||||
public class PermissionController {
|
||||
@Autowired
|
||||
private PermissionManager permissionManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(Integer roleId) {
|
||||
@GetMapping("listRoleResourceIds")
|
||||
public CommonResult<Set<Integer>> listRoleResourceIds(@RequestParam("roleId")Integer roleId) {
|
||||
return success(permissionManager.listRoleResourceIds(roleId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> assignRoleResource(PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
@PostMapping("assignRoleResource")
|
||||
public CommonResult<Boolean> assignRoleResource(@RequestBody PermissionAssignRoleResourceDTO assignRoleResourceDTO) {
|
||||
permissionManager.assignRoleResource(assignRoleResourceDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId) {
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId")Integer adminId) {
|
||||
return success(permissionManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(Collection<Integer> adminIds) {
|
||||
@GetMapping("mapAdminRoleIds")
|
||||
public CommonResult<Map<Integer, Set<Integer>>> mapAdminRoleIds(@RequestParam("adminIds") Collection<Integer> adminIds) {
|
||||
return success(permissionManager.mapAdminRoleIds(adminIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> assignAdminRole(PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
@PostMapping("assignAdminRole")
|
||||
public CommonResult<Boolean> assignAdminRole(@RequestBody PermissionAssignAdminRoleDTO assignAdminRoleDTO) {
|
||||
permissionManager.assignAdminRole(assignAdminRoleDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> checkPermission(PermissionCheckDTO checkDTO) {
|
||||
@PostMapping("checkPermission")
|
||||
public CommonResult<Boolean> checkPermission(@RequestBody PermissionCheckDTO checkDTO) {
|
||||
permissionManager.checkPermission(checkDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.permission.ResourceManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.ResourceUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -14,48 +14,53 @@ import java.util.List;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 资源 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.ResourceRpc.version}")
|
||||
public class ResourceRpcImpl implements ResourceRpc {
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/resource")
|
||||
public class ResourceController {
|
||||
|
||||
@Autowired
|
||||
private ResourceManager resourceManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createResource(ResourceCreateDTO createDTO) {
|
||||
@PostMapping("createResource")
|
||||
public CommonResult<Integer> createResource(@RequestBody ResourceCreateDTO createDTO) {
|
||||
return success(resourceManager.createResource(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateResource(ResourceUpdateDTO updateDTO) {
|
||||
@PostMapping("updateResource")
|
||||
public CommonResult<Boolean> updateResource(@RequestBody ResourceUpdateDTO updateDTO) {
|
||||
resourceManager.updateResource(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteResource(Integer resourceId) {
|
||||
@GetMapping("deleteResource")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
resourceManager.deleteResource(resourceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<ResourceVO> getResource(Integer resourceId) {
|
||||
@GetMapping("getResource")
|
||||
public CommonResult<ResourceVO> getResource(@RequestParam("resourceId")Integer resourceId) {
|
||||
return success(resourceManager.getResource(resourceId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllResource")
|
||||
public CommonResult<List<ResourceVO>> listResource() {
|
||||
return success(resourceManager.listResources());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ResourceVO>> listResource(List<Integer> resourceIds) {
|
||||
@GetMapping("listResource")
|
||||
public CommonResult<List<ResourceVO>> listResource(@RequestParam("resourceIds")List<Integer> resourceIds) {
|
||||
return success(resourceManager.listResources(resourceIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(Collection<Integer> roleIds, Integer type) {
|
||||
@GetMapping("listRoleResource")
|
||||
public CommonResult<List<ResourceVO>> listRoleResource(@RequestParam("roleIds") Collection<Integer> roleIds, @RequestParam("type")Integer type) {
|
||||
return success(resourceManager.listRoleResources(roleIds, type));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.permission;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@ -7,8 +7,8 @@ import cn.iocoder.mall.systemservice.rpc.permission.dto.RolePageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.dto.RoleUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -17,53 +17,58 @@ import java.util.Set;
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 角色 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.RoleRpc.version}")
|
||||
public class RoleRpcImpl implements RoleRpc {
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class RoleController {
|
||||
|
||||
@Autowired
|
||||
private RoleManager roleManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createRole(RoleCreateDTO createDTO) {
|
||||
@PostMapping("createRole")
|
||||
public CommonResult<Integer> createRole(@RequestBody RoleCreateDTO createDTO) {
|
||||
return success(roleManager.createRole(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateRole(RoleUpdateDTO updateDTO) {
|
||||
@PostMapping("updateRole")
|
||||
public CommonResult<Boolean> updateRole(@RequestBody RoleUpdateDTO updateDTO) {
|
||||
roleManager.updateRole(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteRole(Integer roleId) {
|
||||
@GetMapping("deleteRole")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("roleId")Integer roleId) {
|
||||
roleManager.deleteRole(roleId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<RoleVO> getRole(Integer roleId) {
|
||||
@GetMapping("getRole")
|
||||
public CommonResult<RoleVO> getRole(@RequestParam("roleId")Integer roleId) {
|
||||
return success(roleManager.getRole(roleId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("listAllRoles")
|
||||
public CommonResult<List<RoleVO>> listAllRoles() {
|
||||
return success(roleManager.listAllRoles());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<RoleVO>> listRoles(Collection<Integer> roleIds) {
|
||||
@GetMapping("listRoles")
|
||||
public CommonResult<List<RoleVO>> listRoles(@RequestParam("roleIds")Collection<Integer> roleIds) {
|
||||
return success(roleManager.listRoles(roleIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(RolePageDTO pageDTO) {
|
||||
@PostMapping("pageRole")
|
||||
public CommonResult<PageResult<RoleVO>> pageRole(@RequestBody RolePageDTO pageDTO) {
|
||||
return success(roleManager.pageRole(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(Integer adminId) {
|
||||
@GetMapping("listAdminRoleIds")
|
||||
public CommonResult<Set<Integer>> listAdminRoleIds(@RequestParam("adminId") Integer adminId) {
|
||||
return success(roleManager.listAdminRoleIds(adminId));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@ -6,28 +6,35 @@ import cn.iocoder.mall.systemservice.manager.systemlog.SystemAccessLogManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemAccessLogCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemAccessLogVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 系统访问日志 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.SystemAccessLogRpc.version}")
|
||||
public class SystemAccessLogRpcImpl implements SystemAccessLogRpc {
|
||||
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/accesslog")
|
||||
public class SystemAccessLogController {
|
||||
@Autowired
|
||||
private SystemAccessLogManager systemAccessLogManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> createSystemAccessLog(SystemAccessLogCreateDTO createDTO) {
|
||||
@PostMapping("createSystemAccessLog")
|
||||
public CommonResult<Boolean> createSystemAccessLog(@RequestBody SystemAccessLogCreateDTO createDTO) {
|
||||
systemAccessLogManager.createSystemAccessLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(SystemAccessLogPageDTO pageDTO) {
|
||||
@PostMapping("pageSystemAccessLog")
|
||||
public CommonResult<PageResult<SystemAccessLogVO>> pageSystemAccessLog(@RequestBody SystemAccessLogPageDTO pageDTO) {
|
||||
return success(systemAccessLogManager.pageSystemAccessLog(pageDTO));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.systemlog;
|
||||
package cn.iocoder.mall.systemservice.controller;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
@ -7,37 +7,43 @@ import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogCreateD
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Service(version = "${dubbo.provider.SystemExceptionLogRpc.version}")
|
||||
public class SystemExceptionLogRpcImpl implements SystemExceptionLogRpc {
|
||||
|
||||
/**
|
||||
* Title:
|
||||
* Description:
|
||||
*
|
||||
* @author zhuyang
|
||||
* @version 1.0 2021/10/11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/exceptionlog")
|
||||
public class SystemExceptionLogController {
|
||||
@Autowired
|
||||
private SystemExceptionLogManager systemExceptionLogManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> createSystemExceptionLog(SystemExceptionLogCreateDTO createDTO) {
|
||||
@PostMapping("createSystemExceptionLog")
|
||||
public CommonResult<Boolean> createSystemExceptionLog(@RequestBody SystemExceptionLogCreateDTO createDTO) {
|
||||
systemExceptionLogManager.createSystemExceptionLog(createDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(Integer systemExceptionLogId) {
|
||||
@GetMapping("getSystemExceptionLog")
|
||||
public CommonResult<SystemExceptionLogVO> getSystemExceptionLog(@RequestParam("systemExceptionLogId") Integer systemExceptionLogId) {
|
||||
return success(systemExceptionLogManager.getSystemExceptionLog(systemExceptionLogId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(SystemExceptionLogPageDTO pageDTO) {
|
||||
@PostMapping("pageSystemExceptionLog")
|
||||
public CommonResult<PageResult<SystemExceptionLogVO>> pageSystemExceptionLog(@RequestBody SystemExceptionLogPageDTO pageDTO) {
|
||||
return success(systemExceptionLogManager.pageSystemExceptionLog(pageDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> processSystemExceptionLog(SystemExceptionLogProcessDTO processDTO) {
|
||||
@PostMapping("processSystemExceptionLog")
|
||||
public CommonResult<Boolean> processSystemExceptionLog(@RequestBody SystemExceptionLogProcessDTO processDTO) {
|
||||
systemExceptionLogManager.processSystemExceptionLog(processDTO);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package cn.iocoder.mall.systemservice.rpc.admin;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.systemservice.manager.admin.DepartmentManager;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentCreateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.dto.DepartmentUpdateDTO;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.DepartmentVO;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 部门 Rpc 实现类
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.DepartmentRpc.version}")
|
||||
public class DepartmentRpcImpl implements DepartmentRpc {
|
||||
|
||||
@Autowired
|
||||
private DepartmentManager departmentManager;
|
||||
|
||||
@Override
|
||||
public CommonResult<Integer> createDepartment(DepartmentCreateDTO createDTO) {
|
||||
return success(departmentManager.createDepartment(createDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateDepartment(DepartmentUpdateDTO updateDTO) {
|
||||
departmentManager.updateDepartment(updateDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDepartment(Integer departmentId) {
|
||||
departmentManager.deleteDepartment(departmentId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DepartmentVO> getDepartment(Integer departmentId) {
|
||||
return success(departmentManager.getDepartment(departmentId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DepartmentVO>> listDepartments(Collection<Integer> departmentIds) {
|
||||
return success(departmentManager.listDepartments(departmentIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<DepartmentVO>> listDepartments() {
|
||||
return success(departmentManager.listDepartments());
|
||||
}
|
||||
|
||||
}
|
@ -2,8 +2,12 @@ package cn.iocoder.mall.userservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableFeignClients(basePackages = {"cn.iocoder.mall.systemservice.rpc"})
|
||||
@EnableDiscoveryClient
|
||||
public class UserServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -4,7 +4,7 @@ import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.enums.UserTypeEnum;
|
||||
import cn.iocoder.common.framework.util.StringUtils;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuth2Rpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.OAuthFeign;
|
||||
import cn.iocoder.mall.systemservice.rpc.oauth.dto.OAuth2RemoveTokenByUserReqDTO;
|
||||
import cn.iocoder.mall.userservice.convert.user.UserConvert;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserCreateReqDTO;
|
||||
@ -13,7 +13,6 @@ import cn.iocoder.mall.userservice.rpc.user.dto.UserRespDTO;
|
||||
import cn.iocoder.mall.userservice.rpc.user.dto.UserUpdateReqDTO;
|
||||
import cn.iocoder.mall.userservice.service.user.UserService;
|
||||
import cn.iocoder.mall.userservice.service.user.bo.UserBO;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -25,8 +24,9 @@ public class UserManager {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@DubboReference(version = "${dubbo.consumer.OAuth2Rpc.version}")
|
||||
private OAuth2Rpc oauth2Rpc;
|
||||
|
||||
@Autowired
|
||||
private OAuthFeign oAuthFeign;
|
||||
|
||||
public UserRespDTO createUserIfAbsent(UserCreateReqDTO createDTO) {
|
||||
// 用户已经存在
|
||||
@ -50,7 +50,7 @@ public class UserManager {
|
||||
// 如果修改密码,或者禁用管理员
|
||||
if (StringUtils.hasText(updateDTO.getPassword())
|
||||
|| CommonStatusEnum.DISABLE.getValue().equals(updateDTO.getStatus())) {
|
||||
oauth2Rpc.removeToken(new OAuth2RemoveTokenByUserReqDTO().setUserId(updateDTO.getId())
|
||||
oAuthFeign.removeToken(new OAuth2RemoveTokenByUserReqDTO().setUserId(updateDTO.getId())
|
||||
.setUserType(UserTypeEnum.ADMIN.getValue()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user