From 0f476dab2db1d3745d08a11a72d1e508fda40611 Mon Sep 17 00:00:00 2001 From: Parker Date: Fri, 18 Sep 2020 16:26:07 +0800 Subject: [PATCH] =?UTF-8?q?Api=20Controller=20=E7=BB=9F=E4=B8=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yaml | 8 ------ opsli-web/src/main/resources/application.yaml | 28 +++++++++++-------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/opsli-web/src/main/resources/application-dev.yaml b/opsli-web/src/main/resources/application-dev.yaml index f08be37..85bba0e 100644 --- a/opsli-web/src/main/resources/application-dev.yaml +++ b/opsli-web/src/main/resources/application-dev.yaml @@ -1,18 +1,10 @@ ## ---- 开发环境 ---- ## -opsli: - # 前缀 - prefix: api - # 版本 - version: v1 # 端口设置 server: port: 8080 - spring: - - #redis 配置 redis: database: 0 diff --git a/opsli-web/src/main/resources/application.yaml b/opsli-web/src/main/resources/application.yaml index a1ca692..2f839c5 100644 --- a/opsli-web/src/main/resources/application.yaml +++ b/opsli-web/src/main/resources/application.yaml @@ -7,6 +7,11 @@ server: max-swallow-size: -1 servlet: context-path: /opsli-boot + ## 专门针对 Controller层接口路径前缀全局配置 + api: + path: + global-prefix: /api/v1 + compression: enabled: true min-response-size: 1024 @@ -54,14 +59,7 @@ spring: # 默认编码 default-encoding: UTF-8 - # EhCache 配置 - cache: - # 开启 是否启用本地缓存 - enable: true - # 加载配置文件 - jcache: - config: classpath:config/ehcache-opsli.xml - #redis 配置 + # 一级缓存 ---- redis 配置 redis: # 开启消息订阅 pushsub: @@ -73,6 +71,13 @@ spring: max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 shutdown-timeout: 100ms + # 二级缓存 ---- EhCache 配置 + cache: + # 开启 是否启用本地缓存 + enable: true + # 加载配置文件 + jcache: + config: classpath:config/ehcache-opsli.xml # 数据库配置 datasource: @@ -115,8 +120,9 @@ mybatis-plus: mapper-locations: - classpath*:org/opsli/modulars/**/mapper/xml/*.xml # 实体扫描,多个package 继续往后跟 - typeAliasesPackage: - - org.opsli.modulars.**.entity + typeAliasesPackage: org.opsli.modulars.**.entity + # 实体扫描 BaseEntity 的子类对象 + typeAliasesSuperType: org.opsli.core.base.entity.BaseEntity global-config: # 关闭Banner banner: false @@ -134,4 +140,4 @@ mybatis-plus: cache-enabled: false call-setters-on-nulls: true # 打印SQL 开发测试使用 生产关闭 *** - #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl