| | |
| | | package com.oying.modules.pc.search.rest; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.oying.modules.pc.common.core.domain.R; |
| | | import com.oying.utils.R; |
| | | import com.oying.modules.pc.search.domain.dto.NearbyStoreQueryCriteria; |
| | | import com.oying.modules.pc.search.domain.dto.StoreSearchDto; |
| | | import com.oying.modules.pc.search.view.StoreSearchView; |
| | |
| | | return R.success(toStoreSearchVo(storeSearchService.findNearStores(criteria))); |
| | | } |
| | | |
| | | /** |
| | | * 查询最近的店铺 |
| | | */ |
| | | @GetMapping("/find") |
| | | public R<PageResult<StoreSearchView>> find(NearbyStoreQueryCriteria criteria) { |
| | | return R.success(toStoreSearchVo(storeSearchService.findNearStores(criteria))); |
| | | } |
| | | |
| | | private PageResult<StoreSearchView> toStoreSearchVo(PageResult<StoreSearchDto> resources) { |
| | | PageResult<StoreSearchView> t = new PageResult<>(); |
| | | t.setTotalElements(resources.getTotalElements()); |