Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
scsm
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
scsm
Commits
39c60e75
提交
39c60e75
authored
1月 19, 2021
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
d7a445a8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
50 行增加
和
7 行删除
+50
-7
PermissionsController.java
...user/bg/controller/permissions/PermissionsController.java
+4
-5
FgNewsController.java
...com/zrqx/sysuser/fg/controller/news/FgNewsController.java
+44
-0
FgNewsMapper.java
...in/java/com/zrqx/sysuser/fg/mapper/news/FgNewsMapper.java
+2
-2
没有找到文件。
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/bg/controller/permissions/PermissionsController.java
浏览文件 @
39c60e75
package
com
.
zrqx
.
sysuser
.
bg
.
controller
.
permissions
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.util.HashMap
;
...
...
@@ -25,8 +22,6 @@ import org.springframework.web.bind.annotation.RequestHeader;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
sun.misc.BASE64Encoder
;
import
com.zrqx.core.constant.sysuser.SysUserRequestPath
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.enums.StatusEnum
;
...
...
@@ -43,6 +38,10 @@ import com.zrqx.sysuser.bg.service.modulepower.ModulepowerService;
import
com.zrqx.sysuser.bg.service.operatepower.OperatepowerService
;
import
com.zrqx.sysuser.bg.service.user.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
sun.misc.BASE64Encoder
;
/**
* 登录Controller
*/
...
...
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/controller/news/FgNewsController.java
浏览文件 @
39c60e75
...
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.zrqx.core.constant.sysuser.SysUserRequestPath
;
import
com.zrqx.core.form.resource.fg.pc.index.Pc_FgQueryForm
;
import
com.zrqx.core.model.sysuser.news.News
;
import
com.zrqx.core.util.datatype.ArrayUtils
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
...
...
@@ -38,6 +39,7 @@ public class FgNewsController {
@GetMapping
(
value
=
SysUserRequestPath
.
LIST
)
public
CallBack
<
List
<
FgIndexNewsListVO
>>
getListPage
(){
List
<
FgIndexNewsListVO
>
list
=
service
.
list
();
this
.
regEx
(
list
);
return
CallBack
.
success
(
list
);
}
...
...
@@ -59,4 +61,46 @@ public class FgNewsController {
return
CallBack
.
success
(
new
PageInfo
<
FgSearchListVO
>(
list
));
}
/**
* 去标签
* @param list
* @author ycw
* @date: 2019年4月18日 上午11:57:55
*/
private
void
regEx
(
List
<
FgIndexNewsListVO
>
list
){
if
(
ArrayUtils
.
isNotEmpty
(
list
)){
list
.
forEach
(
li
->
{
if
(
StringUtils
.
isNotBlank
(
li
.
getContentSummary
())){
li
.
setContentSummary
(
removeLabel
(
li
.
getContentSummary
()));
}
});
}
}
/**
* 去标签
* @param list
* @author ycw
* @date: 2019年4月18日 上午11:57:55
*/
private
String
removeLabel
(
String
text
){
if
(
StringUtils
.
isNotBlank
(
text
)){
//vo.setSummary(vo.getSummary().replaceAll("\\<.*?>", ""));
//定义script的正则表达式{或<script[^>]*?>[\\s\\S]*?<\\/script>
String
regEx_script
=
"<[\\s]*?script[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?script[\\s]*?>"
;
//定义style的正则表达式{或<style[^>]*?>[\\s\\S]*?<\\/style>
String
regEx_style
=
"<[\\s]*?style[^>]*?>[\\s\\S]*?<[\\s]*?\\/[\\s]*?style[\\s]*?>"
;
// 定义HTML标签的正则表达式
String
regEx_html
=
"<[^>]+>"
;
// 定义一些特殊字符的正则表达式 如:
String
regEx_special
=
"\\&[a-zA-Z]{1,10};"
;
text
=
text
.
replaceAll
(
regEx_script
,
""
)
.
replaceAll
(
regEx_style
,
""
)
.
replaceAll
(
regEx_html
,
""
)
.
replaceAll
(
regEx_special
,
""
);
return
text
;
}
return
null
;
}
}
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/mapper/news/FgNewsMapper.java
浏览文件 @
39c60e75
...
...
@@ -18,12 +18,12 @@ import com.zrqx.core.vo.resource.fg.pc.index.FgSearchListVO;
public
interface
FgNewsMapper
extends
BaseMapper
<
News
>{
@Select
(
"<script>"
+
"select be.newsid id,be.newsTitle name,be.cover,be.newPulishDate,be.contentSummary FROM sys_news be "
+
"where be.newsIsRecommend=1 order by be.newPulishDate desc LIMIT 5"
+
"where be.newsIsRecommend=1
and be.newsStatus=1
order by be.newPulishDate desc LIMIT 5"
+
"</script>"
)
List
<
FgIndexNewsListVO
>
list
();
@Select
(
"<script>"
+
"select be.newsid id,be.newsTitle name,be.cover,be.newPulishDate,be.contentSummary synopsis,be.clickNumber FROM sys_news be "
+
"where
be.newsIsRecommend=1
"
+
"where
1=1 and be.newsStatus=1
"
+
"<if test = '"
+
NOTBLANK
+
"(form.keywords)' >"
+
" and be.newsTitle like concat('%',#{form.keywords}, '%') "
+
"</if>"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论