bug 6708 h5中去除notice内容的html标签
This commit is contained in:
parent
86c53aff0a
commit
2608079db1
|
|
@ -16,6 +16,8 @@ import com.bonus.system.service.ISysNoticeService;
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl implements ISysNoticeService
|
public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
{
|
{
|
||||||
|
private static final String HTML_REGEX = "(?s)<[^>]*>(\\s*<[^>]*>)*";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysNoticeMapper noticeMapper;
|
private SysNoticeMapper noticeMapper;
|
||||||
|
|
||||||
|
|
@ -28,7 +30,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
@Override
|
@Override
|
||||||
public SysNotice selectNoticeById(Long noticeId)
|
public SysNotice selectNoticeById(Long noticeId)
|
||||||
{
|
{
|
||||||
return noticeMapper.selectNoticeById(noticeId);
|
SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId);
|
||||||
|
sysNotice.setNoticeContentNoHtml(sysNotice.getNoticeContent().replaceAll(HTML_REGEX, ""));
|
||||||
|
return sysNotice;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,7 +45,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice)
|
public List<SysNotice> selectNoticeList(SysNotice notice)
|
||||||
{
|
{
|
||||||
List<SysNotice> list = noticeMapper.selectNoticeList(notice);
|
List<SysNotice> list = noticeMapper.selectNoticeList(notice);
|
||||||
list.stream().forEach(o -> o.setNoticeContentNoHtml(o.getNoticeContent().replaceAll("(?s)<[^>]*>(\\s*<[^>]*>)*", "")));
|
list.stream().forEach(o -> o.setNoticeContentNoHtml(o.getNoticeContent().replaceAll(HTML_REGEX, "")));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue