|
|
@@ -179,14 +179,19 @@ public class NewsController {
|
|
|
if (type == null || xjrNews == null) {
|
|
|
throw new Exception("参数异常");
|
|
|
}
|
|
|
- if (type.equals(xjrNews.getEnabledMark())) {
|
|
|
- if (type == 1) {
|
|
|
+ if (type.equals(xjrNews.getStatus())) {
|
|
|
+ if (type == 2) {
|
|
|
throw new Exception("新闻已发布!!!");
|
|
|
- } else if (type == 0) {
|
|
|
+ } else if (type == 3) {
|
|
|
throw new Exception("新闻已下架!!!");
|
|
|
}
|
|
|
}
|
|
|
- xjrNews.setEnabledMark(type);
|
|
|
+ //将原来的修改enabled_mark改为修改status
|
|
|
+ xjrNews.setStatus(type);
|
|
|
+ if(xjrNews.getStatus() == 2){
|
|
|
+ newsService.SendMessage(xjrNews.getId());
|
|
|
+ }
|
|
|
+
|
|
|
return RT.ok(newsService.updateById(xjrNews));
|
|
|
}
|
|
|
|