package org.sxkj.odm.controller;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.tool.api.R;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import org.sxkj.odm.service.WhiteFilmGeoJsoService;
|
|
@RestController
|
@RequestMapping("/whiteFilmGeoJson")
|
@Slf4j
|
@Api(tags = {"白膜模型数据接口"})
|
public class WhiteFilmGeoJsonController {
|
|
@Autowired
|
private WhiteFilmGeoJsoService whiteFilmGeoJsoService;
|
|
/**
|
* 获取建筑白膜模型的 GeoJSON 数据
|
*
|
* @param districtCode 行政区划code (可选)
|
* @param orgId 机构id (可选)
|
* @return GeoJSON 格式的建筑白膜数据
|
*/
|
@GetMapping("/getBuildingWhiteFilmGeoJson")
|
@ApiOperation(value = "获取建筑白膜模型的 GeoJSON 数据", notes = "获取建筑白膜模型的 GeoJSON 数据")
|
public R getBuildingWhiteFilmGeoJson(
|
@ApiParam(value = "行政区划code", required = false) String districtCode,
|
@ApiParam(value = "机构id", required = false) String orgId) {
|
try {
|
String geojsonData = whiteFilmGeoJsoService.getBuildingWhiteFilmGeoJson(districtCode, orgId);
|
return R.data(geojsonData);
|
} catch (Exception e) {
|
log.error("获取建筑白膜数据失败: {}", e.getMessage(), e);
|
return R.fail("获取建筑白膜数据失败: " + e.getMessage());
|
}
|
}
|
|
/**
|
* 获取区域网格模型的 GeoJSON 数据
|
*
|
* @param districtCode 行政区划code (可选)
|
* @param orgId 机构id (可选)
|
* @return GeoJSON 格式的区域网格数据
|
*/
|
@GetMapping("/getAreaGridFilmGeoJson")
|
@ApiOperation(value = "获取区域网格模型的 GeoJSON 数据", notes = "获取区域网格模型的 GeoJSON 数据")
|
public R getAreaGridFilmGeoJson(
|
@ApiParam(value = "行政区划code", required = false) String districtCode,
|
@ApiParam(value = "机构id", required = false) String orgId) {
|
try {
|
String geojsonData = whiteFilmGeoJsoService.getAreaGridFilmGeoJson(districtCode, orgId);
|
return R.data(geojsonData);
|
} catch (Exception e) {
|
log.error("获取区域网格数据失败: {}", e.getMessage(), e);
|
}
|
return R.fail("获取区域网格数据失败: ");
|
}
|
|
}
|