Commit 42f5dc2c authored by unset's avatar unset

修改banner接口

parent f296f3c0
......@@ -2,7 +2,6 @@ package com.xxfc.platform.uccn.biz;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
......@@ -12,7 +11,6 @@ import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo;
......@@ -199,24 +197,24 @@ public class SearchBiz {
}
});
//新闻
threadPoolTaskExecutor.execute(new Runnable() {
@Override
public void run() {
try {
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
PageInfo articleList = articleBiz.getArticleList(1, ServiceConstant.NEWS_LIMIT, 1, keyWord);
List<Article> result = articleList == null ? Collections.EMPTY_LIST : articleList.getList() == null ? Collections.EMPTY_LIST : articleList.getList();
articleServiceResultVo.setData(result);
articleServiceResultVo.setTotalCount(articleList.getTotal());
searchResultVo.put(ServiceConstant.NEWS, articleServiceResultVo);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
latch.countDown();
}
}
});
// threadPoolTaskExecutor.execute(new Runnable() {
// @Override
// public void run() {
// try {
// ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
// PageInfo articleList = articleBiz.getArticleList(1, ServiceConstant.NEWS_LIMIT, 1, keyWord);
// List<Article> result = articleList == null ? Collections.EMPTY_LIST : articleList.getList() == null ? Collections.EMPTY_LIST : articleList.getList();
// articleServiceResultVo.setData(result);
// articleServiceResultVo.setTotalCount(articleList.getTotal());
// searchResultVo.put(ServiceConstant.NEWS, articleServiceResultVo);
// } catch (Exception ex) {
// ex.printStackTrace();
// } finally {
// latch.countDown();
// }
//
// }
// });
try {
latch.await();
} catch (InterruptedException e) {
......
package com.xxfc.platform.uccn.rest;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.uccn.biz.SearchBiz;
import com.xxfc.platform.uccn.comstnt.ServiceConstant;
import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.vo.SearchResultVo;
import com.xxfc.platform.uccn.vo.ServiceResultVo;
import com.xxfc.platform.uccn.vo.SummitActivityVo;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition;
import com.xxfc.platform.vehicle.pojo.VehicleModelVo;
import com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO;
......@@ -19,7 +16,10 @@ import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
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;
......@@ -106,16 +106,16 @@ public class SearchController {
campsiteSearchResultVo.put(ServiceConstant.CAMPSITE,campsiteShopPageVoServiceResultVo);
return ObjectRestResponse.succ(campsiteSearchResultVo);
case ServiceConstant.NEWS:
ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord);
PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData();
List<Article> articleList = articlePageDataVO.getList();
Long articleTotalCount = articlePageDataVO.getTotal();
ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
articleServiceResultVo.setTotalCount(articleTotalCount);
articleServiceResultVo.setData(articleList);
SearchResultVo articleSearchResult= new SearchResultVo();
articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo);
return ObjectRestResponse.succ(articleSearchResult);
// ObjectRestResponse articleresult = articleController.getArticleList(page, limit, 1, keyWord);
// PageInfo<Article> articlePageDataVO = (PageInfo<Article>)articleresult.getData();
// List<Article> articleList = articlePageDataVO.getList();
// Long articleTotalCount = articlePageDataVO.getTotal();
// ServiceResultVo<Article> articleServiceResultVo = new ServiceResultVo<>();
// articleServiceResultVo.setTotalCount(articleTotalCount);
// articleServiceResultVo.setData(articleList);
// SearchResultVo articleSearchResult= new SearchResultVo();
// articleSearchResult.put(ServiceConstant.NEWS,articleServiceResultVo);
// return ObjectRestResponse.succ(articleSearchResult);
case ServiceConstant.ACTIVITY:
ObjectRestResponse<PageDataVO<SummitActivityVo>> summitActivityWithPage = summitActivityController.findSummitActivityWithPage(page, limit, null, keyWord);
List<SummitActivityVo> summitActivityVos = summitActivityWithPage.getData().getData();
......
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