|
@@ -70,6 +70,19 @@ public class TbNewsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 外部获取资讯详细信息(用于app分享资讯)
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/detail/{id}")
|
|
|
+ public AjaxResult detail(@PathVariable("id") Long id) {
|
|
|
+ TbNews news = iTbNewsService.getById(id);
|
|
|
+ if (news != null && news.getState() == 0) {
|
|
|
+ return AjaxResult.success(iTbNewsService.getById(id));
|
|
|
+ } else {
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 新增资讯
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:news:add')")
|
|
@@ -103,7 +116,7 @@ public class TbNewsController extends BaseController {
|
|
|
return toAjax(iTbNewsService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
}
|
|
|
|
|
|
- //从html中提取纯文本
|
|
|
+ //从html中提取纯文本作为摘要
|
|
|
private String StripHT(String strHtml) {
|
|
|
String txtcontent = strHtml.replaceAll("</?[^>]+>", ""); //剔出<html>的标签
|
|
|
txtcontent = txtcontent.replaceAll("<a>\\s*|\t|\r|\n</a>", "");//去除字符串中的空格,回车,换行符,制表符
|