3 Commits

Author SHA1 Message Date
wzy-warehouse d2950ffdd3 删除不必要的文件 2026-06-24 10:24:35 +08:00
wzy-warehouse 71ae772ede Merge remote-tracking branch 'refs/remotes/origin/main' into wzy 2026-06-24 09:54:27 +08:00
zxyroy d37d9c2361 修改后端readme 2026-06-17 22:10:41 +08:00
11 changed files with 3 additions and 146 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
# basic_template_not_login_back # xian_api_new
开发基本模版——后端 新版西安项目——后端
# basic_template_not_login_back # basic_template_not_login_back
@@ -1,19 +0,0 @@
package com.gis.xian.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* 算法服务器配置属性
*/
@Data
@Component
@ConfigurationProperties(prefix = "algorithm.server")
public class AlgorithmServerProperties {
/**
* 算法服务器地址
*/
private String url;
}
@@ -1,25 +0,0 @@
package com.gis.xian.controller;
import com.gis.xian.service.IFeignService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
/**
* 专题图触发接口
* 统一入口,接收 simulationId 和 type,调用 Python 端处理
*/
@Slf4j
@RestController
@RequestMapping("/open")
public class QgisController {
@Resource
private IFeignService feignService;
@PostMapping("/qgis/trigger")
public void trigger(@RequestParam String simulationId, @RequestParam String type) {
log.info("收到专题图触发请求: simulationId={}, type={}", simulationId, type);
feignService.trigger(simulationId, type);
}
}
@@ -1,15 +0,0 @@
package com.gis.xian.service;
/**
* 专题图触发接口
* 只负责调用 Python 端,不返回结果
*/
public interface IFeignService {
/**
* 触发专题图生成
* @param simulationId 模拟ID
* @param type 灾害类型(earthquake / rain
*/
void trigger(String simulationId, String type);
}
@@ -1,49 +0,0 @@
package com.gis.xian.service.impl;
import com.gis.xian.service.IFeignService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClient;
import java.util.Map;
/**
* 专题图触发服务
* 只负责调用 Python QGIS 服务,不处理计算和存库
*/
@Slf4j
@Service
public class FeignServiceImpl implements IFeignService {
@Resource
private RestClient.Builder restClientBuilder;
@Value("${qgis.url}")
private String qgisUrl;
@Override
public void trigger(String simulationId, String type) {
if (simulationId == null || simulationId.isBlank()) {
log.error("触发参数为空,simulationId={}", simulationId);
return;
}
log.info("触发专题图生成: simulationId={}, type={}", simulationId, type);
try {
RestClient client = restClientBuilder.build();
String result = client.post()
.uri(qgisUrl)
.contentType(MediaType.APPLICATION_JSON)
.body(Map.of("simulationId", simulationId, "type", type))
.retrieve()
.body(String.class);
log.info("Python 端响应: {}", result);
} catch (Exception e) {
log.error("调用 Python QGIS 服务失败: {}", e.getMessage(), e);
}
}
}
-6
View File
@@ -7,7 +7,6 @@ spring:
config: config:
import: import:
- classpath:config/database/application-database-dev.yml - classpath:config/database/application-database-dev.yml
- classpath:config/qgis/application-qgis-dev.yml
- classpath:config/customize/application-customize-dev.yml - classpath:config/customize/application-customize-dev.yml
@@ -55,8 +54,3 @@ safety:
- /websocket/** - /websocket/**
- /open/** - /open/**
# 算法服务器配置
algorithm:
server:
# 开发环境算法服务器地址
url: http://localhost:8082
-7
View File
@@ -7,7 +7,6 @@ spring:
config: config:
import: import:
- classpath:config/database/application-database-prod.yml - classpath:config/database/application-database-prod.yml
- classpath:config/qgis/application-qgis-prod.yml
- classpath:config/customize/application-customize-prod.yml - classpath:config/customize/application-customize-prod.yml
# redis # redis
@@ -49,9 +48,3 @@ safety:
no-decrypt-paths: no-decrypt-paths:
- /crypto/sm2/public-key - /crypto/sm2/public-key
- /websocket/** - /websocket/**
# 算法服务器配置
algorithm:
server:
# 生产环境算法服务器地址
url: http://localhost:8081
@@ -1,8 +0,0 @@
# qgis配置
qgis:
# 地震专题图模板路径
eq-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/eq/
# 暴雨专题图模板路径
rain-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/rain/
# QGIS基础路径
base-path: F:/files/xian/maps/
@@ -1,8 +0,0 @@
# qgis配置
qgis:
# 地震专题图模板路径
eq-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/eq/
# 暴雨专题图模板路径
rain-maps-template-path: D:/代码/xian_api_new/src/main/resources/template/qgis-template/rain/
# QGIS基础路径
base-path: F:/files/xian/maps/
@@ -1,3 +0,0 @@
# qgis配置
qgis:
url: http://localhost:18998/qgis/make/map
@@ -1,3 +0,0 @@
# qgis配置
qgis:
url: http://localhost:18998/qgis/make/map