项目构建

This commit is contained in:
2023-04-17 23:02:30 +08:00
commit ae0b2dcd6e
95 changed files with 4594 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
<?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">
<parent>
<groupId>com.yxt.demo</groupId>
<artifactId>demo-system</artifactId>
<version>0.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-system-biz</artifactId>
<version>0.0.1</version>
<dependencies>
<dependency>
<artifactId>demo-system-api</artifactId>
<groupId>com.yxt.demo</groupId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.yxt.demo</groupId>
<artifactId>demo-common-config</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.yxt.demo</groupId>
<artifactId>demo-common-base</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.yxt.demo</groupId>
<artifactId>demo-common-redis</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.yxt.demo</groupId>
<artifactId>demo-common-jdbc</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.6</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*Mapper.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
</project>

View File

@@ -0,0 +1,23 @@
package com.yxt.anrui.portal;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @author dimengzhe
*/
@SpringBootApplication(scanBasePackages = {
"com.yxt.common.base.config",
"com.yxt.demo.system"
})
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {})
public class SystemApplication {
public static void main(String[] args) {
SpringApplication.run(SystemApplication.class, args);
}
}

View File

@@ -0,0 +1,35 @@
package com.yxt.demo.system.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author dimengzhe
* @date 2020/9/9 16:42
* @description
*/
@Configuration
@EnableSwagger2
@EnableKnife4j
public class Swagger2Config {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.basePackage("com.yxt.demo.system"))
.paths(PathSelectors.any()).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("demo/系统管理").description("系统管理接口").version("1.0")
.build();
}
}

View File

@@ -0,0 +1,36 @@
spring:
datasource:
hikari:
max-lifetime: 30000
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/demo_system?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:\\demo\\upload\\
url:
prefix: http://127.0.0.1:8111/upload/
login:
path: D:\\images\\pic-click

View File

@@ -0,0 +1,30 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/demo_system?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
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:\demo\upload\
url:
prefix: http://127.0.0.1:8111/upload/
login:
path: D:\images\pic-click

View File

@@ -0,0 +1,31 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/demo_system?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:
port: 6379
timeout: 0 # 连接超时时间(毫秒)
image:
upload:
path: D:\demo\upload\
url:
prefix: http://127.0.0.1:8111/upload/
login:
path: D:\images\pic-click

View File

@@ -0,0 +1,62 @@
spring:
application:
name: demo-system
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: 7003
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: 30000
#ribbon的超时时间
ribbon:
ReadTimeout: 30000
ConnectTimeout: 30000

View File

@@ -0,0 +1,13 @@
,----.. ____
/ / \ ,' , `.
| : : ,---. ,-+-,.' _ | ,---. ,---,
. | ;. / ' ,'\ ,-+-. ; , || ' ,'\ ,-+-. / |
. ; /--` / / | ,--.'|' | || ,---. / / | ,--.'|' |
; | ; . ; ,. :| | ,', | |,/ \ . ; ,. :| | ,"' |
| : | ' | |: :| | / | |--'/ / | ' | |: :| | / | |
. | '___' | .; :| : | | , . ' / | ' | .; :| | | | |
' ; : .'| : || : | |/ ' ; /| | : || | | |/
' | '/ :\ \ / | | |`-' ' | / | \ \ / | | |--'
| : / `----' | ;/ | : | `----' | |/
\ \ .' '---' \ \ / '---'
`---` `----'

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.base" value="logs/demo_system" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符
|%blue(%thread) 线程 如 DiscoveryClient-CacheRefreshExecutor-0-->
<!--<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>-->
<pattern>%yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%blue(%msg%n)
</pattern>
<!--<charset>UTF-8</charset> -->
</encoder>
</appender>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<appender name="FILEOUT"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.base}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.base}.%d{yyyyMMdd}.%i.log.zip
</fileNamePattern>
<!-- 当文件大小超过10MB时触发滚动 -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>1MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<!--<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>-->
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}
-%msg%n</Pattern>
<!--<charset>UTF-8</charset> -->
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILEOUT" />
</root>
</configuration>

View File

@@ -0,0 +1,10 @@
package com.yxt.demo.system.test;
/**
* @author dimengzhe
* @date 2021/7/1 16:11
* @description
*/
public class TestOneController {
}

View File

@@ -0,0 +1,40 @@
package com.yxt.demo.system.test.controller;
import cn.hutool.core.codec.Base64;
import com.yxt.demo.system.test.entity.TestDemo;
import lombok.Data;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author dimengzhe
* @date 2021/7/1 13:49
* @description 测试OCR扫描
*/
@Controller
@RequestMapping("/test")
public class TestController {
}

View File

@@ -0,0 +1,21 @@
package com.yxt.demo.system.test.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dimengzhe
* @date 2021/10/19 16:03
* @description
*/
@Data
public class TestDemo {
@ApiModelProperty(value = "身份证号")
private String idcard;
@ApiModelProperty(value = "手机号码")
private String mobile;
@ApiModelProperty(value = "姓名")
private String name;
}