feign starter 使用实例
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.mybatis.example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.cloud.jpa.starter.JpaStarterConfiguration;
|
||||
|
||||
@SpringBootApplication
|
||||
@Import(JpaStarterConfiguration.class)
|
||||
public class MybatisPlusExampleApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MybatisPlusExampleApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.mybatis.example.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.chinaunicom.mall.ebtp.cloud.mybatis.example.model.Demo;
|
||||
|
||||
@Mapper
|
||||
public interface DemoMapper extends BaseMapper<Demo> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.mybatis.example.model;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class Demo {
|
||||
|
||||
private String id;
|
||||
private String col1;
|
||||
private String col2;
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
private int delFlag;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
logging:
|
||||
level:
|
||||
com.chinaunicom.mall.ebtp.cloud.mybatis.example: debug
|
||||
|
||||
# database
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
url: jdbc:mysql://125.32.114.204:13306/ebtp-cloud?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: mall3-ebtp-dev
|
||||
password: mall3-ebtp-dev
|
||||
filters: stat,wall,log4j
|
||||
maxActive: 20
|
||||
initialSize: 1
|
||||
maxWait: 60000
|
||||
minIdle: 1
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
validationQuery: select 'x'
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
poolPreparedStatements: true
|
||||
maxOpenPreparedStatements: 20
|
||||
connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=50000000
|
||||
|
@ -0,0 +1,10 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: db
|
||||
application:
|
||||
name: mall-ebtp-cloud-demo
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
|
@ -0,0 +1,21 @@
|
||||
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
|
||||
# 使用日志系统记录 sql
|
||||
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||
# 设置 p6spy driver 代理
|
||||
deregisterdrivers=true
|
||||
# 取消JDBC URL前缀
|
||||
useprefix=true
|
||||
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
|
||||
excludecategories=info,debug,result,commit,resultset
|
||||
# 日期格式
|
||||
dateformat=yyyy-MM-dd HH:mm:ss
|
||||
# 实际驱动可多个
|
||||
#driverlist=org.h2.Driver
|
||||
# 是否开启慢SQL记录
|
||||
outagedetection=true
|
||||
# 慢SQL记录标准 2 秒
|
||||
outagedetectioninterval=2
|
Reference in New Issue
Block a user