|
@@ -70,19 +70,6 @@ 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')")
|
|
@PreAuthorize("@ss.hasPermi('system:news:add')")
|
|
@@ -116,7 +103,7 @@ public class TbNewsController extends BaseController {
|
|
return toAjax(iTbNewsService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
return toAjax(iTbNewsService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
}
|
|
}
|
|
|
|
|
|
- //从html中提取纯文本作为摘要
|
|
|
|
|
|
+ //从html中提取纯文本
|
|
private String StripHT(String strHtml) {
|
|
private String StripHT(String strHtml) {
|
|
String txtcontent = strHtml.replaceAll("</?[^>]+>", ""); //剔出<html>的标签
|
|
String txtcontent = strHtml.replaceAll("</?[^>]+>", ""); //剔出<html>的标签
|
|
txtcontent = txtcontent.replaceAll("<a>\\s*|\t|\r|\n</a>", "");//去除字符串中的空格,回车,换行符,制表符
|
|
txtcontent = txtcontent.replaceAll("<a>\\s*|\t|\r|\n</a>", "");//去除字符串中的空格,回车,换行符,制表符
|