|
|
@ -3,8 +3,10 @@ package com.elink.esua.epdc.controller; |
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|
|
|
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcNoticeBrowseFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcNoticeFormDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.*; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNewsDetailResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNewsResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNoticeDetailResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcNoticeResultDTO; |
|
|
|
import com.elink.esua.epdc.service.NewsService; |
|
|
@ -66,4 +68,64 @@ public class ApiNewsController { |
|
|
|
public Result<EpdcNoticeDetailResultDTO> browseNotice(@RequestBody EpdcNoticeBrowseFormDTO formDto) { |
|
|
|
return newsService.updateReadingAmount(formDto); |
|
|
|
} |
|
|
|
/*** |
|
|
|
* @Description 新闻列表 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/9 9:12 |
|
|
|
* @Param [epdcNewsFromDTO] |
|
|
|
* @Return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcNewsResultDTO>> |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@GetMapping("news/list") |
|
|
|
public Result<List<EpdcNewsResultDTO>> listNews(@LoginUser TokenDto userDetail, EpdcNewsFromDTO epdcNewsFromDTO){ |
|
|
|
|
|
|
|
return newsService.listNews(userDetail,epdcNewsFromDTO); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
* @Description 新闻详情 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/7 14:13 |
|
|
|
* @Param [id] |
|
|
|
* @Return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcNewsDetailResultDTO> |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@GetMapping("news/detail/{newsId}") |
|
|
|
public Result<EpdcNewsDetailResultDTO> getNewsDetail(@PathVariable("id") String id){ |
|
|
|
Result<EpdcNewsDetailResultDTO> newsDetail = newsService.getNewsDetail(id); |
|
|
|
return newsDetail; |
|
|
|
} |
|
|
|
/*** |
|
|
|
* @Description 点赞或踩 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/7 14:15 |
|
|
|
* @Param [] |
|
|
|
* @Return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@PostMapping("statement") |
|
|
|
public Result upDateStatement(@LoginUser TokenDto userDetail, EpdcNewsStatementFromDTO newsStatementFromDTO){ |
|
|
|
ValidatorUtils.validateEntity(newsStatementFromDTO); |
|
|
|
return newsService.upDateStatement(userDetail,newsStatementFromDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/*** |
|
|
|
* @Description 新闻浏览 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/7 14:47 |
|
|
|
* @Param [newsBrowseFromDTO] |
|
|
|
* @Return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@PostMapping("browse") |
|
|
|
public Result modifyNewsBrowse(@RequestBody EpdcNewsBrowseFromDTO newsBrowseFromDTO){ |
|
|
|
ValidatorUtils.validateEntity(newsBrowseFromDTO); |
|
|
|
return newsService.modifyNewsBrowse(newsBrowseFromDTO); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|