修改订单模块项目结构

This commit is contained in:
xiaofeng
2020-05-08 22:30:30 +08:00
parent 104e33f5f9
commit 956bdb5396
3 changed files with 21 additions and 112 deletions

View File

@@ -3,6 +3,7 @@ package cn.iocoder.mall.order.application;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.config.ConfigFileApplicationListener;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
@@ -11,16 +12,23 @@ import org.springframework.context.annotation.Bean;
@SpringBootApplication(scanBasePackages = {"cn.iocoder.mall.order"})
public class OrderApplication {
public static void main(String[] args) {
SpringApplication.run(OrderApplication.class, args);
}
/**
* 设置需要读取的配置文件的名字。 基于 {@link org.springframework.boot.context.config.ConfigFileApplicationListener#CONFIG_NAME_PROPERTY}
* 实现。
*/
private static final String CONFIG_NAME_VALUE = "biz,rest,rpc,application";
public static void main(String[] args) {
// 设置环境变量
System.setProperty(ConfigFileApplicationListener.CONFIG_NAME_PROPERTY, CONFIG_NAME_VALUE);
SpringApplication.run(OrderApplication.class, args);
}
/**
* 解决异常信息:
* java.lang.IllegalArgumentException:
* Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
* 解决异常信息: java.lang.IllegalArgumentException: Invalid character found in the request target.
* The valid characters are defined in RFC 7230 and RFC 3986
*
* @return
*/
@Bean
@@ -36,5 +44,4 @@ public class OrderApplication {
}
}
}

View File

@@ -1,32 +1,7 @@
spring:
# Application 的配置项
application:
name: order-application
# Spring Cloud 配置项
cloud:
# Spring Cloud Sentinel 配置项
sentinel:
transport:
dashboard: s1.iocoder.cn:12088 # Sentinel Dashboard 服务地址
eager: true # 项目启动时,直接连接到 Sentinel
# server
server:
port: 18088
servlet:
context-path: /order-api/
swagger:
enable: true # 暂时不去掉
title: 订单子系统
description: 订单子系统
version: 1.0.0
base-package: cn.iocoder.mall.order.application.controller
management:
endpoints:
web:
exposure:
include: health,info,env,metrics,prometheus
metrics:
enabled: true
# Profile 的配置项
profiles:
active: local