diff --git a/nflg-mobilebroken-quotation/pom.xml b/nflg-mobilebroken-quotation/pom.xml new file mode 100644 index 00000000..780f97a5 --- /dev/null +++ b/nflg-mobilebroken-quotation/pom.xml @@ -0,0 +1,172 @@ + + + 4.0.0 + + com.nflg + nflg-mobilebroken + 1.0.0-SNAPSHOT + + nflg-mobilebroken-quotation + 报价服务 + nflg-mobilebroken-quotation + + + com.nflg + nflg-mobilebroken-common + + + com.nflg + nflg-mobilebroken-starter + + + org.springframework.boot + spring-boot-starter + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + org.junit.jupiter + junit-jupiter + test + + + org.springframework.boot + spring-boot-starter-web + + + com.nflg + nflg-mobilebroken-repository + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + ognl + ognl + 3.1.28 + + + org.xhtmlrenderer + flying-saucer-pdf + 9.3.1 + + + bcprov-jdk14 + org.bouncycastle + + + + + + com.itextpdf + itextpdf + 5.5.13.3 + + + + com.itextpdf + itext-asian + 5.2.0 + + + cn.dev33 + sa-token-spring-boot-starter + + + cn.dev33 + sa-token-redis-jackson + + + org.apache.commons + commons-pool2 + + + org.apache.poi + poi-ooxml + 5.2.3 + + + com.github.mwiede + jsch + 2.27.3 + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib + ${project.groupId} + runtime + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + lib/ + com.nflg.mobilebroken.quotation.QuotationApplication + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + ${project.groupId}:* + + + false + + + + + + + + diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/QuotationApplication.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/QuotationApplication.java new file mode 100644 index 00000000..765ce1a2 --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/QuotationApplication.java @@ -0,0 +1,26 @@ +package com.nflg.mobilebroken.quotation; + +import cn.dev33.satoken.SaManager; +import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@MapperScan("com.nflg.mobilebroken.repository.mapper") +@ComponentScan(basePackages = {"com.nflg.mobilebroken.repository.service", "com.nflg.mobilebroken.quotation" + , "com.nflg.mobilebroken.starter"}) +@EnableDiscoveryClient +@EnableScheduling +@Slf4j +public class QuotationApplication { + + public static void main(String[] args) { + SpringApplication.run(QuotationApplication.class, args); + log.info("启动成功,Sa-Token 配置如下:" + SaManager.getConfig()); + } + +} diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/config/SaTokenConfig.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/config/SaTokenConfig.java new file mode 100644 index 00000000..5c1c2d5b --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/config/SaTokenConfig.java @@ -0,0 +1,15 @@ +package com.nflg.mobilebroken.quotation.config; + +import cn.dev33.satoken.context.SaTokenContext; +import cn.dev33.satoken.spring.SaTokenContextForSpring; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SaTokenConfig { + + @Bean + public SaTokenContext saTokenContext() { + return new SaTokenContextForSpring(); + } +} diff --git a/nflg-mobilebroken-quotation/src/main/resources/bootstrap-dev.properties b/nflg-mobilebroken-quotation/src/main/resources/bootstrap-dev.properties new file mode 100644 index 00000000..f5812e23 --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/resources/bootstrap-dev.properties @@ -0,0 +1,13 @@ +# Nacos 地址 +nacos.server-addr=${NACOS_SERVER_ADDR:192.168.0.194:8848} +#nacos.server-addr=192.168.0.194:8848 +#spring.cloud.nacos.discovery.username=nacos +#spring.cloud.nacos.discovery.password=ZLQ8vgmjoJ4?EPJ4]fs_ +#spring.config.activate.on-profile=dev +logging.level.com.nflg=trace +logging.level.com.alibaba.cloud.nacos.config=DEBUG +#spring.datasource.url=jdbc:mysql://112.74.186.154:13151/mobilebroken?useUnicode=true&characterEncoding=utf8mb4&tinyInt1isBit=false&useSSL=false&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=GMT%2B8 +#spring.datasource.username=nflg +#spring.datasource.password=Aciga@2022 +#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +logging.config=classpath:logback-sit.xml \ No newline at end of file diff --git a/nflg-mobilebroken-quotation/src/main/resources/bootstrap-sit.properties b/nflg-mobilebroken-quotation/src/main/resources/bootstrap-sit.properties new file mode 100644 index 00000000..c16d9f3f --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/resources/bootstrap-sit.properties @@ -0,0 +1,13 @@ +# Nacos 地址 +nacos.server-addr=${NACOS_SERVER_ADDR:192.168.0.194:8848} +#nacos.server-addr=192.168.0.194:8848 +#spring.cloud.nacos.discovery.username=nacos +#spring.cloud.nacos.discovery.password=ZLQ8vgmjoJ4?EPJ4]fs_ +#spring.config.activate.on-profile=dev +logging.level.com.nflg=DEBUG +logging.level.com.alibaba.cloud.nacos.config=DEBUG +#spring.datasource.url=jdbc:mysql://112.74.186.154:13151/mobilebroken?useUnicode=true&characterEncoding=utf8mb4&tinyInt1isBit=false&useSSL=false&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=GMT%2B8 +#spring.datasource.username=nflg +#spring.datasource.password=Aciga@2022 +#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +logging.config=classpath:logback-sit.xml \ No newline at end of file diff --git a/nflg-mobilebroken-quotation/src/main/resources/bootstrap.properties b/nflg-mobilebroken-quotation/src/main/resources/bootstrap.properties new file mode 100644 index 00000000..55626c10 --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/resources/bootstrap.properties @@ -0,0 +1,29 @@ +spring.application.name=quotation +spring.profiles.active=dev +server.port=8086 +spring.servlet.multipart.enabled=true +spring.servlet.multipart.max-file-size=1024MB +spring.servlet.multipart.max-request-size=1024MB +spring.servlet.multipart.file-size-threshold=10MB +spring.servlet.multipart.location=/tmp +#spring.config.import=classpath:application-${spring.profiles.active}.properties,nacos: +#spring.config.import=nacos: +logging.level.root=info +#logging.level.com.alibaba.nacos.client=DEBUG +#logging.level.org.springframework.boot.context.config=DEBUG +#logging.config=classpath:logback-sit.xml +# 启用服务发现自动路由 +spring.cloud.gateway.discovery.locator.enabled=true +spring.cloud.nacos.config.namespace=mobilebroken +spring.cloud.nacos.config.group=${spring.profiles.active} +spring.cloud.nacos.config.server-addr=${nacos.server-addr} +spring.cloud.nacos.config.file-extension=properties +spring.cloud.nacos.config.extension-configs[0].data-id=shared.properties +spring.cloud.nacos.config.extension-configs[0].group=${spring.profiles.active} +spring.cloud.nacos.config.extension-configs[0].refresh=true +spring.cloud.nacos.discovery.server-addr=${nacos.server-addr} +spring.cloud.nacos.discovery.namespace=mobilebroken +spring.cloud.nacos.discovery.group=${spring.profiles.active} +spring.cloud.nacos.discovery.metadata.env=${spring.profiles.active} +spring.thymeleaf.encoding=UTF-8 +#spring.thymeleaf.cache=true diff --git a/nflg-mobilebroken-quotation/src/main/resources/logback-sit.xml b/nflg-mobilebroken-quotation/src/main/resources/logback-sit.xml new file mode 100644 index 00000000..bfd0498a --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/resources/logback-sit.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %X{traceId} [%thread] %-5level %logger{10} %method:%line %msg%n + + + + + + + + debug + + ${logDir}/mobilebroken-quotation.log + + + ${logDir}/%d{yyyy-MM-dd}.%i.log + + 15 + + true + + ${splitSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %X{traceId} [%thread] %-5level %logger{30} %method:%line %msg%n + + + + + + + + error + + ${logDir}/error/mobilebroken-quotation-error.log + + + ${logDir}/error/%d{yyyy-MM-dd}.%i.error.log + + 30 + + true + + ${splitSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %X{traceId} [%thread] %-5level %logger{50} %msg%n + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 31eb01d6..75a3f903 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ nflg-mobilebroken-push nflg-mobilebroken-product nflg-mobilebroken-gongfu + nflg-mobilebroken-quotation UTF-8