|
@@ -3,10 +3,16 @@ package com.onemap.analyse.controller.analyse;
|
|
|
import com.onemap.analyse.service.AnalyseUtilsDBService;
|
|
|
import com.onemap.analyse.service.CreateUtilsDBService;
|
|
|
import com.onemap.common.core.web.controller.BaseController;
|
|
|
+import com.onemap.common.core.web.domain.RequestResult;
|
|
|
+import com.onemap.common.datasource.annotation.Slave;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 基于pgsql里的POST做的生成数据组件
|
|
|
*/
|
|
@@ -15,4 +21,31 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class CreateUtilsDBController extends BaseController {
|
|
|
@Autowired
|
|
|
private CreateUtilsDBService createUtilsDBService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成表空间数据的缓冲区
|
|
|
+ *
|
|
|
+ * @param tableName
|
|
|
+ * @param radius
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/buffer/tables")
|
|
|
+ @Slave
|
|
|
+ public RequestResult bufferTables(@RequestParam(value = "tableName") String tableName, @RequestParam(value = "radius") Float radius) {
|
|
|
+ return RequestResult.success(createUtilsDBService.bufferTable(tableName, radius));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成表tableNameB空间数据的差集,B-ST_Intersection(A,B)
|
|
|
+ *
|
|
|
+ * @param tableNameA
|
|
|
+ * @param tableNameB
|
|
|
+ * @param tableIdsB
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/difference/tables")
|
|
|
+ @Slave
|
|
|
+ public RequestResult differenceTables(@RequestParam(value = "inputTableA") String tableNameA, @RequestParam(value = "inputTableB") String tableNameB, @RequestParam(value = "inputIdsB", required = false) List<String> tableIdsB) {
|
|
|
+ return RequestResult.success(createUtilsDBService.differenceTables(tableNameA, tableNameB, tableIdsB));
|
|
|
+ }
|
|
|
}
|