记得上下班打卡 | git大法好,push需谨慎

Commit 5516b83a authored by 张国柄's avatar 张国柄

opt;

parent 69c36ea7
package com.liquidnet.service; package com.liquidnet.service;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.MongoTransactionManager;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays; import java.util.Arrays;
@Slf4j @Slf4j
...@@ -29,20 +23,20 @@ public class ServiceKylinApplication implements CommandLineRunner { ...@@ -29,20 +23,20 @@ public class ServiceKylinApplication implements CommandLineRunner {
} }
@Override @Override
public void run(String... strings) throws Exception { public void run(String... strings) {
try { try {
log.info("\n----------------------------------------------------------\n\t" + log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" + "Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" + "Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}\n\t" + "External: \thttp://{}:{}{}/doc.html\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------", "Profile(s): \t{}\n----------------------------------------------------------",
environment.getProperty("spring.application.name"), environment.getProperty("spring.application.name"),
environment.getProperty("server.port"), environment.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(),
environment.getProperty("server.port"), environment.getProperty("server.port"),
environment.getProperty("server.servlet.context-path"),
Arrays.toString(environment.getActiveProfiles())); Arrays.toString(environment.getActiveProfiles()));
} catch (UnknownHostException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>liquidnet-bus-service</artifactId> <artifactId>liquidnet-service-order</artifactId>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redisson</artifactId> <artifactId>liquidnet-common-cache-redisson</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
...@@ -38,6 +41,8 @@ ...@@ -38,6 +41,8 @@
<artifactId>liquidnet-service-adam-api</artifactId> <artifactId>liquidnet-service-adam-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<!-- other -->
<dependency> <dependency>
<groupId>taobao-sdk2-impl</groupId> <groupId>taobao-sdk2-impl</groupId>
<artifactId>taobao-sdk2-impl</artifactId> <artifactId>taobao-sdk2-impl</artifactId>
...@@ -46,12 +51,6 @@ ...@@ -46,12 +51,6 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/taobao-sdk-java-auto_1600401599540-20210607-impl.jar</systemPath> <systemPath>${basedir}/lib/taobao-sdk-java-auto_1600401599540-20210607-impl.jar</systemPath>
</dependency> </dependency>
<!-- other -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -5,39 +5,36 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -5,39 +5,36 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays; import java.util.Arrays;
@Slf4j @Slf4j
@EnableFeignClients
@SpringBootApplication(scanBasePackages = {"com.liquidnet"}) @SpringBootApplication(scanBasePackages = {"com.liquidnet"})
public class ServiceKylinApplication implements CommandLineRunner { public class ServiceOrderApplication implements CommandLineRunner {
@Autowired @Autowired
private Environment environment; private Environment environment;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ServiceKylinApplication.class, args); SpringApplication.run(ServiceOrderApplication.class, args);
} }
@Override @Override
public void run(String... strings) throws Exception { public void run(String... strings) {
try { try {
log.info("\n----------------------------------------------------------\n\t" + log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" + "Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" + "Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}\n\t" + "External: \thttp://{}:{}{}/doc.html\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------", "Profile(s): \t{}\n----------------------------------------------------------",
environment.getProperty("spring.application.name"), environment.getProperty("spring.application.name"),
environment.getProperty("server.port"), environment.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(),
environment.getProperty("server.port"), environment.getProperty("server.port"),
environment.getProperty("server.servlet.context-path"),
Arrays.toString(environment.getActiveProfiles())); Arrays.toString(environment.getActiveProfiles()));
} catch (UnknownHostException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
......
package com.liquidnet.service.order.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class OrderWebMvcConfig extends WebMvcConfig {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment