Skip to content

Commit

Permalink
refactor: 优化部分配置及工具类使用,适配最新 ContiNew Starter
Browse files Browse the repository at this point in the history
IpUtils 已经提取到 ContiNew Starter
  • Loading branch information
Charles7c committed Nov 26, 2023
1 parent f28fbd1 commit feef427
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 203 deletions.
12 changes: 0 additions & 12 deletions continew-admin-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
<artifactId>continew-starter-data-mybatis-plus</artifactId>
</dependency>

<!-- ContiNew Starter 缓存模块 - Redisson -->
<dependency>
<groupId>top.charles7c.continew</groupId>
<artifactId>continew-starter-cache-redisson</artifactId>
</dependency>

<!-- ContiNew Starter 验证码模块 - 图形验证码 -->
<dependency>
<groupId>top.charles7c.continew</groupId>
Expand Down Expand Up @@ -93,11 +87,5 @@
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>

<!-- 第三方封装 Ip2region(离线 IP 数据管理框架和定位库,支持亿级别的数据段,10 微秒级别的查询性能,提供了许多主流编程语言的 xdb 数据管理引擎的实现) -->
<dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-ip2region</artifactId>
</dependency>
</dependencies>
</project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import top.charles7c.cnadmin.common.model.dto.LogContext;
import top.charles7c.cnadmin.common.model.dto.LoginUser;
import top.charles7c.cnadmin.common.service.CommonUserService;
import top.charles7c.cnadmin.common.util.IpUtils;
import top.charles7c.cnadmin.common.util.ServletUtils;
import top.charles7c.cnadmin.common.util.holder.LogContextHolder;
import top.charles7c.continew.starter.core.util.ExceptionUtils;
import top.charles7c.continew.starter.core.util.IpUtils;

