Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
34a221d
父pom添加jacoco插件依赖,用于统计单元测试覆盖率
bruceblink Jun 5, 2025
b5bb754
admin模块引入jacoco插件及配置
bruceblink Jun 5, 2025
bc3fde7
删除IpUtil中的e.printStackTrace()
bruceblink Jun 5, 2025
b3cad29
更新testI18nKey()单元测试
bruceblink Jun 5, 2025
f742a2c
common模块引入单元测试的相关依赖
bruceblink Jun 5, 2025
3dc768a
删除admin和common模块中无用maven的插件
bruceblink Jun 5, 2025
6847836
domain模块增加jacoco插件查看单元测试覆盖率
bruceblink Jun 10, 2025
42d4403
更新RateLimitTypeTest的单元测试用例
bruceblink Jun 10, 2025
263fcad
添加docker搭建开发环境的相关配置
bruceblink Jun 10, 2025
f9fa68d
更新mysql的端口号
bruceblink Jun 10, 2025
cd48a4d
添加agileboot数据库的创建sql
bruceblink Jun 10, 2025
6981e6d
给sql脚本添加序号,初始化时按顺序执行,更新sql脚本,指定数据库
bruceblink Jun 10, 2025
abb942a
更新admin模块中的数据库链接为agileboot,与docker-compose中的保持一致
bruceblink Jun 10, 2025
3bacd8b
更新docker-compose中mysql和redis的container_name,避免与已存在的mysql和redis重复无法启动
bruceblink Jun 10, 2025
0fcd05c
忽略mysql和redis持久化生成的data数据
bruceblink Jun 10, 2025
613cdf4
更新readme,增加docker-compose的使用说明
bruceblink Jun 10, 2025
9e13811
跳过admin和common模块中的单元测试
bruceblink Jun 10, 2025
ad757cf
Merge branch 'main' into dev
bruceblink Jun 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ nbdist/

/agileboot-admin/src/main/resources/application-prod.yml

data
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ git clone https://github.com/valarchie/AgileBoot-Front-End

#### 安装好Mysql和Redis

已经支持docker一键启动mysql和redis的docker实例,无需本机下载安装。使用方式:

