|
@@ -8,6 +8,7 @@ import com.caimei.www.service.page.ArticleService;
|
|
|
import com.caimei.www.service.page.CmBrandLandingService;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
|
import com.caimei.www.utils.PaginationVo;
|
|
|
+import com.caimei.www.utils.ResponseJson;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -62,7 +63,7 @@ public class ArticleController extends BaseController {
|
|
|
List<BaseLink> typeList = articleService.getArticleTypes();
|
|
|
List<CmBrandLandingVO> cmBrandLandingList = cmBrandLandingService.getCmBrandLandingList(new CmBrandLanding()
|
|
|
.setType("4").setAuthorId(id.toString()));
|
|
|
- List<ImageLink> infoSelected = articleService.getArticleSelected(0, 5);
|
|
|
+ List<Article> infoSelected = articleService.getArticleSelected(0, 5);
|
|
|
List<CmProductArchiveFile> archiveFiles = articleService.findArchiveFileAddTime(0, 3);
|
|
|
List<ProductList> productSellNumbers = productService.getProductSellNumbers();
|
|
|
List<BaseLink> data = articleService.getArticleLabels().getData();
|
|
@@ -109,14 +110,6 @@ public class ArticleController extends BaseController {
|
|
|
public String selectedList(@PathVariable("id") Integer id, @PathVariable("pageNum") Integer pageNum, final Model model) {
|
|
|
PageHelper.startPage(pageNum, 10);
|
|
|
List<BaseLink> typeList = articleService.getArticleTypes();
|
|
|
- PaginationVo pageData = null;
|
|
|
- if (id == 1) {//精选文章
|
|
|
- List<ImageLink> infoSelected = articleService.getArticleSelected(null, null);
|
|
|
- pageData = new PaginationVo<ImageLink>(infoSelected);
|
|
|
- } else {//美业资料
|
|
|
- List<CmProductArchiveFile> archiveFiles = articleService.findArchiveFileAddTime(null, null);
|
|
|
- pageData = new PaginationVo<CmProductArchiveFile>(archiveFiles);
|
|
|
- }
|
|
|
if (id == 1) {//精选文章
|
|
|
List<CmProductArchiveFile> archiveFiles = articleService.findArchiveFileAddTime(0, 3);
|
|
|
List<ProductList> productSellNumbers = productService.getProductSellNumbers();
|
|
@@ -128,15 +121,29 @@ public class ArticleController extends BaseController {
|
|
|
model.addAttribute("ads", Ads);
|
|
|
model.addAttribute("labels", data);
|
|
|
model.addAttribute("articleType", typeList);//导航栏
|
|
|
- model.addAttribute("pageData", pageData);
|
|
|
model.addAttribute("labelId", 0);
|
|
|
model.addAttribute("pageNum", pageNum);
|
|
|
model.addAttribute("isSearch", true);
|
|
|
return ARTICLE_LIST_PATH;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
- * 文章搜索结果
|
|
|
+ * 精选文章和美业资料列表数据
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
+ @GetMapping("/info/articlerecommendation/{id}")
|
|
|
+ public ResponseJson<PaginationVo> toPagination(@PathVariable("id") Integer id) {
|
|
|
+ PaginationVo pageData = null;
|
|
|
+ if (id == 1) {//精选文章
|
|
|
+ List<Article> infoSelected = articleService.getArticleSelected(null, null);
|
|
|
+ pageData = new PaginationVo<Article>(infoSelected);
|
|
|
+ } else {//美业资料
|
|
|
+ List<CmProductArchiveFile> archiveFiles = articleService.findArchiveFileAddTime(null, null);
|
|
|
+ pageData = new PaginationVo<CmProductArchiveFile>(archiveFiles);
|
|
|
+ }
|
|
|
+ return ResponseJson.success(pageData);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/info/search-{pageNum}.html")
|
|
|
public String toArticleSearch(@PathVariable("pageNum") Integer pageNum, final Model model) {
|
|
|
List<BaseLink> typeList = articleService.getArticleTypes();
|
|
@@ -199,7 +206,7 @@ public class ArticleController extends BaseController {
|
|
|
articles = articleService.getArticleRelatedId(id.toString());
|
|
|
}
|
|
|
String relatedLabels = articleService.relatedLabel(id);
|
|
|
- List<ImageLink> infoSelected = articleService.getArticleSelected(0, 5);
|
|
|
+ List<Article> infoSelected = articleService.getArticleSelected(0, 5);
|
|
|
List<CmProductArchiveFile> archiveFiles = articleService.findArchiveFileAddTime(0, 3);
|
|
|
List<ProductList> productSellNumbers = productService.getProductSellNumbers();
|
|
|
model.addAttribute("infoSelected", infoSelected);//精选文章
|