|
@@ -1,14 +1,18 @@
|
|
|
package org.jetlinks.community.device.web;
|
|
package org.jetlinks.community.device.web;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
+import org.hswebframework.web.api.crud.entity.PagerResult;
|
|
|
import org.hswebframework.web.api.crud.entity.QueryParamEntity;
|
|
import org.hswebframework.web.api.crud.entity.QueryParamEntity;
|
|
|
import org.hswebframework.web.authorization.annotation.Authorize;
|
|
import org.hswebframework.web.authorization.annotation.Authorize;
|
|
|
import org.hswebframework.web.authorization.annotation.Resource;
|
|
import org.hswebframework.web.authorization.annotation.Resource;
|
|
|
|
|
+import org.hswebframework.web.bean.FastBeanCopier;
|
|
|
import org.hswebframework.web.crud.service.ReactiveCrudService;
|
|
import org.hswebframework.web.crud.service.ReactiveCrudService;
|
|
|
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
|
|
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
|
|
|
-import org.jetlinks.community.device.entity.GeoEntity;
|
|
|
|
|
|
|
+import org.jetlinks.community.device.entity.geo.GeoEntity;
|
|
|
import org.jetlinks.community.device.service.LocalGeoService;
|
|
import org.jetlinks.community.device.service.LocalGeoService;
|
|
|
|
|
+import org.jetlinks.community.device.service.data.GeoData;
|
|
|
import org.jetlinks.community.device.web.request.GeoPayload;
|
|
import org.jetlinks.community.device.web.request.GeoPayload;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -16,6 +20,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import reactor.core.publisher.Mono;
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @author lifang
|
|
* @author lifang
|
|
|
* @version 1.0.0
|
|
* @version 1.0.0
|
|
@@ -39,8 +46,9 @@ public class GeoController implements ReactiveServiceCrudController<GeoEntity,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/geo.json")
|
|
@PostMapping("/geo.json")
|
|
|
- public Mono<Void> save(@RequestBody Mono<GeoPayload> publisher){
|
|
|
|
|
- return publisher.map(GeoPayload::getFeatures)
|
|
|
|
|
|
|
+ public Mono<Void> save(@RequestBody GeoPayload publisher){
|
|
|
|
|
+ return Mono.just(publisher)
|
|
|
|
|
+ .map(GeoPayload::getFeatures)
|
|
|
.map(Mono::just)
|
|
.map(Mono::just)
|
|
|
.flatMap(geoService::insertBatch)
|
|
.flatMap(geoService::insertBatch)
|
|
|
.then();
|
|
.then();
|