fix,add mybatis-plus log
This commit is contained in:
parent
362d3786a4
commit
6312c20547
@ -14,7 +14,13 @@ java {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'}
|
||||
maven {
|
||||
url 'https://maven.aliyun.com/repository/public/'
|
||||
}
|
||||
maven {
|
||||
url 'https://maven.aliyun.com/repository/spring/'
|
||||
}
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@ -22,6 +28,7 @@ dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'com.baomidou:mybatis-plus-spring-boot3-starter:3.5.7'
|
||||
implementation 'p6spy:p6spy:3.9.1'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.34'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.34'
|
||||
runtimeOnly 'mysql:mysql-connector-java:8.0.30'
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
spring.application.name=demo
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:p6spy:mysql://47.106.93.245:9003/service
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=0andrx
|
||||
spring.datasource.url=jdbc:mysql://47.106.93.245:9003/service
|
||||
spring.datasource.password=qingyu23.
|
||||
spring.datasource.driver-class-name = com.p6spy.engine.spy.P6SpyDriver
|
||||
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
|
||||
|
||||
29
src/main/resources/spy.properties
Normal file
29
src/main/resources/spy.properties
Normal file
@ -0,0 +1,29 @@
|
||||
# ????????????????
|
||||
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||
|
||||
# ???????
|
||||
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
|
||||
|
||||
# ????????
|
||||
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
|
||||
|
||||
# ??JDBC????
|
||||
deregisterdrivers=true
|
||||
|
||||
# ????
|
||||
useprefix=true
|
||||
|
||||
# ???????
|
||||
excludecategories=info,debug,result,commit,resultset
|
||||
|
||||
# ????
|
||||
dateformat=yyyy-MM-dd HH:mm:ss
|
||||
|
||||
# ??????
|
||||
# driverlist=org.h2.Driver
|
||||
|
||||
# ???SQL??
|
||||
outagedetection=true
|
||||
|
||||
# ?SQL??????????
|
||||
outagedetectioninterval=2
|
||||
@ -7,6 +7,8 @@ import org.junit.jupiter.api.Test;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
@MybatisPlusTest
|
||||
@ -18,8 +20,9 @@ public class MybatisPlusTests {
|
||||
private newsMapper newsMapper;
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void insert() {
|
||||
News user = new News("test", "test");
|
||||
News user = new News("test333", "test");
|
||||
int insert = newsMapper.insert(user);
|
||||
System.out.println("受影响行数" + insert);
|
||||
System.out.println(user.getId());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user