commit 4d9147c10547ed97f609b0cc9be8675ebf100fcf Author: 冯凯 <371894675@qq.com> Date: Sun Nov 19 19:13:07 2023 +0800 init history module diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..09bdfea --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +###################################################################### +# Build Tools + +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + +target/ +!.mvn/wrapper/maven-wrapper.jar + +###################################################################### +# IDE + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### JRebel ### +rebel.xml +### NetBeans ### +nbproject/private/ +build/* +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +###################################################################### +# Others +*.log +*.xml.versionsBackup +*.swp + +!*/build/*.java +!*/build/*.html +!*/build/*.xml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8f53352 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +#起始镜像 +FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/openjdk:17-8.6 +#暴露端口号 +EXPOSE 10010 +#挂载目录的位置 +VOLUME /home/logs/dragon-vehicle-history +#构建复制外部文件到docker +COPY vehicle-history-server/target/vehicle-history-server.jar /home/app.jar +#工作目录 exec -it 进入容器内部后的默认的起始目录 +WORKDIR /home +ENV TIME_ZONE Asia/Shanghai +#指定东八区 +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +#启动java 程序 +ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-jar","/home/app.jar"] + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4be7000 --- /dev/null +++ b/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + com.dragon + dragon-modules + 3.6.3 + + + com.dragon + dragon-vehicle-history + 3.6.3 + pom + + dragon-vehicle-history车辆历史轨迹模块 + + + vehicle-history-common + vehicle-history-remote + vehicle-history-server + + + 17 + 17 + UTF-8 + + + diff --git a/vehicle-history-common/pom.xml b/vehicle-history-common/pom.xml new file mode 100644 index 0000000..7d7c2db --- /dev/null +++ b/vehicle-history-common/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + com.dragon + dragon-vehicle-history + 3.6.3 + + + vehicle-history-common + + + 17 + 17 + UTF-8 + + + + com.dragon + dragon-common-core + + + diff --git a/vehicle-history-remote/pom.xml b/vehicle-history-remote/pom.xml new file mode 100644 index 0000000..c4b96fb --- /dev/null +++ b/vehicle-history-remote/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.dragon + dragon-vehicle-history + 3.6.3 + + + vehicle-history-remote + + + 17 + 17 + UTF-8 + + + + com.dragon + vehicle-history-common + 3.6.3 + + + diff --git a/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/RemoteHistoryService.java b/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/RemoteHistoryService.java new file mode 100644 index 0000000..9268409 --- /dev/null +++ b/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/RemoteHistoryService.java @@ -0,0 +1,10 @@ +package com.dragon.vehicle.history.remote; + +/** + * @author 冯凯 + * @version 1.0 + * @description: + * @date 2023/11/19 19:02 + */ +public interface RemoteHistoryService { +} diff --git a/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/factory/RemoteHistoryServiceFallbackFactory.java b/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/factory/RemoteHistoryServiceFallbackFactory.java new file mode 100644 index 0000000..fc9fbf5 --- /dev/null +++ b/vehicle-history-remote/src/main/java/com/dragon/vehicle/history/remote/factory/RemoteHistoryServiceFallbackFactory.java @@ -0,0 +1,14 @@ +package com.dragon.vehicle.history.remote.factory; + +import com.dragon.vehicle.history.remote.RemoteHistoryService; +import org.springframework.stereotype.Component; + +/** + * @author 冯凯 + * @version 1.0 + * @description: + * @date 2023/11/19 19:03 + */ +@Component +public class RemoteHistoryServiceFallbackFactory implements RemoteHistoryService { +} diff --git a/vehicle-history-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/vehicle-history-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..a4f4c10 --- /dev/null +++ b/vehicle-history-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.dragon.vehicle.history.remote.factory.RemoteHistoryServiceFallbackFactory diff --git a/vehicle-history-server/pom.xml b/vehicle-history-server/pom.xml new file mode 100644 index 0000000..59559c4 --- /dev/null +++ b/vehicle-history-server/pom.xml @@ -0,0 +1,119 @@ + + + 4.0.0 + + com.dragon + dragon-vehicle-history + 3.6.3 + + + vehicle-history-server + + + 17 + 17 + UTF-8 + + + + com.dragon + vehicle-history-common + 3.6.3 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.dragon + dragon-common-datasource + + + + + com.dragon + dragon-common-datascope + + + + + com.dragon + dragon-common-log + + + + + com.dragon + dragon-common-swagger + + + + com.dragon + dragon-file-remote + + + com.dragon + dragon-system-common + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + org.apache.maven.pluginsmaven-compiler-plugin1616 + + + diff --git a/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/DragonVehicleHistoryApplication.java b/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/DragonVehicleHistoryApplication.java new file mode 100644 index 0000000..615dd90 --- /dev/null +++ b/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/DragonVehicleHistoryApplication.java @@ -0,0 +1,23 @@ +package com.dragon.vehicle.history.server; + +import com.dragon.common.security.annotation.EnableCustomConfig; +import com.dragon.common.security.annotation.EnableDragonFeignClients; +import com.dragon.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author 冯凯 + * @version 1.0 + * @description: + * @date 2023/11/19 18:59 + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableDragonFeignClients +@SpringBootApplication +public class DragonVehicleHistoryApplication { + public static void main(String[] args) { + SpringApplication.run(DragonVehicleHistoryApplication.class,args); + } +} diff --git a/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/mapper/HistoryMapper.java b/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/mapper/HistoryMapper.java new file mode 100644 index 0000000..b08ec0e --- /dev/null +++ b/vehicle-history-server/src/main/java/com/dragon/vehicle/history/server/mapper/HistoryMapper.java @@ -0,0 +1,13 @@ +package com.dragon.vehicle.history.server.mapper; + +import org.apache.ibatis.annotations.Mapper; + +/** + * @author 冯凯 + * @version 1.0 + * @description: + * @date 2023/11/19 18:59 + */ +@Mapper +public interface HistoryMapper { +} diff --git a/vehicle-history-server/src/main/resources/banner.txt b/vehicle-history-server/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/vehicle-history-server/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/vehicle-history-server/src/main/resources/bootstrap.yml b/vehicle-history-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..f7aed58 --- /dev/null +++ b/vehicle-history-server/src/main/resources/bootstrap.yml @@ -0,0 +1,28 @@ +# Tomcat +server: + port: 10010 + +# Spring +spring: + application: + # 应用名称 + name: dragon-vehicle-history + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 10.100.1.5:8848 + config: + # 配置中心地址 + server-addr: 10.100.1.5:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl diff --git a/vehicle-history-server/src/main/resources/logback.xml b/vehicle-history-server/src/main/resources/logback.xml new file mode 100644 index 0000000..d334b6f --- /dev/null +++ b/vehicle-history-server/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/vehicle-history-server/src/main/resources/mapper/history/HistoryMapper.xml b/vehicle-history-server/src/main/resources/mapper/history/HistoryMapper.xml new file mode 100644 index 0000000..d7ffe92 --- /dev/null +++ b/vehicle-history-server/src/main/resources/mapper/history/HistoryMapper.xml @@ -0,0 +1,6 @@ + + + + + +