-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(3.10.0): Init * fix(3.10.1): Profile * build(3.10.1): docker-compose * build(3.10.1): init * refactor(3.10.2): remove redisEnable fix: init * refactor(3.10.2): remove redisEnable fix: init * feat(3.10.3): feat: initOtherSchema * feat(3.10.3): feat: initOtherSchema * refactor(3.10.4): feat: 提取方法 * fix(3.10.4): remove stringRedisUtil * refactor(3.10.4): mv docs 注释 * build(3.10.4): fix test * refactor(3.10.5): refactor 抽取方法 修改日志文件到~/.api/ 修改dockerfile * chore(deps): bump spring-boot-starter-parent from 2.7.5 to 3.0.0 Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.7.5 to 3.0.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.7.5...v3.0.0) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * refactor(3.10.0): Init * fix(3.10.1): Profile * build(3.10.1): docker-compose * build(3.10.1): init * refactor(3.10.2): remove redisEnable fix: init * feat(3.10.3): feat: initOtherSchema * feat(3.10.3): feat: initOtherSchema * refactor(3.10.4): feat: 提取方法 * fix(3.10.4): remove stringRedisUtil * refactor(3.10.4): mv docs 注释 * build(3.10.4): fix test * refactor(3.10.5): refactor 抽取方法 修改日志文件到~/.api/ 修改dockerfile * chore(deps): bump aspectjweaver from 1.9.9.1 to 1.9.19 Bumps [aspectjweaver](https://github.com/eclipse/org.aspectj) from 1.9.9.1 to 1.9.19. - [Release notes](https://github.com/eclipse/org.aspectj/releases) - [Commits](https://github.com/eclipse/org.aspectj/commits) --- updated-dependencies: - dependency-name: org.aspectj:aspectjweaver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * chore(deps): bump spring-boot-starter-parent from 2.7.5 to 3.0.1 Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.7.5 to 3.0.1. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.7.5...v3.0.1) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * refactor(3.10.5): springboot3 * chore(deps): bump smart-doc-maven-plugin from 2.6.2 to 2.6.3 (#45) * Create dependabot.yml (#40) * chore(deps): bump springdoc-openapi-ui from 1.6.12 to 1.6.13 (#43) Bumps [springdoc-openapi-ui](https://github.com/springdoc/springdoc-openapi) from 1.6.12 to 1.6.13. - [Release notes](https://github.com/springdoc/springdoc-openapi/releases) - [Changelog](https://github.com/springdoc/springdoc-openapi/blob/master/CHANGELOG.md) - [Commits](springdoc/springdoc-openapi@v1.6.12...v1.6.13) --- updated-dependencies: - dependency-name: org.springdoc:springdoc-openapi-ui dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump hutool-all from 5.8.9 to 5.8.10 (#41) Bumps [hutool-all](https://github.com/looly/hutool) from 5.8.9 to 5.8.10. - [Release notes](https://github.com/looly/hutool/releases) - [Changelog](https://github.com/dromara/hutool/blob/v5-master/CHANGELOG.md) - [Commits](dromara/hutool@5.8.9...5.8.10) --- updated-dependencies: - dependency-name: cn.hutool:hutool-all dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump dockerfile-maven-plugin from 1.4.9 to 1.4.13 (#44) Bumps [dockerfile-maven-plugin](https://github.com/spotify/dockerfile-maven) from 1.4.9 to 1.4.13. - [Release notes](https://github.com/spotify/dockerfile-maven/releases) - [Changelog](https://github.com/spotify/dockerfile-maven/blob/master/CHANGELOG.md) - [Commits](spotify/dockerfile-maven@v1.4.9...v1.4.13) --- updated-dependencies: - dependency-name: com.spotify:dockerfile-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump smart-doc-maven-plugin from 2.6.2 to 2.6.3 Bumps [smart-doc-maven-plugin](https://github.com/smart-doc-group/smart-doc-maven-plugin) from 2.6.2 to 2.6.3. - [Release notes](https://github.com/smart-doc-group/smart-doc-maven-plugin/releases) - [Changelog](https://github.com/smart-doc-group/smart-doc-maven-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/smart-doc-group/smart-doc-maven-plugin/commits) --- updated-dependencies: - dependency-name: com.github.shalousun:smart-doc-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: 冰彦糖 <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
97c59fe
commit c27d4c8
Showing
65 changed files
with
26,521 additions
and
2,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# 基础镜像 | ||
FROM openjdk:8-jdk-alpine | ||
FROM openjdk:17-jdk-alpine | ||
|
||
# 作者信息 | ||
MAINTAINER BingChunMoLi <[email protected]> | ||
|
||
# 添加一个存储空间 | ||
VOLUME /api | ||
VOLUME ~/.api/ | ||
|
||
# 暴露8090端口 | ||
EXPOSE 8090 | ||
|
@@ -14,7 +14,7 @@ EXPOSE 8090 | |
ARG JAR_FILE | ||
|
||
# 往容器中添加jar包 | ||
ADD /target/${JAR_FILE} /api/app.jar | ||
ADD /target/${JAR_FILE} ~/.api/app.jar | ||
|
||
# 启动镜像自动运行程序 | ||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","/api/app.jar"] | ||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","~/.api/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: 3.8 | ||
services: | ||
moliapi: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8090:8090" | ||
depends_on: | ||
- mysql | ||
- redis | ||
links: | ||
- mysql | ||
- redis | ||
mysql: | ||
image: mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: password | ||
volumes: | ||
- ~/.api/mysql/data/:/var/lib/mysql | ||
- ~/.api/mysql/conf/:/etc/mysql | ||
- ~/.api/mysql/log/:/var/log/mysql | ||
ports: | ||
- "3306:3006" | ||
command: | ||
- --character-set-server=utf8mb4 | ||
- --collation-server=utf8mb4_general_ci | ||
redis: | ||
image: redis | ||
ports: | ||
- "6379:6379" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
package com.bingchunmoli.api.bean; | ||
|
||
import org.springframework.util.ResourceUtils; | ||
|
||
/** | ||
* Api常量 | ||
* | ||
* @author BingChunMoLi | ||
*/ | ||
public class ApiConstant { | ||
public static final String YI_YAN = "yiYan"; | ||
public static final String SHI_CI = "shiCi"; | ||
public static final String YI_YAN_TABLE_NAME = "yi_yan"; | ||
public static final String SHI_CI_TABLE_NAME = "shi_ci"; | ||
public static final String PC_IMG = "pc"; | ||
public static final String MOBILE_IMG = "mobile"; | ||
public static final String SCHEMA_PATH_PREFIX = ResourceUtils.CLASSPATH_URL_PREFIX + "db/schema-"; | ||
public static final String DATA_PATH_PREFIX = ResourceUtils.CLASSPATH_URL_PREFIX + "db/data-"; | ||
public static final String SQL_PATH_SUFFIX = ".sql"; | ||
public static final String YI_YAN_DATA_PATH = ResourceUtils.CLASSPATH_URL_PREFIX + "db/yiyan.data"; | ||
public static final String SHI_CI_DATA_PATH = ResourceUtils.CLASSPATH_URL_PREFIX + "db/shici.data"; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.bingchunmoli.api.bean; | ||
|
||
import com.bingchunmoli.api.bean.enums.DriveType; | ||
|
||
|
||
public record Init(DriveType driveType, String activeDataFilePath, String activeSchemaPath, String activeDataPath) { | ||
|
||
} | ||
//todo 功能开关? |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/bingchunmoli/api/bean/enums/DriveType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.bingchunmoli.api.bean.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* 数据库类型 | ||
* @author MoLi | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum DriveType { | ||
/** | ||
* 数据库类型 | ||
*/ | ||
NONE(0, "NONE"), MYSQL(1, "MYSQL"), H2(2, "H2"); | ||
|
||
private final int type; | ||
private final String driveName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/bingchunmoli/api/exception/ApiInitException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.bingchunmoli.api.exception; | ||
|
||
/** | ||
* @author MoLi | ||
*/ | ||
public class ApiInitException extends ApiException{ | ||
|
||
public ApiInitException(String msg) { | ||
super(msg); | ||
} | ||
|
||
public ApiInitException(Throwable e) { | ||
super(e); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/bingchunmoli/api/host/controller/HostController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/com/bingchunmoli/api/init/ApiCommandLineRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.bingchunmoli.api.init; | ||
|
||
import com.bingchunmoli.api.bean.MailMessage; | ||
import com.bingchunmoli.api.even.MailMessageEven; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.context.ApplicationEventPublisher; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Map; | ||
|
||
/** | ||
* 一言,诗词,随机图初始化 仅限prod环境 | ||
* @author BingChunMoLi | ||
*/ | ||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class ApiCommandLineRunner implements CommandLineRunner { | ||
private final ApplicationEventPublisher applicationEventPublisher; | ||
private final Map<String, InitService> initServiceMap; | ||
|
||
@Override | ||
public void run(String... args) { | ||
for (InitService service:initServiceMap.values()) { | ||
service.init(); | ||
} | ||
applicationEventPublisher.publishEvent(new MailMessageEven(MailMessage.builder().title("系统初始化完成").body("系统初始化完成, 初始化当前时间:" + LocalDateTime.now()).build())); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/bingchunmoli/api/init/InitDataService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.bingchunmoli.api.init; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
/** | ||
* 初始化数据Service | ||
* @author MoLi | ||
*/ | ||
public interface InitDataService<T> extends InitSqlService { | ||
|
||
/** | ||
* 读取数据列表 | ||
* @return 数据列表 | ||
*/ | ||
List<T> readAll(); | ||
|
||
/** | ||
* 读取数据列表从文件 | ||
* @return 数据列表 | ||
*/ | ||
List<T> readAllDataByFile(); | ||
|
||
/** | ||
* 读取数据列表从文件 | ||
* @return 数据列表 | ||
*/ | ||
List<T> readAllDataByFile(Path path); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.bingchunmoli.api.init; | ||
|
||
/** | ||
* 初始化Service | ||
* @author MoLi | ||
*/ | ||
public interface InitService { | ||
|
||
/** | ||
* 初始化 | ||
*/ | ||
void init(); | ||
} |
Oops, something went wrong.