From 150809364ad87a8f98886c4859ceb21305943b2c Mon Sep 17 00:00:00 2001 From: Lierbao Date: Tue, 3 Jan 2023 10:19:11 +0800 Subject: [PATCH] init --- .gitignore | 33 +- ningda-generator/pom.xml | 39 +++ .../generator/config/GeneratorCodeConfig.java | 64 ++++ pmapi/pom.xml | 331 +++++++++++++++++++++ pmapi/src/main/java/com/ningdatech/pmapi/App.java | 26 ++ pom.xml | 141 +++++++++ 6 files changed, 609 insertions(+), 25 deletions(-) create mode 100644 ningda-generator/pom.xml create mode 100644 ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java create mode 100644 pmapi/pom.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/App.java create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index 84adb3f..4449f92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,8 @@ -# ---> 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* - +### IDEA ### +*.iml +*/target/* +*/*.iml +/.gradle/ +*.pid +logs +/.idea/ \ No newline at end of file diff --git a/ningda-generator/pom.xml b/ningda-generator/pom.xml new file mode 100644 index 0000000..f83e876 --- /dev/null +++ b/ningda-generator/pom.xml @@ -0,0 +1,39 @@ + + + + project-management + com.ningdatech + 1.0.0 + + 4.0.0 + + ningda-generator + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-generator + 3.5.1 + + + org.freemarker + freemarker + + + + + + org.postgresql + postgresql + + + diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java new file mode 100644 index 0000000..6a1f8f7 --- /dev/null +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeConfig.java @@ -0,0 +1,64 @@ +package com.ningdatech.generator.config; + +import com.baomidou.mybatisplus.generator.FastAutoGenerator; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.util.Collections; + +/** + * @description: 自动生成code代码 + * @author: liushuai + * @date: 2022/3/25 14:20 + */ +public class GeneratorCodeConfig { + + private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/car_rental/ningda-car-rental-api/src/main/java"; + private static final String PATH_YYD = "/Users/wendy/code project/java/car_rental/ningda-car-rental-api/src/main/java"; + private static final String PATH_LS = "/Users/qinxianyun/Documents/qin/ningdatech/car_rental/ningda-car-rental-api/src/main/java"; + private static final String PATH_ZPF = ""; + private static final String PATH_CMM = ""; + + private static final String URL = "jdbc:mysql://47.98.125.47:3306/car_rental?" + + "useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&" + + "useSSL=false&serverTimezone=Asia/Shanghai"; + private static final String USER_NAME = "root"; + private static final String PASSWORD = "NingdaKeji123!"; + + private static void generate(String author, String packageName, String path, String... tableNames) { + FastAutoGenerator.create(URL, USER_NAME, PASSWORD) + .globalConfig(builder -> { + // 设置作者 + builder.author(author) + // 开启 swagger 模式 + .enableSwagger() + // 覆盖已生成文件 + .fileOverride() + // 指定输出目录 + .outputDir(path); + }) + .packageConfig(builder -> { + // 设置父包名 + builder.parent("com.ningdatech") + // 设置父包模块名 + .moduleName("rentalcar." + packageName) + // 设置mapperXml生成路径 + .pathInfo(Collections.singletonMap(OutputFile.mapperXml, + //设置自己的生成路径 + path + "/com/ningdatech/rentalcar/" + packageName + "/mapper")); + }) + .strategyConfig(builder -> { + builder.addTablePrefix("nd"); + // 设置需要生成的表名 + builder.addInclude(tableNames); + }) + // 使用Freemarker引擎模板,默认的是Velocity引擎模板 + .templateEngine(new FreemarkerTemplateEngine()) + .execute(); + } + + public static void main(String[] args) { + generate("Liuxinxin", "order", PATH_YYD, "nd_order_status_change"); + } + +} diff --git a/pmapi/pom.xml b/pmapi/pom.xml new file mode 100644 index 0000000..3ad4e67 --- /dev/null +++ b/pmapi/pom.xml @@ -0,0 +1,331 @@ + + + 4.0.0 + + com.ningdatech + project-management + 1.0.0 + + pmapi + 1.0.0 + + 0.11.5 + + + + + + org.springframework.boot + spring-boot-starter-security + + + com.google.guava + guava + + + cn.hutool + hutool-all + 5.8.5 + + + + org.projectlombok + lombok + + + + com.baomidou + mybatis-plus-boot-starter + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + org.apache.commons + commons-pool2 + ${commons-pool2.version} + + + org.apache.commons + commons-lang3 + + + com.alibaba + fastjson + + + org.apache.tomcat.embed + tomcat-embed-core + + + io.swagger + swagger-models + + + com.github.xiaoymin + knife4j-spring-boot-starter + + + io.swagger + swagger-models + + + + + org.springframework.boot + spring-boot-starter-validation + + + nl.basjes.parse.useragent + yauaa + + + jakarta.persistence + jakarta.persistence-api + + + org.springframework.data + spring-data-jpa + + + org.hibernate + hibernate-core + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-jdbc + + + + org.springframework.boot + spring-boot-devtools + true + true + + + + org.postgresql + postgresql + 42.4.2 + + + com.alibaba + druid-spring-boot-starter + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework + spring-test + + + + com.github.ben-manes.caffeine + caffeine + + + org.apache.httpcomponents + httpclient + + + + com.auth0 + java-jwt + + + io.jsonwebtoken + jjwt-api + ${jjwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jjwt.version} + + + io.jsonwebtoken + jjwt-jackson + ${jjwt.version} + + + + org.apache.poi + poi + + + + org.apache.poi + poi-ooxml + + + + com.aliyun.oss + aliyun-sdk-oss + 3.15.0 + + + junit + junit + test + + + org.aspectj + aspectjweaver + + + + com.itextpdf + itextpdf + 5.5.13 + + + com.itextpdf + itext-asian + 5.2.0 + + + org.apache.pdfbox + pdfbox + 2.0.4 + + + + org.jxls + jxls-jexcel + 1.0.6 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.mapstruct + mapstruct + 1.4.2.Final + + + org.mapstruct + mapstruct-processor + 1.4.2.Final + + + org.springframework.boot + spring-boot-configuration-processor + + + com.ningdatech + nd-log-starter + 1.0.0 + + + com.ningdatech + nd-basic + 1.0.0 + + + + + + + dev + + + dev + + + + test + + test + + + + pre + + pre + + + + prod + + prod + + + + + + + + src/main/resources + + **/* + + + + src/main/java + + **/*.xml + + + + src/main/lib + BOOT-INF/lib/ + + **/*.jar + + + + src/main/resources + BOOT-INF/classes/ + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + 2.6.8 + + true + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/App.java b/pmapi/src/main/java/com/ningdatech/pmapi/App.java new file mode 100644 index 0000000..4e564c1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/App.java @@ -0,0 +1,26 @@ +package com.ningdatech.pmapi; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * @author liuxinxin + */ +@SpringBootApplication +@MapperScan(App.MAPPER_PACKAGES) +@EnableScheduling +@EnableTransactionManagement +@EnableAspectJAutoProxy(exposeProxy = true) +public class App { + + protected static final String MAPPER_PACKAGES = "com.ningdatech.pmapi.**.mapper"; + + public static void main(String[] args) { + System.setProperty("druid.mysql.usePingMethod", "false"); + SpringApplication.run(App.class, args); + } +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3456c7d --- /dev/null +++ b/pom.xml @@ -0,0 +1,141 @@ + + + 4.0.0 + + com.ningdatech + project-management + pom + 1.0.0 + project-management + 丽水项管二期项目 + + + UTF-8 + 2.6.11 + 1.8 + 1.8 + 3.7.0 + 1.2.8 + 3.5.1 + 3.0.0 + 3.0.3 + 1.2.83 + 31.1-jre + 2.11.1 + 6.11 + 1.2.8 + 2.6.3 + + + + + + org.apache.poi + poi + 5.2.2 + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + org.apache.poi + poi-ooxml + 5.2.2 + + + com.alibaba + fastjson + ${fastjson.version} + + + + nl.basjes.parse.useragent + yauaa + ${useragent.yauaa} + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + com.alibaba + druid + ${com.alibaba.druid.version} + + + + com.auth0 + java-jwt + ${jwt.version} + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis.plus.version} + + + com.google.guava + guava + ${guava.version} + + + io.swagger + swagger-models + 1.6.5 + + + com.github.xiaoymin + knife4j-spring-boot-starter + + + io.swagger + swagger-models + + + 2.0.9 + + + + + + + + aliyun + aliyun + https://maven.aliyun.com/repository/public + + true + + + false + + + + + + + spring-plugin + spring-plugin + https://maven.aliyun.com/repository/spring-plugin + + true + + + false + + + + + + pmapi + ningda-generator + +