|
@@ -14,6 +14,14 @@ import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.oa.dto.*;
|
|
|
+import com.xjrsoft.module.oa.dto.AddNewsDto;
|
|
|
+import com.xjrsoft.module.oa.dto.ChangeNewsDto;
|
|
|
+import com.xjrsoft.module.oa.dto.DeleteNewsRelationDto;
|
|
|
+import com.xjrsoft.module.oa.dto.NewsPageDto;
|
|
|
+import com.xjrsoft.module.oa.dto.NewsRelationPageDto;
|
|
|
+import com.xjrsoft.module.oa.dto.NewsReplyDto;
|
|
|
+import com.xjrsoft.module.oa.dto.UpdateNewsDto;
|
|
|
+import com.xjrsoft.module.oa.dto.UpdateNewsRelationDto;
|
|
|
import com.xjrsoft.module.oa.entity.News;
|
|
|
import com.xjrsoft.module.oa.entity.NewsAppendix;
|
|
|
import com.xjrsoft.module.oa.entity.NewsRelation;
|
|
@@ -152,20 +160,20 @@ public class NewsController {
|
|
|
|
|
|
@PutMapping("/change-status")
|
|
|
@ApiOperation(value = "发布或下架新闻")
|
|
|
- public RT<Boolean> changeStatus(@RequestParam("id") String id, @RequestParam("type") Integer type) throws Exception {
|
|
|
- News xjrNews = newsService.getById(id);
|
|
|
- if (type == null || xjrNews == null) {
|
|
|
+ public RT<Boolean> changeStatus(@RequestBody ChangeNewsDto changeNewsDto) throws Exception {
|
|
|
+ News xjrNews = newsService.getById(changeNewsDto.getId());
|
|
|
+ if (changeNewsDto.getStatus() == null || xjrNews == null) {
|
|
|
throw new Exception("参数异常");
|
|
|
}
|
|
|
- if (type.equals(xjrNews.getStatus())) {
|
|
|
- if (type == 2) {
|
|
|
+ if (changeNewsDto.getStatus().equals(xjrNews.getStatus())) {
|
|
|
+ if (changeNewsDto.getStatus() == 2) {
|
|
|
throw new Exception("新闻已发布!!!");
|
|
|
- } else if (type == 3) {
|
|
|
+ } else if (changeNewsDto.getStatus() == 3) {
|
|
|
throw new Exception("新闻已下架!!!");
|
|
|
}
|
|
|
}
|
|
|
//将原来的修改enabled_mark改为修改status
|
|
|
- xjrNews.setStatus(type);
|
|
|
+ xjrNews.setStatus(changeNewsDto.getStatus());
|
|
|
if(xjrNews.getStatus() == 2){
|
|
|
newsService.SendMessage(xjrNews.getId());
|
|
|
}
|