- 安装[docker desktop](https://www.docker.com/products/docker-desktop/)(可选)

- 在linux服务器或者直接运行[docker/run.md](docker/run.md)(如果已经安装了docker desktop)中的如下命令

```bash
docker-compose -f docker-compose.yml -p agile-boot up -d
```

#### 后端启动
```
Expand Down Expand Up @@ -193,6 +202,7 @@ ready in 4376ms.

> 对于想要尝试全栈项目的前端人员,这边提供更简便的后端启动方式,无需配置Mysql和Redis直接启动
#### 无Mysql/Redis 后端启动

```
1. 找到agilboot-admin模块下的resource文件中的application.yml文件

Expand All @@ -214,8 +224,9 @@ agileboot.embedded.redis: true
```


## 🙊 系统内置功能 🙊


## 🙊 系统内置功能 🙊


🙂 大部分功能,均有通过 **单元测试** **集成测试** 保证质量。

Expand Down Expand Up @@ -299,7 +310,7 @@ agileboot



---
---

## 🎅 技术文档 🎅
* [AgileBoot - 基于SpringBoot + Vue3的前后端快速开发脚手架](https://juejin.cn/post/7152871067151777829)
Expand Down
27 changes: 20 additions & 7 deletions agileboot-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -58,13 +54,30 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<!-- 想跑test的话 设置成false -->
<configuration>
<skipTests>false</skipTests>
<skipTests>true</skipTests>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion agileboot-admin/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spring:
datasource:
# 主库数据源
master:
url: jdbc:mysql://localhost:33067/agileboot-pure?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:33067/agileboot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 12345
# 从库数据源
Expand Down
34 changes: 34 additions & 0 deletions agileboot-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,38 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<!-- 想跑test的话 设置成false -->
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static boolean isLocalHost(String ipAddress) {
ia = InetAddress.getByAddress(ip);
} catch (UnknownHostException e) {
log.error("解析Ip失败", e);
e.printStackTrace();
}
if (ia == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class ErrorCodeInterfaceTest {
@Test
void testI18nKey() {
String i18nKey = Client.COMMON_FORBIDDEN_TO_CALL.i18nKey();
Assertions.assertEquals("20001_COMMON_FORBIDDEN_TO_CALL", i18nKey);
Assertions.assertEquals("Client.COMMON_FORBIDDEN_TO_CALL", i18nKey);
}
}
34 changes: 34 additions & 0 deletions agileboot-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,38 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<!-- 想跑test的话 设置成false -->
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void testCombinedKey() {

String combinedKey = LimitType.GLOBAL.generateCombinedKey(mockLimit);

Assertions.assertEquals("Test-GLOBAL", combinedKey);
Assertions.assertEquals("TestGLOBAL", combinedKey);
}

}
41 changes: 41 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@


version: '3'

# 创建一个名为 "agileboot" 的桥接网络
networks:
agileboot:
driver: bridge

services:
mysql:
image: mysql:8.0.29
container_name: mysql8
restart: unless-stopped # 重启策略:除非手动停止容器,否则自动重启
environment:
- TZ=Asia/Shanghai
- LANG= en_US.UTF-8
- MYSQL_ROOT_PASSWORD=12345 #设置 root 用户的密码
volumes:
- ./mysql/conf/my.cnf:/etc/my.cnf # 挂载 my.cnf 文件到容器的指定路径
- ./mysql/data:/var/lib/mysql # 持久化 MySQL 数据
- ../sql/mysql8:/docker-entrypoint-initdb.d # 初始化 SQL 脚本目录
ports:
- 33067:3306 # 暴露 33067 端口
networks:
- agileboot # 加入 "agileboot" 网络

redis:
image: redis:7.2.3
container_name: redis7
restart: unless-stopped # 重启策略:除非手动停止容器,否则自动重启
command: redis-server /etc/redis/redis.conf --requirepass 12345 --appendonly no # 启动 Redis 服务并添加密码为:123456,默认不开启 Redis AOF 方式持久化配置
environment:
- TZ=Asia/Shanghai
volumes:
- ./redis/data:/data
- ./redis/config/redis.conf:/etc/redis/redis.conf
ports:
- 36379:6379
networks:
- agileboot # 加入 "agileboot" 网络
41 changes: 41 additions & 0 deletions docker/mysql/conf/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 服务端参数配置
[mysqld]
skip-name-resolve
user=mysql # MySQL启动用户
default-storage-engine=INNODB # 创建新表时将使用的默认存储引擎
character-set-server=utf8mb4 # 设置mysql服务端默认字符集
collation-server = utf8mb4_general_ci # 数据库字符集对应一些排序等规则,注意要和character-set-server对应

pid-file = /var/lib/mysql/mysqld.pid # pid文件所在目录
socket = /var/lib/mysql/mysqld.sock # 用于本地连接的socket套接字
datadir = /var/lib/mysql # 数据文件存放的目录
bind-address = 127.0.0.1 # MySQL绑定IP
expire_logs_days= 7 # 定义清除过期日志的时间(这里设置为7天)

# 设置client连接mysql时的字符集,防止乱码
init_connect='SET NAMES utf8mb4'

# 是否对sql语句大小写敏感,1表示不敏感
lower_case_table_names = 1

# 执行sql的模式,规定了sql的安全等级, 暂时屏蔽,my.cnf文件中配置报错
#sql_mode = STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

# 事务隔离级别,默认为可重复读,mysql默认可重复读级别(此级别下可能参数很多间隙锁,影响性能)
transaction_isolation = READ-COMMITTED

# TIMESTAMP如果没有显示声明NOT NULL,允许NULL值
explicit_defaults_for_timestamp = true

#它控制着mysqld进程能使用的最大文件描述(FD)符数量。
#需要注意的是这个变量的值并不一定是你设定的值,mysqld会在系统允许的情况下尽量获取更多的FD数量
open_files_limit = 65535

# 允许最大连接数
max_connections=200

#最大错误连接数
max_connect_errors = 1000

[client]
default-character-set=utf8mb4 # 设置mysql客户端默认字符集
Loading
Loading