上传代码

This commit is contained in:
xxy
2020-05-02 15:05:21 +08:00
parent c8c80fa719
commit ed34c67d08
733 changed files with 61899 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package com.java2nb.novel.controller;
import com.github.pagehelper.PageInfo;
import com.java2nb.novel.core.bean.ResultBean;
import com.java2nb.novel.service.NewsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author 11797
*/
@RequestMapping("news")
@RestController
@Slf4j
@RequiredArgsConstructor
public class NewsController {
private final NewsService newsService;
/**
* 查询首页新闻
* */
@PostMapping("listIndexNews")
public ResultBean listIndexNews(){
return ResultBean.ok(newsService.listIndexNews());
}
/**
* 分页查询新闻列表
* */
@PostMapping("listByPage")
public ResultBean listByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize){
return ResultBean.ok(new PageInfo<>(newsService.listByPage(page,pageSize)));
}
}