diff --git a/.gitignore b/.gitignore index 0880771..a70b169 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,28 @@ +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + # ---> Maven target/ pom.xml.tag @@ -11,3 +36,81 @@ buildNumber.properties # https://github.com/takari/maven-wrapper#usage-without-binary-jar .mvn/wrapper/maven-wrapper.jar +# ---> JetBrains +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +**/.idea/ +**/logs/ \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2131822 --- /dev/null +++ b/pom.xml @@ -0,0 +1,112 @@ + + + + + com.yxt + yxt-parent + 0.0.1 + + + 4.0.0 + + yxt-yyth-biz + com.yxt.yyth + 0.0.1 + + + + com.yxt + yxt-common-base + 0.0.1 + + + + org.springframework.boot + spring-boot-starter-web + + + + 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 + + + junit + junit + compile + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + cn.dev33 + sa-token-spring-boot-starter + 1.37.0 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + src/main/java + + **/*Mapper.xml + + + + src/main/resources + + **/*.* + + false + + + + + diff --git a/src/main/java/com/yxt/yyth/YxtYythApplication.java b/src/main/java/com/yxt/yyth/YxtYythApplication.java new file mode 100644 index 0000000..c7ca1fa --- /dev/null +++ b/src/main/java/com/yxt/yyth/YxtYythApplication.java @@ -0,0 +1,24 @@ +package com.yxt.yyth; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author dimengzhe + */ +@SpringBootApplication(scanBasePackages = { + "com.yxt.common.base.config", + "com.yxt.yyth" +}) +// 启用自带定时任务 +@EnableScheduling +@EnableFeignClients(basePackages = {}) +public class YxtYythApplication { + public static void main(String[] args) { + SpringApplication.run(YxtYythApplication.class, args); + } +} diff --git a/src/main/java/com/yxt/yyth/api/package-info.java b/src/main/java/com/yxt/yyth/api/package-info.java new file mode 100644 index 0000000..a96fcaa --- /dev/null +++ b/src/main/java/com/yxt/yyth/api/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.yyth.api; \ No newline at end of file diff --git a/src/main/java/com/yxt/yyth/biz/package-info.java b/src/main/java/com/yxt/yyth/biz/package-info.java new file mode 100644 index 0000000..b71ea4d --- /dev/null +++ b/src/main/java/com/yxt/yyth/biz/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口 + */ +package com.yxt.yyth.biz; \ No newline at end of file diff --git a/src/main/java/com/yxt/yyth/config/package-info.java b/src/main/java/com/yxt/yyth/config/package-info.java new file mode 100644 index 0000000..8d58308 --- /dev/null +++ b/src/main/java/com/yxt/yyth/config/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.yyth.config; \ No newline at end of file diff --git a/src/main/java/com/yxt/yyth/feign/package-info.java b/src/main/java/com/yxt/yyth/feign/package-info.java new file mode 100644 index 0000000..5d4e407 --- /dev/null +++ b/src/main/java/com/yxt/yyth/feign/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.yyth.feign; \ No newline at end of file diff --git a/src/main/resources/application-devv.yml b/src/main/resources/application-devv.yml new file mode 100644 index 0000000..834052c --- /dev/null +++ b/src/main/resources/application-devv.yml @@ -0,0 +1,33 @@ +spring: + datasource: + hikari: + max-lifetime: 500000 + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://39.104.100.138:3306/yxt_lpk_yyth?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + username: root + password: yxt_mysql_138 + cloud: + nacos: + discovery: + server-addr: 39.104.100.138:8848 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 39.104.100.138 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + +image: + upload: + path: D:\supervise\upload\ + url: + prefix: http://127.0.0.1:8112/upload/ +import: + filePath: d:/yxt-supervise-gf/upload/ + diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml new file mode 100644 index 0000000..6161e46 --- /dev/null +++ b/src/main/resources/application-pro.yml @@ -0,0 +1,29 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/yxt_lpk_yyth?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + username: root + password: 1LAiGz$t1*Iw + 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:/supervise/upload/ + url: + prefix: http://127.0.0.1/api/upload/ +import: + filePath: D:/yxt-supervise-gf/upload/ \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..4d64403 --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,34 @@ +server: + port: 17201 + +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.18.0.4:3306/yxt_lpk_yyth?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + username: root + password: yxt_mysql_138 + cloud: + nacos: + discovery: + namespace: lipinka + server-addr: 172.18.0.5:8848 + ip: 39.104.100.138 + 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: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + + +image: + upload: + path: /home/lzh/docker_data/nginx/html/lpk/yyth-ui/upload/ + url: + prefix: http://jg.yyundong.com/upload/ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..5594697 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,50 @@ +spring: + application: + name: yxt-lpk-yyth + profiles: + active: devv +# active: test +# active: pro + messages: + # 国际化资源文件路径 + basename: i18n/messages + servlet: + #上传文件 + multipart: + max-file-size: 50MB + max-request-size: 100MB + devtools: + restart: + # 热部署开关 + enabled: true + +server: + port: 7201 + max-http-header-size: 102400 + undertow: + max-http-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 + +#rocketmq: +# producer: +# group: yxt-supervise-gf +# name-server: 127.0.0.1:9876 + + + + diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..ea76604 --- /dev/null +++ b/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 diff --git a/src/test/java/com/yxt/yyth/YxtYythApplicationTest.java b/src/test/java/com/yxt/yyth/YxtYythApplicationTest.java new file mode 100644 index 0000000..e69de29