diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/.gitignore" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/.gitignore"
new file mode 100644
index 0000000000000000000000000000000000000000..9ac53673cbfcb8ac953665716cb63a60804df2de
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/.gitignore"
@@ -0,0 +1,7 @@
+target/
+logs/
+.classpath
+.project
+.settings
+.factorypath
+upload/
\ No newline at end of file
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/Dockerfile" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/Dockerfile"
new file mode 100644
index 0000000000000000000000000000000000000000..1c493477a0c6548b84acce328b4d947851baac57
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/Dockerfile"
@@ -0,0 +1,15 @@
+#基础镜像
+FROM adoptopenjdk/openjdk8-openj9:alpine-slim
+
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
+
+#拷贝发布包
+COPY target/*.jar /root/app.jar
+
+#指定交互端口
+EXPOSE 8080
+
+CMD ["--server.port=8080"]
+
+#项目的启动方式
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Xshareclasses", "-Xquickstart", "-jar", "/root/app.jar"]
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/README.md" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..e8ceeba4283f5f2646970f1cf107f9fe93190ded
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/README.md"
@@ -0,0 +1,96 @@
+# springboot-git
+
+springboot工程操作git
+
+
+
+
+最新版本已支持docker镜像部署,完整的编排文件以及启动脚本见docker目录。
+
+# 一、docker部署过程
+
+## 1. 上传docker目录到安装了docker环境的服务器
+
+目录结构
+
+```shell
+├── docker-compose.yml
+├── restart.sh
+├── restart-simple.sh
+└── stop.sh
+
+```
+
+## 2. 运行命令启动容器
+
+```shell
+sh restart.sh
+```
+
+输出结果如下:
+
+```sh
+[root@00fly docker-git]# sh restart.sh
+[+] Running 9/9
+ ✔ git-web 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 21.6s
+ ✔ 97518928ae5f Already exists 0.0s
+ ✔ b109695f6e59 Already exists 0.0s
+ ✔ 3ac0199bf17e Already exists 0.0s
+ ✔ 14cce039e329 Already exists 0.0s
+ ✔ 1bc1e3a5cc47 Already exists 0.0s
+ ✔ afe7d63db613 Pull complete 0.2s
+ ✔ 18a218fb6784 Pull complete 20.3s
+ ✔ git-simple Pulled 21.6s
+[+] Running 2/3
+ ⠴ Network docker-git_default Created 0.5s
+ ✔ Container git-web Started 0.4s
+ ✔ Container git-simple Started
+```
+
+输入`docker ps`查看,可以看到启动了2个服务,如**8082**端口被占用,请自行修改`docker-compose.yml`
+
+
+
+为什么启动2个服务?
+- git-web是我们通过接口配置git参数,一旦参数配置完成后,便可以关了他。
+- git-simple是日常后台执行git推送,无需开放端口。
+
+# 二、操作指南
+
+配置地址:http://{ip}:8082/doc.html
+
+## 1. 设置请求token
+如提示:禁止访问,token信息不合法,按下述步骤操作:
+
+- 查看后台日志
+
+
+- 请求头设置token
+
+
+- 刷新页面
+
+
+## 2. 设置git仓库参数,支持设置多个仓库
+
+
+注意: **git项目根目录下一定要创建 README.md文件,此程序会自动替换最后一行内容为提交时间戳。**
+
+## 3. 设置运行时间
+
+
+## 4. 测试一次远程提交
+
+
+## 5. 查看运行时间
+
+
+
+# 三.主要涉及技术点
+ 1. jgit
+ 2. swagger使用
+ 3. 定时任务cron
+ 4. 文件读写
+ 5. 统一异常处理
+ 6. log4j2日志
+
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/docker-compose.yml" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/docker-compose.yml"
new file mode 100644
index 0000000000000000000000000000000000000000..20f0cfa4d8353fab802eaf4c13cd0c4f338e49bb
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/docker-compose.yml"
@@ -0,0 +1,46 @@
+version: '3.7'
+services:
+ git-web:
+ image: registry.cn-shanghai.aliyuncs.com/00fly/springboot-git:1.0.0
+ container_name: git-web
+ deploy:
+ resources:
+ limits:
+ cpus: '1.0'
+ memory: 200M
+ reservations:
+ cpus: '0.05'
+ memory: 200M
+ ports:
+ - 8080:8080
+ environment:
+ - white.list=127.0.0.1,101.224.211.68
+ restart: on-failure
+ volumes:
+ - ./data/:/root/data/
+ logging:
+ driver: json-file
+ options:
+ max-size: '5m'
+ max-file: '1'
+
+ git-simple:
+ image: registry.cn-shanghai.aliyuncs.com/00fly/springboot-git:1.0.0
+ container_name: git-simple
+ command: '--noweb'
+ deploy:
+ resources:
+ limits:
+ cpus: '2'
+ memory: 200M
+ reservations:
+ cpus: '0.05'
+ memory: 150M
+ restart: on-failure
+ volumes:
+ - ./data/:/root/data/
+ logging:
+ driver: json-file
+ options:
+ max-size: '5m'
+ max-file: '1'
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart-simple.sh" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart-simple.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..f920e15141efa5e07d97397285b1f36c02d60f79
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart-simple.sh"
@@ -0,0 +1,2 @@
+#!/bin/bash
+docker-compose down && docker-compose up -d git-simple && docker logs -f git-simple
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart.sh" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..02d836d39a2187f90c97450a182730c8c6f3e101
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/restart.sh"
@@ -0,0 +1,2 @@
+#!/bin/bash
+docker-compose down && docker-compose up -d
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/stop.sh" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/stop.sh"
new file mode 100644
index 0000000000000000000000000000000000000000..86699d3f1759fb6ae75e8a3ca5e793407ad5ca3e
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/docker/stop.sh"
@@ -0,0 +1,2 @@
+#!/bin/bash
+docker-compose down
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/docker-ps.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/docker-ps.png"
new file mode 100644
index 0000000000000000000000000000000000000000..143b4770ec23c1c9c80f2249b07cb2065fb47e37
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/docker-ps.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/git-setup.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/git-setup.png"
new file mode 100644
index 0000000000000000000000000000000000000000..237f00a961e8d0e2e648d3c527f03fd59d868370
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/git-setup.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/image.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/image.png"
new file mode 100644
index 0000000000000000000000000000000000000000..ba5567832894ebb3e837650f0e9e022587183a86
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/image.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/log.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/log.png"
new file mode 100644
index 0000000000000000000000000000000000000000..4668e568c57ff4823ca98db5a45f97c368b344c1
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/log.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/remote-test.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/remote-test.png"
new file mode 100644
index 0000000000000000000000000000000000000000..0257e883cb78bc1c2ebd63854e63f42066565ba6
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/remote-test.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-setup.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-setup.png"
new file mode 100644
index 0000000000000000000000000000000000000000..8814e4a5fdd0a262ce827ae603e799f335d7cf1f
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-setup.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-show.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-show.png"
new file mode 100644
index 0000000000000000000000000000000000000000..6229f46de6ce2cceb01f9e308f976f79f552f7ff
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/times-show.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/token.png" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/token.png"
new file mode 100644
index 0000000000000000000000000000000000000000..592116643e55ee4d904c3439c30ac7e8d1e17345
Binary files /dev/null and "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/images/token.png" differ
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/pom.xml" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/pom.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..2f661faf741d9040b231f96a0c32533501559abb
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/pom.xml"
@@ -0,0 +1,175 @@
+
+
+ 4.0.0
+ com.fly
+ springboot-git
+ 1.0.0
+ jar
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.3.RELEASE
+
+
+
+
+ UTF-8
+ yyyyMMdd-HH
+ 1.8
+ true
+ registry.cn-shanghai.aliyuncs.com
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-log4j2
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+ 2.0.8
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+ org.aspectj
+ aspectjweaver
+
+
+ org.eclipse.jgit
+ org.eclipse.jgit
+ 5.13.1.202206130422-r
+
+
+
+
+ com.lmax
+ disruptor
+ 3.4.2
+
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.junit.vintage
+ junit-vintage-engine
+
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+ commons-io
+ commons-io
+ 2.8.0
+
+
+
+
+
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public/
+
+ true
+
+
+
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public/
+
+ true
+
+
+ false
+
+
+
+
+
+ ${project.artifactId}-${project.version}
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+ io.fabric8
+ docker-maven-plugin
+ 0.40.3
+
+
+ package
+
+ build
+ push
+ remove
+
+
+
+
+
+
+
+
+ ${docker.hub}
+
+
+ ${docker.hub}/00fly/${project.artifactId}:${project.version}-UTC-${maven.build.timestamp}
+
+ ${project.basedir}
+
+
+
+ ${docker.hub}/00fly/${project.artifactId}:${project.version}
+
+ ${project.basedir}
+
+
+
+ ${docker.hub}/00fly/${project.artifactId}
+
+ ${project.basedir}
+
+
+
+
+
+
+
+
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/GitApplication.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/GitApplication.java"
new file mode 100644
index 0000000000000000000000000000000000000000..2bdcbee15cee1dd6a7741e1dddf6fa04a8ec0781
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/GitApplication.java"
@@ -0,0 +1,47 @@
+package com.fly;
+
+import java.net.InetAddress;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.SystemUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.WebApplicationType;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@EnableScheduling
+@SpringBootApplication
+public class GitApplication
+{
+ @Value("${server.port}")
+ Integer port;
+
+ public static void main(String[] args)
+ {
+ boolean web = !ArrayUtils.contains(args, "--noweb");
+ log.info("############### with Web Configuration: {} #############", web);
+ new SpringApplicationBuilder(GitApplication.class).web(web ? WebApplicationType.SERVLET : WebApplicationType.NONE).run(args);
+ }
+
+ @Bean
+ @ConditionalOnWebApplication
+ CommandLineRunner openBrowser()
+ {
+ return args -> {
+ if (SystemUtils.IS_OS_WINDOWS && port > 0)
+ {
+ log.info("★★★★★★★★ now open Browser ★★★★★★★★ ");
+ String ip = InetAddress.getLocalHost().getHostAddress();
+ String url = "http://" + ip + ":" + port;
+ Runtime.getRuntime().exec("cmd /c start /min " + url);
+ }
+ };
+ }
+}
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/aspect/AuthAspect.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/aspect/AuthAspect.java"
new file mode 100644
index 0000000000000000000000000000000000000000..0b28f0b528a6d2e8bd23e4a7866f3bf0615b65da
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/aspect/AuthAspect.java"
@@ -0,0 +1,89 @@
+package com.fly.core.aspect;
+
+import java.util.Date;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.fly.core.entity.JsonResult;
+import com.fly.core.utils.HttpRequestUtils;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ *
+ * aop处理鉴权
+ *
+ * @author 00fly
+ * @version [版本号, 2022年11月29日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Slf4j
+@Aspect
+@Component
+public class AuthAspect
+{
+ private String token = null;
+
+ /**
+ * token有效时间(60分钟)
+ */
+ private Date tokenTime;
+
+ @Value("${white.list:127.0.0.1}")
+ private String whiteList;
+
+ /**
+ * 切入点com.fly.git.web包及子包和使用PostMapping注解标注的类
+ */
+ @Pointcut("within(com.fly.git.web..*) && @annotation(org.springframework.web.bind.annotation.PostMapping)")
+ public void point()
+ {
+ }
+
+ @Around("point()")
+ public Object around(ProceedingJoinPoint joinPoint)
+ throws Throwable
+ {
+ HttpServletRequest request = HttpRequestUtils.getHttpServletRequest();
+ if (request != null)
+ {
+ String ip = request.getRemoteAddr();
+ String token = request.getHeader("token");
+ log.info("★★★★★★★★ request ip: {}, head token : {}", ip, token);
+ if (!StringUtils.contains(whiteList, ip) && !StringUtils.equals(token, getToken()))
+ {
+ return JsonResult.error("禁止访问,请添加白名单IP:" + ip + "或设置合法token");
+ }
+ }
+ return joinPoint.proceed();
+ }
+
+ /**
+ * 获取token
+ *
+ * @return
+ * @see [类、类#方法、类#成员]
+ */
+ private synchronized String getToken()
+ {
+ Date now = new Date();
+ if (tokenTime == null || now.after(tokenTime))
+ {
+ token = UUID.randomUUID().toString().replace("-", "");
+ tokenTime = DateUtils.addMinutes(now, 60);
+ }
+ log.info("------ now valid token is: {}", token);
+ return token;
+ }
+}
\ No newline at end of file
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/DisableWebAutoConfig.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/DisableWebAutoConfig.java"
new file mode 100644
index 0000000000000000000000000000000000000000..e8023378e1d918454e6d72d558f373c19b25504b
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/DisableWebAutoConfig.java"
@@ -0,0 +1,24 @@
+package com.fly.core.config;
+
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWebApplication;
+import org.springframework.context.annotation.Configuration;
+
+import com.github.xiaoymin.knife4j.spring.configuration.Knife4jAutoConfiguration;
+
+/**
+ *
+ * 非web环境下禁用AutoConfiguration
+ *
+ * @author 00fly
+ * @version [版本号, 2023年4月4日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Configuration
+@ConditionalOnNotWebApplication
+@EnableAutoConfiguration(exclude = Knife4jAutoConfiguration.class)
+public class DisableWebAutoConfig
+{
+
+}
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/Knife4jConfig.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/Knife4jConfig.java"
new file mode 100644
index 0000000000000000000000000000000000000000..e173faef2f60beb8f4ede003491c0a11e79c9512
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/Knife4jConfig.java"
@@ -0,0 +1,59 @@
+package com.fly.core.config;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+
+import io.swagger.annotations.ApiOperation;
+import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+/**
+ * knife4j
+ *
+ * @author jack
+ */
+@Configuration
+@EnableKnife4j
+@EnableSwagger2WebMvc
+@ConditionalOnWebApplication
+@Import(BeanValidatorPluginsConfiguration.class)
+public class Knife4jConfig
+{
+
+ @Value("${knife4j.enable: true}")
+ private boolean enable;
+
+ @Bean(value = "defaultApi2")
+ public Docket defaultApi2()
+ {
+ return new Docket(DocumentationType.SWAGGER_2).enable(enable)
+ .apiInfo(new ApiInfoBuilder().title("接口API").description("接口文档").termsOfServiceUrl("http://00fly.online/").contact(new Contact("xx", "xx", "xx")).version("1.0").build())
+ // 分组名称
+ .groupName("0.1版")
+ .select()
+ .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+ .paths(PathSelectors.any())
+ .build()
+ .securitySchemes(security());
+ }
+
+ private List security()
+ {
+ return Collections.singletonList(new ApiKey("token", "token", "header"));
+ }
+}
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/ScheduledExecutorConfig.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/ScheduledExecutorConfig.java"
new file mode 100644
index 0000000000000000000000000000000000000000..689336c16f3f167202df09cc0161ae877ee363e3
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/ScheduledExecutorConfig.java"
@@ -0,0 +1,25 @@
+package com.fly.core.config;
+
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.CustomizableThreadFactory;
+
+@Configuration
+public class ScheduledExecutorConfig
+{
+ /**
+ * 默认线程池的大小为1,配置线程池支持多个线程并发执行
+ *
+ * @return
+ * @see [类、类#方法、类#成员]
+ */
+ @Bean
+ public ScheduledExecutorService scheduledExecutorService()
+ {
+ // return Executors.newScheduledThreadPool(5);
+ return new ScheduledThreadPoolExecutor(5, new CustomizableThreadFactory("schedule-pool-"));
+ }
+}
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/WebMvcConfig.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/WebMvcConfig.java"
new file mode 100644
index 0000000000000000000000000000000000000000..0f9c29c0110148050e6e9f6be1d49f5f608f5e85
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/config/WebMvcConfig.java"
@@ -0,0 +1,85 @@
+package com.fly.core.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ *
+ * mvc配置
+ *
+ * @author 00fly
+ * @version [版本号, 2021年4月23日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Configuration
+@ConditionalOnWebApplication
+public class WebMvcConfig implements WebMvcConfigurer
+{
+ @Override
+ public void configureMessageConverters(final List> converters)
+ {
+ converters.add(stringHttpMessageConverter());
+ converters.add(mappingJackson2HttpMessageConverter());
+ }
+
+ @Override
+ public void configureContentNegotiation(final ContentNegotiationConfigurer configurer)
+ {
+ configurer.defaultContentType(MediaType.APPLICATION_JSON);
+ configurer.ignoreUnknownPathExtensions(false);
+ configurer.favorPathExtension(true);
+ configurer.favorParameter(false);
+ final Map mediaTypes = new ConcurrentHashMap<>(3);
+ mediaTypes.put("atom", MediaType.APPLICATION_ATOM_XML);
+ mediaTypes.put("html", MediaType.TEXT_HTML);
+ mediaTypes.put("json", MediaType.APPLICATION_JSON);
+ configurer.mediaTypes(mediaTypes);
+ }
+
+ @Bean
+ StringHttpMessageConverter stringHttpMessageConverter()
+ {
+ return new StringHttpMessageConverter();
+ }
+
+ @Bean
+ MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter()
+ {
+ final MappingJackson2HttpMessageConverter messageConverter = new MappingJackson2HttpMessageConverter();
+ final List list = new ArrayList<>();
+ list.add(MediaType.APPLICATION_JSON);
+ list.add(MediaType.APPLICATION_XML);
+ list.add(MediaType.TEXT_PLAIN);
+ list.add(MediaType.TEXT_HTML);
+ list.add(MediaType.TEXT_XML);
+ messageConverter.setSupportedMediaTypes(list);
+ return messageConverter;
+ }
+
+ /**
+ * 等价于mvc中
+ * 等价于mvc中
+ *
+ * @param registry
+ */
+ @Override
+ public void addViewControllers(final ViewControllerRegistry registry)
+ {
+ registry.addViewController("/").setViewName("redirect:doc.html");
+ registry.addViewController("/index").setViewName("index.html");
+ }
+}
diff --git "a/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/entity/JsonResult.java" "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/entity/JsonResult.java"
new file mode 100644
index 0000000000000000000000000000000000000000..9542c9a990cd324476c5af4f79ef7fe623bdc221
--- /dev/null
+++ "b/Git\344\273\243\347\240\201\346\221\270\351\261\274-\347\250\213\345\272\217\347\214\277Git\351\241\271\347\233\256\344\273\243\347\240\201\350\207\252\345\212\250\346\217\220\344\272\244\347\245\236\345\231\250/src/main/java/com/fly/core/entity/JsonResult.java"
@@ -0,0 +1,65 @@
+package com.fly.core.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *
+ * 结果对象
+ *
+ * @author 00fly
+ * @version [版本号, 2021年5月2日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+@Data
+@ApiModel(description = "Json格式消息体")
+public class JsonResult
+{
+ @ApiModelProperty(value = "数据对象")
+ private T data;
+
+ @ApiModelProperty(value = "是否成功", required = true, example = "true")
+ private boolean success;
+
+ @ApiModelProperty(value = "错误码")
+ private String errorCode;
+
+ @ApiModelProperty(value = "提示信息")
+ private String message;
+
+ public JsonResult()
+ {
+ super();
+ }
+
+ public static JsonResult success(T data)
+ {
+ JsonResult r = new JsonResult<>();
+ r.setData(data);
+ r.setSuccess(true);
+ return r;
+ }
+
+ public static JsonResult> success()
+ {
+ JsonResult