From 54769750a5c477be23038696d9da7c54f53f65fe Mon Sep 17 00:00:00 2001 From: fanzongzhe <285169773@qq.com> Date: Mon, 3 Jun 2024 08:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=BD=A6=E9=98=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=BE=AE=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 6 ++ yxt-vehfleet/pom.xml | 92 +++++++++++++++++++ .../anrui/vehfleet/VehfleetApplication.java | 21 +++++ .../src/main/resources/application-devv.yml | 28 ++++++ .../src/main/resources/application-pro.yml | 28 ++++++ .../src/main/resources/application-test.yml | 29 ++++++ .../src/main/resources/application.yml | 62 +++++++++++++ yxt-vehfleet/src/main/resources/banner.txt | 13 +++ .../src/main/resources/logback-spring.xml | 50 ++++++++++ 9 files changed, 329 insertions(+) create mode 100644 yxt-vehfleet/pom.xml create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java create mode 100644 yxt-vehfleet/src/main/resources/application-devv.yml create mode 100644 yxt-vehfleet/src/main/resources/application-pro.yml create mode 100644 yxt-vehfleet/src/main/resources/application-test.yml create mode 100644 yxt-vehfleet/src/main/resources/application.yml create mode 100644 yxt-vehfleet/src/main/resources/banner.txt create mode 100644 yxt-vehfleet/src/main/resources/logback-spring.xml diff --git a/anrui-gateway/src/main/resources/application.yml b/anrui-gateway/src/main/resources/application.yml index 3784b8ef93..ede2858327 100644 --- a/anrui-gateway/src/main/resources/application.yml +++ b/anrui-gateway/src/main/resources/application.yml @@ -127,6 +127,12 @@ spring: uri: lb://yxt-sms filters: - StripPrefix=1 + - id: yxt-vehfleet + predicates: + - Path= /vehfleet/** + uri: lb://yxt-vehfleet + filters: + - StripPrefix=1 ignore: whites: - /portal/v1/regions/treeList diff --git a/yxt-vehfleet/pom.xml b/yxt-vehfleet/pom.xml new file mode 100644 index 0000000000..c7a760a0b3 --- /dev/null +++ b/yxt-vehfleet/pom.xml @@ -0,0 +1,92 @@ + + + + + com.yxt + yxt-parent + 0.0.1 + + + + 4.0.0 + + com.yxt.anrui + yxt-vehfleet + 0.0.1 + + yxt-vehfleet + + + + + com.yxt + yxt-common-base + 0.0.1 + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + mysql + mysql-connector-java + runtime + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-annotation + + + org.projectlombok + lombok + 1.18.24 + true + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + src/main/java + + **/*Mapper.xml + + + + src/main/resources + + **/*.* + + false + + + + + + diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java new file mode 100644 index 0000000000..1d0b07b5cb --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java @@ -0,0 +1,21 @@ +package com.yxt.anrui.vehfleet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 车队管理服务 + */ +@EnableDiscoveryClient +@SpringBootApplication(scanBasePackages = { + "com.yxt.common.base.config", + "com.yxt.anrui.vehfleet" +}) +@EnableFeignClients(basePackages = {"com.yxt.*.*"}) +public class VehfleetApplication { + public static void main(String[] args) { + SpringApplication.run(VehfleetApplication.class, args); + } +} diff --git a/yxt-vehfleet/src/main/resources/application-devv.yml b/yxt-vehfleet/src/main/resources/application-devv.yml new file mode 100644 index 0000000000..67d0060893 --- /dev/null +++ b/yxt-vehfleet/src/main/resources/application-devv.yml @@ -0,0 +1,28 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/yxt_vehfleet?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + username: root + password: root + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: 123456 + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + +image: + upload: + path: D:\\anrui\\upload\\ + url: + prefix: http://192.168.0.107:8111/upload/ diff --git a/yxt-vehfleet/src/main/resources/application-pro.yml b/yxt-vehfleet/src/main/resources/application-pro.yml new file mode 100644 index 0000000000..8aead055d3 --- /dev/null +++ b/yxt-vehfleet/src/main/resources/application-pro.yml @@ -0,0 +1,28 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://120.46.172.184:3306/yxt_vehfleet?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: '@anrui18033887500' + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: 123456 + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + +image: + upload: + path: D:\anrui\upload\ + url: + prefix: http://120.46.172.184/api/upload/ diff --git a/yxt-vehfleet/src/main/resources/application-test.yml b/yxt-vehfleet/src/main/resources/application-test.yml new file mode 100644 index 0000000000..0e7b50bdcb --- /dev/null +++ b/yxt-vehfleet/src/main/resources/application-test.yml @@ -0,0 +1,29 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.18.0.4:3306/yxt_vehfleet?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + username: root + password: yxt_mysql_138 + cloud: + nacos: + discovery: + server-addr: 172.18.0.5:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 172.18.0.7 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: 123456 + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + +image: + upload: + path: /home/lzh/docker_data/nginx/html/anrui-system-ui/upload/ + url: + prefix: http://anrui.yyundong.com/upload/ + diff --git a/yxt-vehfleet/src/main/resources/application.yml b/yxt-vehfleet/src/main/resources/application.yml new file mode 100644 index 0000000000..415122417d --- /dev/null +++ b/yxt-vehfleet/src/main/resources/application.yml @@ -0,0 +1,62 @@ +spring: + application: + name: yxt-vehfleet + profiles: + active: devv + messages: + # 国际化资源文件路径 + basename: i18n/messages + servlet: + #上传文件 + multipart: + max-file-size: 50MB + max-request-size: 100MB + devtools: + restart: + # 热部署开关 + enabled: true + mvc: + async: + request-timeout: 20000 + + + +server: + port: 7307 + max-http-header-size: 102400 + tomcat: + max-http-form-post-size: -1 +#mybatis +mybatis-plus: + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapper-locations: classpath*:**Mapper.xml + global-config: + refresh: true + db-config: + #定义生成ID的类型 + id-type: Auto + db-type: mysql + configuration: + map-underscore-to-camel-case: false + cache-enabled: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +#hystrix的超时时间 +hystrix: + command: + default: + execution: + timeout: + enabled: true + isolation: + thread: + timeoutInMilliseconds: 60000 +#ribbon的超时时间 +ribbon: + ReadTimeout: 60000 + ConnectTimeout: 60000 + + + + diff --git a/yxt-vehfleet/src/main/resources/banner.txt b/yxt-vehfleet/src/main/resources/banner.txt new file mode 100644 index 0000000000..98e44c5880 --- /dev/null +++ b/yxt-vehfleet/src/main/resources/banner.txt @@ -0,0 +1,13 @@ + ,----.. ____ + / / \ ,' , `. +| : : ,---. ,-+-,.' _ | ,---. ,---, +. | ;. / ' ,'\ ,-+-. ; , || ' ,'\ ,-+-. / | +. ; /--` / / | ,--.'|' | || ,---. / / | ,--.'|' | +; | ; . ; ,. :| | ,', | |,/ \ . ; ,. :| | ,"' | +| : | ' | |: :| | / | |--'/ / | ' | |: :| | / | | +. | '___' | .; :| : | | , . ' / | ' | .; :| | | | | +' ; : .'| : || : | |/ ' ; /| | : || | | |/ +' | '/ :\ \ / | | |`-' ' | / | \ \ / | | |--' +| : / `----' | ;/ | : | `----' | |/ + \ \ .' '---' \ \ / '---' + `---` `----' diff --git a/yxt-vehfleet/src/main/resources/logback-spring.xml b/yxt-vehfleet/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..d74a0b15a3 --- /dev/null +++ b/yxt-vehfleet/src/main/resources/logback-spring.xml @@ -0,0 +1,50 @@ + + + + + + + + + + %yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%blue(%msg%n) + + + + + + + + + + + + + + + ${log.base}.log + + ${log.base}.%d{yyyyMMdd}.%i.log.zip + + + + 1MB + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} + -%msg%n + + + + + + + + + + \ No newline at end of file