Merge branch 'main' of https://gitea.xinxijishubu.asia/iVMiku/guidance-backend
This commit is contained in:
@@ -56,26 +56,6 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-tracing指标追踪 1-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-tracing-bridge-brave适配zipkin的桥接包 2-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing-bridge-brave</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-observation 3-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-observation</artifactId>
|
||||
</dependency>
|
||||
<!--zipkin-reporter-brave 5-->
|
||||
<dependency>
|
||||
<groupId>io.zipkin.reporter2</groupId>
|
||||
<artifactId>zipkin-reporter-brave</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-transport-simple-http</artifactId>
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.ivmiku.tutorial;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration.class
|
||||
})
|
||||
@SpringBootApplication
|
||||
public class Main8133 {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Main8133.class, args);
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
server.port=8133
|
||||
|
||||
spring.application.name=gateway
|
||||
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
|
||||
spring.cloud.nacos.discovery.server-addr=nacos:8848
|
||||
|
||||
spring.data.redis.host=127.0.0.1
|
||||
spring.data.redis.host=redis
|
||||
spring.data.redis.port=6379
|
||||
spring.data.redis.database=0
|
||||
#spring.data.redis.password=Shuodedaoli114514
|
||||
spring.data.redis.password=Shuodedaoli114514
|
||||
|
||||
spring.cloud.gateway.routes[0].id=user
|
||||
spring.cloud.gateway.routes[0].uri=lb://user
|
||||
spring.cloud.gateway.routes[0].predicates[0]=Path=/user/**
|
||||
spring.cloud.gateway.routes[0].filters[0]=StripPrefix=1
|
||||
|
||||
management.zipkin.tracing.endpoint=http://127.0.0.1:9411/api/v2/spans
|
||||
management.tracing.sampling.probability=1.0
|
||||
spring.cloud.gateway.routes[1].id=community
|
||||
spring.cloud.gateway.routes[1].uri=lb://community
|
||||
spring.cloud.gateway.routes[1].predicates[0]=Path=/community/**
|
||||
spring.cloud.gateway.routes[1].filters[0]=StripPrefix=1
|
||||
|
||||
spring.cloud.gateway.routes[2].id=navigate
|
||||
spring.cloud.gateway.routes[2].uri=lb://navigate
|
||||
spring.cloud.gateway.routes[2].predicates[0]=Path=/navigate/**
|
||||
spring.cloud.gateway.routes[2].filters[0]=StripPrefix=1
|
||||
|
||||
BIN
navigate-8432/lib/opencv-4100.jar
Normal file
BIN
navigate-8432/lib/opencv-4100.jar
Normal file
Binary file not shown.
BIN
navigate-8432/lib/opencv_java4100.dll
Normal file
BIN
navigate-8432/lib/opencv_java4100.dll
Normal file
Binary file not shown.
@@ -109,5 +109,31 @@
|
||||
<artifactId>tencentcloud-sdk-java-asr</artifactId>
|
||||
<version>3.1.1083</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/ai.djl/api -->
|
||||
<dependency>
|
||||
<groupId>ai.djl</groupId>
|
||||
<artifactId>api</artifactId>
|
||||
<version>0.29.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/ai.djl.pytorch/pytorch-model-zoo -->
|
||||
<dependency>
|
||||
<groupId>ai.djl.pytorch</groupId>
|
||||
<artifactId>pytorch-model-zoo</artifactId>
|
||||
<version>0.29.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/ai.djl.pytorch/pytorch-engine -->
|
||||
<dependency>
|
||||
<groupId>ai.djl.pytorch</groupId>
|
||||
<artifactId>pytorch-engine</artifactId>
|
||||
<version>0.29.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/ai.djl.pytorch/pytorch-native-auto -->
|
||||
<dependency>
|
||||
<groupId>ai.djl.pytorch</groupId>
|
||||
<artifactId>pytorch-native-auto</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -57,10 +57,29 @@ public class NavigateController {
|
||||
}
|
||||
|
||||
@PostMapping("/ticket")
|
||||
public Object scanTicket(@RequestPart MultipartFile file) throws IOException {
|
||||
public Object scanTicket(@RequestPart MultipartFile file, @RequestParam String location) throws IOException {
|
||||
BufferedImage image = ImageIO.read(file.getInputStream());
|
||||
Map<String, Object> map = navigateService.scanTicket(image);
|
||||
return Result.ok(map);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (map.containsKey("登机口")) {
|
||||
String address = navigateService.deGeoCode(location);
|
||||
address += map.get("登机口");
|
||||
address += "登机口";
|
||||
result.put("地址", address);
|
||||
} else if (map.containsKey("检票口")) {
|
||||
if (map.containsKey("左边车站")) {
|
||||
String address = (String) map.get("左边车站");
|
||||
address += map.get("检票口");
|
||||
address += "检票口";
|
||||
result.put("地址", address);
|
||||
} else {
|
||||
String address = navigateService.deGeoCode(location);
|
||||
address += map.get("检票口");
|
||||
address += "检票口";
|
||||
result.put("地址", address);
|
||||
}
|
||||
}
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("/geocode")
|
||||
|
||||
@@ -64,7 +64,7 @@ public class NavigateService {
|
||||
OcrClient client = new OcrClient(cred, "ap-shanghai", clientProfile);
|
||||
SmartStructuralOCRV2Request req = new SmartStructuralOCRV2Request();
|
||||
req.setImageBase64(base64Img);
|
||||
String[] itemNames1 = {"登机口", "检票口"};
|
||||
String[] itemNames1 = {"登机口", "检票口", "左边车站", "右边车站"};
|
||||
req.setItemNames(itemNames1);
|
||||
resp = client.SmartStructuralOCRV2(req);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
@@ -106,4 +106,23 @@ public class NavigateService {
|
||||
JSONObject location = array.getJSONObject(0);
|
||||
return location.getString("location");
|
||||
}
|
||||
|
||||
public String deGeoCode(String fomattedLoc) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("key", key);
|
||||
params.put("location", fomattedLoc);
|
||||
params.put("poitype", "飞机场|火车站|地铁站");
|
||||
HttpResponse response = HttpRequest.get("https://restapi.amap.com/v3/geocode/regeo")
|
||||
.form(params)
|
||||
.execute();
|
||||
String result = response.body();
|
||||
response.close();
|
||||
JSONObject resultObj = JSONObject.parseObject(result);
|
||||
if (resultObj.getInteger("status")==0) {
|
||||
return null;
|
||||
}
|
||||
JSONObject reGeoCode = resultObj.getJSONObject("regeocode");
|
||||
String address = reGeoCode.getString("formatted_address");
|
||||
return address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.ivmiku.tutorial.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class RecogintionService {
|
||||
static {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,4 @@ spring.datasource.password=Shuodedaoli114514
|
||||
spring.datasource.url=jdbc:mysql://mysql:4514/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&ServerTimezone=Asia/Shanghai
|
||||
|
||||
spring.cloud.nacos.discovery.server-addr=nacos:8848
|
||||
spring.cloud.nacos.discovery.enabled=true
|
||||
|
||||
management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans
|
||||
management.tracing.sampling.probability=1.0
|
||||
spring.cloud.nacos.discovery.enabled=true
|
||||
@@ -79,31 +79,6 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-tracing指标追踪 1-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-tracing-bridge-brave适配zipkin的桥接包 2-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing-bridge-brave</artifactId>
|
||||
</dependency>
|
||||
<!--micrometer-observation 3-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-observation</artifactId>
|
||||
</dependency>
|
||||
<!--zipkin-reporter-brave 5-->
|
||||
<dependency>
|
||||
<groupId>io.zipkin.reporter2</groupId>
|
||||
<artifactId>zipkin-reporter-brave</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-spring-boot-tracing-brave-zipkin-starter</artifactId>
|
||||
<version>3.2.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
|
||||
@@ -4,9 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration.class
|
||||
})
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.ivmiku.tutorial.mapper")
|
||||
public class Main8072 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
wx.miniapp.configs[0].appid=wx0d4fdb5c7bf3b12b
|
||||
wx.miniapp.configs[0].secret=989f155fcc3aee616568473faf1b1d3b
|
||||
|
||||
spring.data.redis.host=127.0.0.1
|
||||
spring.data.redis.host=redis
|
||||
spring.data.redis.port=6379
|
||||
spring.data.redis.database=0
|
||||
|
||||
@@ -12,10 +12,9 @@ server.port=8072
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.url=jdbc:mysql://mysql:3306/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
|
||||
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
|
||||
spring.cloud.nacos.discovery.server-addr=nacos:8848
|
||||
spring.cloud.nacos.discovery.enabled=true
|
||||
|
||||
management.zipkin.tracing.endpoint=http://127.0.0.1:9411/api/v2/spans
|
||||
management.tracing.sampling.probability=1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user