|
|
@@ -1,6 +1,7 @@
|
|
|
package com.onemap.apply.controller.yzt;
|
|
|
|
|
|
import com.onemap.apply.domain.yzt.CollectionDTO;
|
|
|
+import com.onemap.apply.domain.yzt.PoiDTO;
|
|
|
import com.onemap.apply.domain.yzt.PoiSearchDTO;
|
|
|
import com.onemap.apply.service.yzt.ISearchService;
|
|
|
import com.onemap.common.core.web.controller.BaseController;
|
|
|
@@ -9,6 +10,7 @@ import com.onemap.common.security.utils.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
@@ -61,18 +63,21 @@ public class searchController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
+ *
|
|
|
* 分词查询list
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/poiSearchList")
|
|
|
public RequestResult poiSearchList(@RequestBody PoiSearchDTO poiSearchDTO) {
|
|
|
- if(poiSearchDTO.getOffset() != null && poiSearchDTO.getLimit() != null) {
|
|
|
- poiSearchDTO.setOffset(0);
|
|
|
+ try {
|
|
|
+ List<PoiDTO> res = searchService.poiSearch(poiSearchDTO);
|
|
|
+ return RequestResult.success("查询成功!", res);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return RequestResult.error("查询失败!");
|
|
|
}
|
|
|
- return searchService.poi(poiSearchDTO);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -81,14 +86,19 @@ public class searchController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping("/getPoiByName")
|
|
|
+ @RequestMapping("/getPoiByName")
|
|
|
public RequestResult getPoiByName(@RequestBody PoiSearchDTO poiSearchDTO) {
|
|
|
- //return searchService.poi(poiSearchDTO);
|
|
|
- return RequestResult.success("查询成功!", null);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ PoiDTO res = searchService.getPoiByName(poiSearchDTO);
|
|
|
+ return RequestResult.success("查询成功!", res);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return RequestResult.error("查询失败!");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|