perf:优化ip2region,改为从服务器下载db文件,而不是打包到项目中

This commit is contained in:
yz
2023-01-09 22:50:47 +08:00
parent 53e35ccb52
commit dd87b00612
14 changed files with 101 additions and 47 deletions

48
tiesheng-ademo/pom.xml Normal file
View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tiesheng</groupId>
<artifactId>tiesheng-parent</artifactId>
<version>0.0.6</version>
</parent>
<artifactId>tiesheng-ademo</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<artifactId>tiesheng-web</artifactId>
<version>0.0.6</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>kepai-repo</id>
<url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,21 @@
package com.tiesheng.demo;
import com.tiesheng.core.EnableTieshengWeb;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @author hao
*/
@EnableTransactionManagement
@SpringBootApplication
@EnableTieshengWeb
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

View File

@@ -0,0 +1,27 @@
package com.tiesheng.demo.controller;
import cn.hutool.log.LogFactory;
import com.tiesheng.annotation.token.TokenIgnore;
import com.tiesheng.util.ip2region.DataBlock;
import com.tiesheng.util.ip2region.Ip2Region;
import com.tiesheng.util.pojos.ApiResp;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
/**
* @author hao
*/
@RestController
@RequestMapping("/test")
public class TestController {
@RequestMapping("/index")
@TokenIgnore
public ApiResp<String> index() {
return ApiResp.respOK("hello world");
}
}

View File

@@ -0,0 +1,24 @@
## Spring配置
spring:
## 数据库配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://47.96.30.85:3306/com_tiesheng_web?useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&queryTimeout=5400&allowMultiQueries=true&serverTimezone=GMT%2B8
username: com_tiesheng_web
password: 4Xo$XheGFc
platform:
wxmp:
global:
app-id: wxa0343fe519824651
app-secret: 776f089ba70bcd66455a7c7893f810b9
tiesheng:
token:
ignores:
"1111":
id: "1111"
global:
version: 2
host: http://localhost:8080