|
|
@ -2,10 +2,12 @@ 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.enums.BehaviorEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
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.*; |
|
|
|
import com.elink.esua.epdc.pointcommons.tools.annotation.RecordUserBehavior; |
|
|
|
import com.elink.esua.epdc.service.NewsService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -97,7 +99,7 @@ public class ApiNewsController { |
|
|
|
} |
|
|
|
|
|
|
|
/*** |
|
|
|
* @Description 点赞或踩 |
|
|
|
* @Description 点赞 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/7 14:15 |
|
|
|
* @Param [] |
|
|
@ -105,8 +107,23 @@ public class ApiNewsController { |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@PostMapping("news/statement") |
|
|
|
public Result upDateStatement(@LoginUser TokenDto userDetail, @RequestBody EpdcNewsStatementFromDTO newsStatementFromDTO) { |
|
|
|
@PostMapping("news/newsSupport") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.NEWS_SUPPORT,referenceId = "#{newsStatementFromDTO.getNewsId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result newsSupport(@LoginUser TokenDto userDetail, @RequestBody EpdcNewsStatementFromDTO newsStatementFromDTO) { |
|
|
|
return newsService.updateStatement(userDetail, newsStatementFromDTO); |
|
|
|
} |
|
|
|
/*** |
|
|
|
* @Description 点踩 |
|
|
|
* @Author qushutong |
|
|
|
* @Date 2019/9/7 14:15 |
|
|
|
* @Param [] |
|
|
|
* @Return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Exception |
|
|
|
* |
|
|
|
*/ |
|
|
|
@PostMapping("news/newsOpposition") |
|
|
|
@RecordUserBehavior(behavior = BehaviorEnum.NEWS_OPPOSITION,referenceId = "#{newsStatementFromDTO.getNewsId}",userId = "#{userDetail.getUserId}") |
|
|
|
public Result newsOpposition(@LoginUser TokenDto userDetail, @RequestBody EpdcNewsStatementFromDTO newsStatementFromDTO) { |
|
|
|
return newsService.updateStatement(userDetail, newsStatementFromDTO); |
|
|
|
} |
|
|
|
|
|
|
@ -120,9 +137,9 @@ public class ApiNewsController { |
|
|
|
* |
|
|
|
*/ |
|
|
|
@PostMapping("news/browse") |
|
|
|
public Result modifyNewsBrowse(@RequestBody EpdcNewsBrowseFromDTO newsBrowseFromDTO) { |
|
|
|
public Result modifyNewsBrowse(@LoginUser TokenDto userDetail,@RequestBody EpdcNewsBrowseFromDTO newsBrowseFromDTO) { |
|
|
|
ValidatorUtils.validateEntity(newsBrowseFromDTO); |
|
|
|
return newsService.modifyNewsBrowse(newsBrowseFromDTO); |
|
|
|
return newsService.modifyNewsBrowse(userDetail,newsBrowseFromDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|