瀏覽代碼

yml改properties

pzc 4 年之前
父節點
當前提交
41fa7199d2
共有 2 個文件被更改,包括 68 次插入5 次删除
  1. 35 5
      ymall/pom.xml
  2. 33 0
      ymall/src/main/resources/application.properties

+ 35 - 5
ymall/pom.xml

@@ -27,10 +27,37 @@
       <version>${weixin-java-mp.version}</version>
     </dependency>
 
+    <!--<dependency>-->
+      <!--<groupId>org.springframework.cloud</groupId>-->
+      <!--<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
+    <!--</dependency>-->
+
+    <!--client -->
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+    </dependency>
+    <!--configs -->
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-config</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+    </dependency>
+    <!-- feign客户端依赖 -->
     <dependency>
       <groupId>org.springframework.cloud</groupId>
-      <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+      <artifactId>spring-cloud-starter-openfeign</artifactId>
     </dependency>
+    <!-- feign使用服务id获取加请求路径获取的负载均衡依赖 -->
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
+      <scope>test</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
@@ -45,6 +72,7 @@
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-thymeleaf</artifactId>
     </dependency>
+    <!--再在配置类开头加上@PropertySource("classpath:your.properties"),其余用法与加载yml的配置一样-->
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-configuration-processor</artifactId>
@@ -55,11 +83,13 @@
       <artifactId>spring-boot-starter-test</artifactId>
       <scope>test</scope>
     </dependency>
+
+
     <!-- monotodb -->
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-data-mongodb</artifactId>
-    </dependency>
+    <!--<dependency>-->
+      <!--<groupId>org.springframework.boot</groupId>-->
+      <!--<artifactId>spring-boot-starter-data-mongodb</artifactId>-->
+    <!--</dependency>-->
 
     <!-- pgsql -->
     <dependency>

+ 33 - 0
ymall/src/main/resources/application.properties

@@ -0,0 +1,33 @@
+server.port=8070
+server.tomcat.max-http-post-size=-1
+server.tomcat.uri-encoding=UTF-8
+logging.level.org.springframework.web=INFO
+logging.level.com.liangjian11.ymall=DEBUG
+spring.profiles.active=pgdev
+
+spring.cache.type=ehcache
+spring.cache.ehcache.config=classpath:/config/ehcache.xml
+spring.servlet.multipart.max-file-size=10MB
+spring.servlet.multipart.max-request-size=100MB
+
+spring.http.encoding.charset=UTF-8
+spring.http.encoding.enabled=true
+spring.http.encoding.force=true
+
+mybatis-plus.mapper-locations=classpath*:mapper/*Mapper.xml
+mybatis-plus.type-aliases-package=com.liangjian11.ymall.model
+mybatis-plus.global-config.refresh-mapper=true
+mybatis-plus.global-config.db-config.logic-delete-value=1
+mybatis-plus.global-config.db-config.logic-not-delete-value=0
+config.jwt.secret=abcdefg1234567
+config.jwt.expire=86400
+config.jwt.header=token
+
+aliyun.vod.access-key-id=LTAI4FbzBnf9HHpfux8EwQVa
+aliyun.vod.access-key-secret=jmqpmUHN6cCJtfLCmkVMaBcV1hnTQt
+
+wx.miniapp.configs[0].appid=wx16d19a8b8df3fb06
+wx.miniapp.configs[0].secret=9cac55061d9f5a699f943edbbec5310f
+wx.miniapp.configs[0].token=11111111111111
+wx.miniapp.configs[0].aesKey=11111111111111
+wx.miniapp.configs[0].msgDataFormat=JSON