|
@@ -121,12 +121,8 @@ public class CmsNewsController extends BaseController
|
121
|
121
|
@PostMapping
|
122
|
122
|
public ResultUtil add(@RequestBody CmsNews cmsNews)
|
123
|
123
|
{
|
124
|
|
- if(StringUtils.isNotEmpty(cmsNews.getContent())){
|
125
|
|
- cmsNews.setContent(HtmlUtils.htmlUnescape(cmsNews.getContent()));
|
126
|
|
- }
|
127
|
|
- if(StringUtils.isNotEmpty(cmsNews.getTitle())){
|
128
|
|
- cmsNews.setTitle(HtmlUtils.htmlUnescape(cmsNews.getTitle()));
|
129
|
|
- }
|
|
124
|
+ cmsNews.setContent(htmlUnescape(cmsNews.getContent()));
|
|
125
|
+ cmsNews.setTitle(htmlUnescape(cmsNews.getTitle()));
|
130
|
126
|
cmsNews.setCreateBy(getNickName());
|
131
|
127
|
return resultByRows(cmsNewsService.insertCmsNews(cmsNews));
|
132
|
128
|
}
|
|
@@ -140,12 +136,8 @@ public class CmsNewsController extends BaseController
|
140
|
136
|
@PutMapping
|
141
|
137
|
public ResultUtil edit(@RequestBody CmsNews cmsNews)
|
142
|
138
|
{
|
143
|
|
- if(StringUtils.isNotEmpty(cmsNews.getContent())){
|
144
|
|
- cmsNews.setContent(HtmlUtils.htmlUnescape(cmsNews.getContent()));
|
145
|
|
- }
|
146
|
|
- if(StringUtils.isNotEmpty(cmsNews.getTitle())){
|
147
|
|
- cmsNews.setTitle(HtmlUtils.htmlUnescape(cmsNews.getTitle()));
|
148
|
|
- }
|
|
139
|
+ cmsNews.setContent(htmlUnescape(cmsNews.getContent()));
|
|
140
|
+ cmsNews.setTitle(htmlUnescape(cmsNews.getTitle()));
|
149
|
141
|
cmsNews.setUpdateBy(getNickName());
|
150
|
142
|
return resultByRows(cmsNewsService.updateCmsNews(cmsNews));
|
151
|
143
|
}
|