|
@@ -3,10 +3,13 @@ package com.caimei.www.controller.unlimited;
|
|
|
import com.caimei.www.controller.BaseController;
|
|
|
import com.caimei.www.pojo.JsonModel;
|
|
|
import com.caimei.www.pojo.page.BaseLink;
|
|
|
+import com.caimei.www.pojo.page.ImageLink;
|
|
|
import com.caimei.www.service.ArticleService;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -53,4 +56,18 @@ public class ArticleController extends BaseController {
|
|
|
public JsonModel<List<BaseLink>> getArticleLabels() {
|
|
|
return articleService.getArticleLabels();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取文章推荐
|
|
|
+ */
|
|
|
+ @GetMapping("/article/recommend")
|
|
|
+ @ResponseBody
|
|
|
+ public JsonModel<PageInfo<ImageLink>> getArticleRecommended(Integer typeId,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "3") int pageSize) {
|
|
|
+ return articleService.getArticleRecommended(typeId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|