| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.NewsListDto; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.service.IApiMallNewsService; |
| | | import cc.mrbird.febs.mall.vo.NewsListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | private final IApiMallNewsService newsService; |
| | | |
| | | @ApiOperation(value = "新闻分类", notes = "新闻分类") |
| | | @GetMapping(value = "/findNewsInfoCategory") |
| | | public FebsResponse findNewsInfoCategory() { |
| | | return new FebsResponse().success().data(newsService.findNewsCategoryList()); |
| | | } |
| | | |
| | | @ApiOperation(value ="获取新闻列表-分页", notes = "获取新闻列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = NewsListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findNewsInPage") |
| | | public FebsResponse findNewsInPage(@RequestBody NewsListDto newsListDto) { |
| | | return new FebsResponse().success().data(newsService.findNewsInPage(newsListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新闻列表", notes = "新闻列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = NewsListVo.class) |
| | | }) |
| | | @GetMapping(value = "/findNews") |
| | | public FebsResponse findNews() { |
| | | return new FebsResponse().success().data(newsService.list()); |
| | | return new FebsResponse().success().data(newsService.findTopNews()); |
| | | } |
| | | |
| | | @ApiOperation(value = "新闻详情", notes = "新闻详情") |
| | |
| | | } |
| | | return new FebsResponse().success().data(news); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页轮播图", notes = "首页轮播图") |
| | | @GetMapping(value = "/bannerList") |
| | | public FebsResponse findPlatformBannerList() { |
| | | return newsService.findAllBanner(); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页视频", notes = "首页视频") |
| | | @GetMapping(value = "/indexVideo") |
| | | public FebsResponse indexVideo() { |
| | | return newsService.indexVideo(); |
| | | } |
| | | } |