初始化
commit
c39250182b
|
@ -0,0 +1,32 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
/.idea
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,86 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>AliOpenApi</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.7.15</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<mybatisplus.version>3.5.1</mybatisplus.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus 所需依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>${mybatisplus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>${mybatisplus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 使用h2内存数据库 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2</artifactId>
|
||||||
|
<version>2.0.42</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- http调用框架 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
|
<version>1.5.33</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.73</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--常用工具类 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongZl
|
||||||
|
* @description: 启动类
|
||||||
|
* @Date 2023-12-29 下午 02:39
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class AliOpenApiApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(AliOpenApiApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
server:
|
||||||
|
port: 81
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
username: muyu
|
||||||
|
password: 123456
|
||||||
|
# 如果需要数据本地化,则改成 file 方式
|
||||||
|
# jdbc:h2:mem:testDB;DB_CLOSE_DELAY=-1
|
||||||
|
url: jdbc:h2:file:~/vehicle/ali/openapi;AUTO_SERVER=TRUE;DB_CLOSE_DELAY=-1
|
||||||
|
driver-class-name: org.h2.Driver
|
||||||
|
h2:
|
||||||
|
# 开启这个配置就可以通过 web 页面访问了,例如:http://localhost:8080/springboot-h2/h2-console
|
||||||
|
console:
|
||||||
|
enabled: true
|
||||||
|
settings:
|
||||||
|
# 开启h2 console 跟踪 方便调试 默认 false
|
||||||
|
trace: true
|
||||||
|
# 允许console 远程访问 默认false
|
||||||
|
web-allow-others: true
|
||||||
|
# h2 访问路径上下文
|
||||||
|
path: /h2-console
|
||||||
|
sql:
|
||||||
|
init:
|
||||||
|
schema-locations: classpath:schema.sql
|
||||||
|
data-locations: classpath:data.sql
|
||||||
|
mode: always
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
|
||||||
|
# mybatis-plus 配置
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:/com.muyu.mapper/**/*.xml
|
||||||
|
#实体扫描,多个package用逗号或者分号分隔
|
||||||
|
typeAliasesPackage: com.dmo.entity
|
||||||
|
global-config:
|
||||||
|
#数据库相关配置
|
||||||
|
db-config:
|
||||||
|
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
|
||||||
|
id-type: AUTO
|
||||||
|
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
|
||||||
|
field-strategy: NOT_NULL
|
||||||
|
#驼峰下划线转换
|
||||||
|
column-underline: true
|
||||||
|
logic-delete-value: -1
|
||||||
|
logic-not-delete-value: 0
|
||||||
|
#原生配置
|
||||||
|
configuration:
|
||||||
|
# 打印sql
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
map-underscore-to-camel-case: true
|
||||||
|
cache-enabled: false
|
||||||
|
call-setters-on-nulls: true
|
||||||
|
jdbc-type-for-null: 'null'
|
||||||
|
|
||||||
|
# 日志输出配置
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.muyu: DEBUG
|
||||||
|
com.muyu.service: DEBUG
|
||||||
|
com.muyu.mapper: DEBUG
|
||||||
|
com.muyu.vehicle: DEBUG
|
||||||
|
root: INFO
|
||||||
|
org:
|
||||||
|
springframework:
|
||||||
|
security: WARN
|
||||||
|
web: ERROR
|
||||||
|
file:
|
||||||
|
path: ./logs
|
||||||
|
name: './logs/AliyunOpenApi.log'
|
||||||
|
pattern:
|
||||||
|
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n'
|
||||||
|
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n'
|
||||||
|
# http调用框架
|
||||||
|
forest:
|
||||||
|
max-connections: 1000 # 连接池最大连接数
|
||||||
|
connect-timeout: 3000 # 连接超时时间,单位为毫秒
|
||||||
|
read-timeout: 3000 # 数据读取超时时间,单位为毫秒
|
||||||
|
variables:
|
||||||
|
adminHost: ${mqtt.admin.host}
|
||||||
|
adminTopicUri: ${mqtt.admin.topic-uri}
|
||||||
|
log-enabled: false
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongZl
|
||||||
|
* @description: 测试
|
||||||
|
* @Date 2023-12-29 下午 02:41
|
||||||
|
*/
|
||||||
|
@SpringBootTest(classes = AliOpenApiApplication.class)
|
||||||
|
public class Test {
|
||||||
|
}
|
Loading…
Reference in New Issue