perf:优化ip2region,改为从服务器下载db文件,而不是打包到项目中
This commit is contained in:
@@ -2,6 +2,7 @@ package com.tiesheng.core;
|
||||
|
||||
import com.tiesheng.login.LoginAutoImportSelector;
|
||||
import com.tiesheng.migration.MigrationAutoImportSelector;
|
||||
import com.tiesheng.util.UtilAutoConfigurer;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@@ -14,10 +15,10 @@ import java.lang.annotation.*;
|
||||
@Target({ElementType.TYPE})
|
||||
@Documented
|
||||
@Import({
|
||||
UtilAutoConfigurer.class,
|
||||
CoreAutoImportSelector.class,
|
||||
LoginAutoImportSelector.class,
|
||||
MigrationAutoImportSelector.class
|
||||
})
|
||||
@ComponentScan("cn.hutool.extra.spring")
|
||||
public @interface EnableTieshengWeb {
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.tiesheng.core.config.global;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "tiesheng.global")
|
||||
public class GlobalConfig {
|
||||
|
||||
private String host;
|
||||
private String service;
|
||||
private String version;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 逻辑方法
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getContextPath() {
|
||||
String context = SpringUtil.getProperty("server.servlet.context-path");
|
||||
if (StrUtil.isEmpty(context)) {
|
||||
context = "";
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建完整的路径
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
public String buildPath(String path) {
|
||||
if (StrUtil.isEmpty(path)) {
|
||||
path = "";
|
||||
}
|
||||
if (!StrUtil.isEmpty(host) && !StrUtil.startWith(path, "http")) {
|
||||
path = host + getContextPath() + path;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user