添加eureka注册中心支持

This commit is contained in:
macro
2019-10-17 16:36:05 +08:00
parent feff3937ac
commit 47eaa3a5af
39 changed files with 192 additions and 1150 deletions

View File

@@ -2,11 +2,13 @@ package com.macro.mall;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* 应用启动入口
* Created by macro on 2018/4/26.
*/
@EnableDiscoveryClient
@SpringBootApplication
public class MallAdminApplication {
public static void main(String[] args) {

View File

@@ -11,4 +11,10 @@ spring:
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据
stat-view-servlet: #访问监控网页的登录用户名和密码
login-username: druid
login-password: druid
login-password: druid
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8001/eureka/

View File

@@ -12,6 +12,5 @@ spring:
stat-view-servlet: #访问监控网页的登录用户名和密码
login-username: druid
login-password: druid
logging:
path: /var/logs #配置日志生成路径

View File

@@ -1,18 +1,19 @@
spring:
profiles:
active: dev #默认为开发环境
application:
name: mall-admin
server:
port: 8080
mybatis:
mapper-locations:
- classpath:dao/*.xml
- classpath*:com/**/mapper/*.xml
jwt:
tokenHeader: Authorization #JWT存储的请求头
secret: mySecret #JWT加解密使用的密钥
expiration: 604800 #JWT的超期限时间(60*60*24)
tokenHead: Bearer #JWT负载中拿到开头
aliyun:
oss:
endpoint: oss-cn-shenzhen.aliyuncs.com # oss对外服务的访问域名
@@ -25,7 +26,6 @@ aliyun:
callback: http://39.98.190.128:8080/aliyun/oss/callback # 文件上传成功后的回调地址
dir:
prefix: mall/images/ # 上传文件夹路径前缀
logging:
level:
root: info #日志配置DEBUG,INFO,WARN,ERROR

View File

@@ -26,6 +26,7 @@
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<!--使用logstash时打开-->
<appender-ref ref="LOGSTASH"/>
</root>
</configuration>