mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-04 16:26:40 +00:00
上传代码
This commit is contained in:
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user