Commit 6a0b2312 authored by libin's avatar libin

综合搜索业务

parent 6771567b
...@@ -2,14 +2,14 @@ package com.xxfc.platform.uccn.rest; ...@@ -2,14 +2,14 @@ package com.xxfc.platform.uccn.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.uccn.biz.SearchBiz; import com.xxfc.platform.uccn.biz.SearchBiz;
import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.vo.SearchResultVo; import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author libin * @author libin
...@@ -23,11 +23,49 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -23,11 +23,49 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "官网*综合搜索") @Api(tags = "官网*综合搜索")
public class SearchController { public class SearchController {
private final SearchBiz searchBiz; private final SearchBiz searchBiz;
private final VehicleModelController vehicleModelController;
private final GwTourController gwTourController;
private final CampsiteUccnController campsiteUccnController;
private final ArticleController articleController;
private final SummitActivityController summitActivityController;
private final BranchCompanyController branchCompanyController;
@GetMapping @GetMapping
public ObjectRestResponse<SearchResultVo> search(@RequestParam(value = "keyword",required = false) String keyWord ){ public ObjectRestResponse search(@RequestParam(value = "type", required = false) String type,
SearchResultVo searchResultVo = searchBiz.searchWithKeyWords(keyWord); @RequestParam(value = "keyword", required = false) String keyWord,
return ObjectRestResponse.succ(searchResultVo); @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "limit", required = false, defaultValue = "10") Integer limit) {
switch (type) {
case ServiceConstant.VEHICLE:
VehicleModelQueryCondition vehicleModelQueryCondition = new VehicleModelQueryCondition();
vehicleModelQueryCondition.setPage(page);
vehicleModelQueryCondition.setLimit(limit);
vehicleModelQueryCondition.setVehicleName(keyWord);
return vehicleModelController.findVehicleModelPageUnauthfind(vehicleModelQueryCondition);
case ServiceConstant.BRANCH_COMPANY:
BranchCompanyFindDTO branchCompanyFindDTO = new BranchCompanyFindDTO();
branchCompanyFindDTO.setPage(page);
branchCompanyFindDTO.setLimit(limit);
branchCompanyFindDTO.setName(keyWord);
return branchCompanyController.listBranchCompanyWithPage(branchCompanyFindDTO);
case ServiceConstant.TROUR:
return gwTourController.getGoodList(page, limit, null, keyWord);
case ServiceConstant.CAMPSITE:
return campsiteUccnController.findCampsiteShopPageByType(null, page, limit, keyWord);
case ServiceConstant.NEWS:
return articleController.getArticleList(page, limit, null, keyWord);
case ServiceConstant.ACTIVITY:
return summitActivityController.findSummitActivityWithPage(page, limit, null, keyWord);
default:
SearchResultVo searchResultVo = searchBiz.searchWithKeyWords(keyWord);
return ObjectRestResponse.succ(searchResultVo);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment