版本号归父模块定义
一、数据库相关依赖
<!-- 数据库--> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> <!-- 数据库连接池--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> </dependency> <!-- mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> </dependency> <!-- redis--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!-- 分页插件--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> </dependency>
二、相关配置
spring: # redis配置 redis: database: 0 port: 6379 password: xxxx host: x.x.x.x # json格式配置 jackson: date-format: yyyy-MM-dd HH:mm:ss # 上传文件配置 servlet: multipart: max-request-size: 30MB max-file-size: 30MB # 数据源配置 datasource: type: com.alibaba.druid.pool.DruidDataSource username:xxx password: xxx url: jdbc:postgresql://x.xx.xx.xxx:xxx/ceshi-psccs driver-class-name: org.postgresql.Driver druid: initial-size: 10 # 初始化大小,最小,最大 min-idle: 20 maxActive: 500 # 配置获取连接等待超时的时间 maxWait: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 testWhileIdle: true testOnBorrow: true validation-query: SELECT 1 testOnReturn: false # 打开PSCache,并且指定每个连接上PSCache的大小 poolPreparedStatements: true maxPoolPreparedStatementPerConnectionSize: 20 filters: stat,wall filter: wall: config: multi-statement-allow: true none-base-statement-allow: true enabled: true # 配置DruidStatFilter web-stat-filter: enabled: true url-pattern: "/*" exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" # 配置DruidStatViewServlet stat-view-servlet: enabled: true url-pattern: "/druid/*" # IP白名单(没有配置或者为空,则允许所有访问) allow: #127.0.0.1,192.168.xxx.x # IP黑名单 (存在共同时,deny优先于allow) deny: #192.168.xx.xx # 禁用HTML页面上的“Reset All”功能 reset-enable: false # 登录名 login-username: admin # 登录密码 login-password: 111111 query-timeout: 36000 # mybatis配置 mybatis: mapper-locations: classpath*:mapper/*Mapper.xml configuration: map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #配置pagehelpere分页参数合理化,如分页只有6页,请求第8页,返回第6页 pagehelper: reasonable: true