/**
* 登录助手
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import top.charles7c.cnadmin.common.constant.SysConstants;
import top.charles7c.cnadmin.common.model.dto.LogContext;
import top.charles7c.cnadmin.common.model.resp.R;
import top.charles7c.cnadmin.common.util.IpUtils;
import top.charles7c.cnadmin.common.util.ServletUtils;
import top.charles7c.cnadmin.common.util.helper.LoginHelper;
import top.charles7c.cnadmin.common.util.holder.LogContextHolder;
Expand All @@ -65,6 +64,7 @@
import top.charles7c.cnadmin.system.service.UserService;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.core.util.ExceptionUtils;
import top.charles7c.continew.starter.core.util.IpUtils;

/**
* 系统日志拦截器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import top.charles7c.cnadmin.auth.service.LoginService;
import top.charles7c.cnadmin.auth.service.PermissionService;
import top.charles7c.cnadmin.common.annotation.TreeField;
import top.charles7c.cnadmin.common.config.properties.ProjectProperties;
import top.charles7c.cnadmin.common.constant.RegexConstants;
import top.charles7c.cnadmin.common.constant.SysConstants;
import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum;
Expand All @@ -59,6 +58,7 @@
import top.charles7c.cnadmin.system.model.resp.DeptDetailResp;
import top.charles7c.cnadmin.system.model.resp.MenuResp;
import top.charles7c.cnadmin.system.service.*;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;

import me.zhyd.oauth.model.AuthUser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import cn.hutool.core.util.URLUtil;
import cn.hutool.extra.spring.SpringUtil;

import top.charles7c.cnadmin.common.config.properties.ProjectProperties;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;

/**
* 启动程序
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import cn.hutool.core.util.RandomUtil;

import top.charles7c.cnadmin.common.config.properties.CaptchaProperties;
import top.charles7c.cnadmin.common.config.properties.ProjectProperties;
import top.charles7c.cnadmin.common.constant.CacheConstants;
import top.charles7c.cnadmin.common.constant.RegexConstants;
import top.charles7c.cnadmin.common.model.resp.CaptchaResp;
Expand All @@ -57,6 +56,7 @@
import top.charles7c.cnadmin.common.util.validate.CheckUtils;
import top.charles7c.continew.starter.cache.redisson.util.RedisUtils;
import top.charles7c.continew.starter.captcha.graphic.autoconfigure.GraphicCaptchaProperties;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;

/**
* 验证码 API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

import top.charles7c.cnadmin.common.base.IBaseEnum;
import top.charles7c.cnadmin.common.config.properties.LocalStorageProperties;
import top.charles7c.cnadmin.common.config.properties.ProjectProperties;
import top.charles7c.cnadmin.common.constant.CacheConstants;
import top.charles7c.cnadmin.common.model.query.SortQuery;
import top.charles7c.cnadmin.common.model.resp.LabelValueResp;
Expand All @@ -59,6 +58,7 @@
import top.charles7c.cnadmin.system.model.query.RoleQuery;
import top.charles7c.cnadmin.system.model.resp.RoleResp;
import top.charles7c.cnadmin.system.service.*;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;

/**
* 公共 API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import cn.dev33.satoken.annotation.SaCheckPermission;

import top.charles7c.cnadmin.common.config.properties.ProjectProperties;
import top.charles7c.cnadmin.common.model.query.PageQuery;
import top.charles7c.cnadmin.common.model.resp.PageDataResp;
import top.charles7c.cnadmin.common.model.resp.R;
Expand All @@ -42,6 +41,7 @@
import top.charles7c.cnadmin.tool.model.req.GenConfigReq;
import top.charles7c.cnadmin.tool.model.resp.TableResp;
import top.charles7c.cnadmin.tool.service.GeneratorService;
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;

/**
* 代码生成 API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ local-storage:
avatarMaxSizeInMb: 5
## Windows 系统本地存储配置
windows:
file: C:\${project.appName}\data\file\
avatar: C:\${project.appName}\data\avatar\
file: C:\${project.app-name}\data\file\
avatar: C:\${project.app-name}\data\avatar\
## Linux 系统本地存储配置
linux:
file: ./data/file/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ local-storage:
avatarMaxSizeInMb: 5
## Windows 系统本地存储配置
windows:
file: C:\${project.appName}\data\file\
avatar: C:\${project.appName}\data\avatar\
file: C:\${project.app-name}\data\file\
avatar: C:\${project.app-name}\data\avatar\
## Linux 系统本地存储配置
linux:
file: ../data/file/
Expand Down
26 changes: 13 additions & 13 deletions continew-admin-webapi/src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ project:
# 名称
name: ContiNew Admin
# 应用名称
appName: continew-admin
app-name: continew-admin
# 版本
version: 2.1.0-SNAPSHOT
# 描述
description: ContiNew Admin 中后台管理框架/脚手架,Continue New Admin,持续以最新流行技术栈构建,拥抱变化,迭代优化。
# 基本包
basePackage: top.charles7c.cnadmin
base-package: top.charles7c.cnadmin
## 作者信息配置
contact:
name: Charles7c
Expand All @@ -19,8 +19,8 @@ project:
license:
name: Apache-2.0
url: https://github.com/Charles7c/continew-admin/blob/dev/LICENSE
# 是否本地解析 IP 归属地
ipAddrLocalParseEnabled: true
# 是否启用本地解析 IP 归属地
ip-addr-local-parse-enabled: true

--- ### 日志配置(重叠部分,优先级高于 logback-spring.xml 中的配置)
logging:
Expand All @@ -47,31 +47,31 @@ springdoc:
group-configs:
- group: 'all'
paths-to-match: '/**'
packages-to-scan: ${project.basePackage}.webapi.controller
packages-to-scan: ${project.base-package}.webapi.controller
- group: 'auth'
display-name: '系统认证'
paths-to-match:
- '/auth/**'
- '/oauth/**'
packages-to-scan: ${project.basePackage}.webapi.controller.auth
packages-to-scan: ${project.base-package}.webapi.controller.auth
- group: 'common'
display-name: '通用接口'
paths-to-match:
- '/common/**'
- '/dashboard/**'
packages-to-scan: ${project.basePackage}.webapi.controller.common
packages-to-scan: ${project.base-package}.webapi.controller.common
- group: 'system'
display-name: '系统管理'
paths-to-match: '/system/**'
packages-to-scan: ${project.basePackage}.webapi.controller.system
packages-to-scan: ${project.base-package}.webapi.controller.system
- group: 'tool'
display-name: '系统工具'
paths-to-match: '/tool/**'
packages-to-scan: ${project.basePackage}.webapi.controller.tool
packages-to-scan: ${project.base-package}.webapi.controller.tool
- group: 'monitor'
display-name: '系统监控'
paths-to-match: '/monitor/**'
packages-to-scan: ${project.basePackage}.webapi.controller.monitor
packages-to-scan: ${project.base-package}.webapi.controller.monitor
## 接口文档增强配置
knife4j:
enable: true
Expand Down Expand Up @@ -114,7 +114,7 @@ mybatis-plus:
# Mapper XML 文件目录配置
mapper-locations: classpath*:/mapper/**/*Mapper.xml
# 类型别名扫描包配置
type-aliases-package: ${project.basePackage}.**.model
type-aliases-package: ${project.base-package}.**.model
configuration:
# MyBatis 自动映射策略
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
Expand All @@ -135,7 +135,7 @@ mybatis-plus:
extension:
enabled: true
# Mapper 接口扫描包配置
mapper-package: ${project.basePackage}.**.mapper
mapper-package: ${project.base-package}.**.mapper
# 数据权限实现
data-permission-handler-impl: top.charles7c.cnadmin.common.config.mybatis.DataPermissionHandlerImpl
# 分页插件配置
Expand Down Expand Up @@ -166,7 +166,7 @@ server:
--- ### Spring 配置
spring:
application:
name: ${project.appName}
name: ${project.app-name}
## 环境配置
profiles:
# 启用的环境
Expand Down
Loading

0 comments on commit feef427

Please sign in to comment.