|
@@ -226,6 +226,20 @@ public class ArticleController {
|
|
|
redirectAttributes.addAttribute("message", "删除文章成功");
|
|
|
return "redirect:list";
|
|
|
}
|
|
|
+ @RequestMapping(value = "publish")
|
|
|
+ public String publish(Article article, RedirectAttributes redirectAttributes) throws UnsupportedEncodingException, APIConnectionException, APIRequestException {
|
|
|
+
|
|
|
+ Article articlec = articleService.findOne(article.getId());
|
|
|
+ articlec.setDelFlag("0");
|
|
|
+ articleService.save(articlec);
|
|
|
+ redirectAttributes.addAttribute("message", "发布文章成功");
|
|
|
+ // 栏目区分为 2:交通要闻时 发推送消息
|
|
|
+ if (article.getCategory() != null && "2".equals(article.getCategory().getId())
|
|
|
+ && "1".equals(article.getAppIndexView())) {
|
|
|
+ sendMessage(article.getTitle());
|
|
|
+ }
|
|
|
+ return "redirect:list";
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 通过编号获取文章标题
|