refactor: 调整基础设施模块

This commit is contained in:
valarchie 2023-07-30 12:03:23 +08:00
parent b59ed7d7d6
commit 37f2b63038
29 changed files with 40 additions and 62 deletions

View File

@ -11,15 +11,15 @@ import com.agileboot.domain.system.menu.MenuApplicationService;
import com.agileboot.domain.system.menu.dto.RouterDTO;
import com.agileboot.domain.system.user.UserApplicationService;
import com.agileboot.domain.system.user.command.AddUserCommand;
import com.agileboot.infrastructure.annotations.RateLimit;
import com.agileboot.infrastructure.annotations.RateLimit.CacheType;
import com.agileboot.infrastructure.annotations.RateLimit.LimitType;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit.CacheType;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit.LimitType;
import com.agileboot.infrastructure.security.AuthenticationUtils;
import com.agileboot.infrastructure.web.domain.login.CaptchaDTO;
import com.agileboot.infrastructure.web.domain.login.ConfigDTO;
import com.agileboot.infrastructure.web.domain.login.LoginDTO;
import com.agileboot.infrastructure.web.domain.login.LoginUser;
import com.agileboot.infrastructure.web.domain.ratelimit.RateLimitKey;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimitKey;
import com.agileboot.infrastructure.web.service.LoginService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -8,7 +8,7 @@ import com.agileboot.domain.monitor.MonitorApplicationService;
import com.agileboot.domain.monitor.dto.OnlineUserDTO;
import com.agileboot.domain.monitor.dto.RedisCacheInfoDTO;
import com.agileboot.domain.monitor.dto.ServerInfo;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -8,7 +8,7 @@ import com.agileboot.domain.system.config.ConfigApplicationService;
import com.agileboot.domain.system.config.command.ConfigUpdateCommand;
import com.agileboot.domain.system.config.dto.ConfigDTO;
import com.agileboot.domain.system.config.query.ConfigQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -8,7 +8,7 @@ import com.agileboot.domain.system.dept.command.AddDeptCommand;
import com.agileboot.domain.system.dept.command.UpdateDeptCommand;
import com.agileboot.domain.system.dept.dto.DeptDTO;
import com.agileboot.domain.system.dept.query.DeptQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -11,7 +11,7 @@ import com.agileboot.domain.system.log.dto.LoginLogDTO;
import com.agileboot.domain.system.log.query.LoginLogQuery;
import com.agileboot.domain.system.log.dto.OperationLogDTO;
import com.agileboot.domain.system.log.dto.OperationLogQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -24,7 +24,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

View File

@ -9,7 +9,7 @@ import com.agileboot.domain.system.menu.command.UpdateMenuCommand;
import com.agileboot.domain.system.menu.dto.MenuDTO;
import com.agileboot.domain.system.menu.dto.MenuDetailDTO;
import com.agileboot.domain.system.menu.query.MenuQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.infrastructure.security.AuthenticationUtils;
import com.agileboot.infrastructure.web.domain.login.LoginUser;
import com.agileboot.orm.common.enums.BusinessTypeEnum;

View File

@ -9,9 +9,9 @@ import com.agileboot.domain.system.notice.command.NoticeAddCommand;
import com.agileboot.domain.system.notice.command.NoticeUpdateCommand;
import com.agileboot.domain.system.notice.dto.NoticeDTO;
import com.agileboot.domain.system.notice.query.NoticeQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.Unrepeatable;
import com.agileboot.infrastructure.annotations.Unrepeatable.CheckType;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.infrastructure.annotations.unrepeatable.Unrepeatable;
import com.agileboot.infrastructure.annotations.unrepeatable.Unrepeatable.CheckType;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import com.baomidou.dynamic.datasource.annotation.DS;
import io.swagger.v3.oas.annotations.Operation;

View File

@ -10,7 +10,7 @@ import com.agileboot.domain.system.post.command.AddPostCommand;
import com.agileboot.domain.system.post.command.UpdatePostCommand;
import com.agileboot.domain.system.post.dto.PostDTO;
import com.agileboot.domain.system.post.query.PostQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -12,7 +12,7 @@ import com.agileboot.domain.system.user.command.UpdateProfileCommand;
import com.agileboot.domain.system.user.command.UpdateUserAvatarCommand;
import com.agileboot.domain.system.user.command.UpdateUserPasswordCommand;
import com.agileboot.domain.system.user.dto.UserProfileDTO;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.infrastructure.security.AuthenticationUtils;
import com.agileboot.infrastructure.web.domain.login.LoginUser;
import com.agileboot.orm.common.enums.BusinessTypeEnum;

View File

@ -14,7 +14,7 @@ import com.agileboot.domain.system.role.query.AllocatedRoleQuery;
import com.agileboot.domain.system.role.query.RoleQuery;
import com.agileboot.domain.system.role.query.UnallocatedRoleQuery;
import com.agileboot.domain.system.user.dto.UserDTO;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@ -14,7 +14,7 @@ import com.agileboot.domain.system.user.command.UpdateUserCommand;
import com.agileboot.domain.system.user.dto.UserDTO;
import com.agileboot.domain.system.user.dto.UserDetailDTO;
import com.agileboot.domain.system.user.query.SearchUserQuery;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.infrastructure.security.AuthenticationUtils;
import com.agileboot.infrastructure.web.domain.login.LoginUser;
import com.agileboot.orm.common.enums.BusinessTypeEnum;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.annotations;
package com.agileboot.infrastructure.annotations.accessLog;
import com.agileboot.orm.common.enums.BusinessTypeEnum;
import com.agileboot.orm.common.enums.OperatorTypeEnum;

View File

@ -1,9 +1,7 @@
package com.agileboot.infrastructure.aspectj;
package com.agileboot.infrastructure.annotations.accessLog;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.thread.AsyncTaskFactory;
import com.agileboot.infrastructure.thread.ThreadPoolManager;
import com.agileboot.infrastructure.web.domain.operationLog.OperationLogModel;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.web.domain.operationLog;
package com.agileboot.infrastructure.annotations.accessLog;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.EnumUtil;
@ -6,7 +6,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;
import cn.hutool.json.JSONUtil;
import com.agileboot.common.utils.ServletHolderUtil;
import com.agileboot.infrastructure.annotations.AccessLog;
import com.agileboot.infrastructure.annotations.accessLog.AccessLog;
import com.agileboot.infrastructure.security.AuthenticationUtils;
import com.agileboot.infrastructure.web.domain.login.LoginUser;
import com.agileboot.orm.common.enums.OperationStatusEnum;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.annotations;
package com.agileboot.infrastructure.annotations.ratelimit;
import cn.hutool.extra.servlet.ServletUtil;
import com.agileboot.common.exception.ApiException;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.web.domain.ratelimit;
package com.agileboot.infrastructure.annotations.ratelimit;
/**
* 限流key

View File

@ -1,8 +1,7 @@
package com.agileboot.infrastructure.aspectj;
package com.agileboot.infrastructure.annotations.ratelimit;
import com.agileboot.infrastructure.annotations.RateLimit;
import com.agileboot.infrastructure.web.domain.ratelimit.MapRateLimitChecker;
import com.agileboot.infrastructure.web.domain.ratelimit.RedisRateLimitChecker;
import com.agileboot.infrastructure.annotations.ratelimit.implementation.MapRateLimitChecker;
import com.agileboot.infrastructure.annotations.ratelimit.implementation.RedisRateLimitChecker;
import java.lang.reflect.Method;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

View File

@ -1,6 +1,6 @@
package com.agileboot.infrastructure.web.domain.ratelimit;
package com.agileboot.infrastructure.annotations.ratelimit.implementation;
import com.agileboot.infrastructure.annotations.RateLimit;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit;
/**
* @author valarchie

View File

@ -1,9 +1,9 @@
package com.agileboot.infrastructure.web.domain.ratelimit;
package com.agileboot.infrastructure.annotations.ratelimit.implementation;
import cn.hutool.cache.impl.LRUCache;
import com.agileboot.common.exception.ApiException;
import com.agileboot.common.exception.error.ErrorCode;
import com.agileboot.infrastructure.annotations.RateLimit;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit;
import com.google.common.util.concurrent.RateLimiter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,9 +1,9 @@
package com.agileboot.infrastructure.web.domain.ratelimit;
package com.agileboot.infrastructure.annotations.ratelimit.implementation;
import cn.hutool.core.collection.ListUtil;
import com.agileboot.common.exception.ApiException;
import com.agileboot.common.exception.error.ErrorCode;
import com.agileboot.infrastructure.annotations.RateLimit;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.annotations;
package com.agileboot.infrastructure.annotations.unrepeatable;
import cn.hutool.core.util.StrUtil;
import com.agileboot.infrastructure.security.AuthenticationUtils;

View File

@ -1,9 +1,8 @@
package com.agileboot.infrastructure.interceptor.unrepeatable;
package com.agileboot.infrastructure.annotations.unrepeatable;
import cn.hutool.json.JSONUtil;
import com.agileboot.common.exception.ApiException;
import com.agileboot.common.exception.error.ErrorCode;
import com.agileboot.infrastructure.annotations.Unrepeatable;
import com.agileboot.infrastructure.cache.RedisUtil;
import java.lang.reflect.Type;
import java.util.Objects;

View File

@ -1,6 +1,6 @@
package com.agileboot.infrastructure.config;
import com.agileboot.infrastructure.filter.GlobalExceptionFilter;
import com.agileboot.infrastructure.exception.GlobalExceptionFilter;
import com.agileboot.infrastructure.filter.TestFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

View File

@ -1,18 +0,0 @@
package com.agileboot.infrastructure.enums;
/**
* 数据源
*
* @author ruoyi
*/
public enum DataSourceType {
/**
* 主库
*/
MASTER,
/**
* 从库
*/
SLAVE
}

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.aspectj;
package com.agileboot.infrastructure.exception;
import cn.hutool.core.map.MapUtil;
import com.agileboot.common.exception.ApiException;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.filter;
package com.agileboot.infrastructure.exception;
import cn.hutool.json.JSONUtil;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.interceptor.exception;
package com.agileboot.infrastructure.exception;
import com.agileboot.common.core.dto.ResponseDTO;
import com.agileboot.common.exception.ApiException;

View File

@ -1,4 +1,4 @@
package com.agileboot.infrastructure.aspectj;
package com.agileboot.infrastructure.log;
import cn.hutool.json.JSONUtil;
import com.agileboot.common.utils.jackson.JacksonUtil;

View File

@ -1,6 +1,7 @@
package com.agileboot.infrastructure.annotations;
import com.agileboot.infrastructure.annotations.RateLimit.LimitType;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit;
import com.agileboot.infrastructure.annotations.ratelimit.RateLimit.LimitType;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;