add(req-2080):上传文件到华为云--添加pre环境启动类
This commit is contained in:
parent
8cb6fbbe08
commit
62ba3df5b1
@ -0,0 +1,47 @@
|
||||
package cn.axzo.oss.client;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* OSS pre环境启动类
|
||||
*
|
||||
* @author hucf
|
||||
* @since 2024/1/16 09:54
|
||||
**/
|
||||
@Slf4j
|
||||
@MapperScan(basePackages = {"cn.axzo.oss.dal.mapper"})
|
||||
@EnableFeignClients(basePackages = {"cn.axzo.log.platform.client"})
|
||||
@SpringBootApplication(scanBasePackages = {"cn.axzo.oss"})
|
||||
public class OssClientPreApplication {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
log.info("axzo oss begin starting...");
|
||||
|
||||
System.setProperty("spring.profiles.active","pre");
|
||||
System.setProperty("NACOS_HOST","https://pre-nacos.axzo.cn");
|
||||
System.setProperty("NACOS_PORT","443");
|
||||
System.setProperty("NACOS_NAMESPACE_ID","8b4cf725-7595-4c92-b2a6-9260a51ce078");
|
||||
System.setProperty("CUSTOM_ENV","pre");
|
||||
|
||||
SpringApplication application = new SpringApplication(OssClientDevApplication.class);
|
||||
ApplicationContext applicationContext = application.run(args);
|
||||
Environment env = applicationContext.getEnvironment();
|
||||
log.info("\tApplication {} is running on {} Profile!\n\t" +
|
||||
"Address: \thttp://{}:{}\n\t",
|
||||
env.getProperty("spring.application.name"),
|
||||
env.getActiveProfiles(),
|
||||
InetAddress.getLocalHost().getHostAddress(),
|
||||
env.getProperty("server.port")
|
||||
);
|
||||
|
||||
log.info("axzo oss start success");
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,7 @@ public class OssClientTestApplication {
|
||||
|
||||
System.setProperty("spring.profiles.active","test");
|
||||
System.setProperty("NACOS_HOST","test-nacos.axzo.cn");
|
||||
System.setProperty("NACOS_PORT","80");
|
||||
System.setProperty("NACOS_NAMESPACE_ID","f3c0f0d2-bac4-4498-bee7-9c3636b3afdf");
|
||||
System.setProperty("CUSTOM_ENV","test");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user