Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
0f2cd814
Commit
0f2cd814
authored
Jul 21, 2020
by
vip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
content浏览量+1
parent
82f7af69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
ContentAction.java
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
+24
-4
No files found.
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
View file @
0f2cd814
...
...
@@ -4,13 +4,13 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
net.mingsoft.base.entity.BaseEntity
;
import
net.mingsoft.base.entity.ResultData
;
import
net.mingsoft.basic.bean.EUListBean
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.biz.IHistoryLogBiz
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
net.mingsoft.cms.entity.HistoryLogEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
...
...
@@ -18,14 +18,13 @@ import org.springframework.validation.BindingResult;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
/**
* 文章管理控制层
...
...
@@ -45,6 +44,9 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@Autowired
private
IContentBiz
contentBiz
;
@Autowired
private
IHistoryLogBiz
historyLogBiz
;
/**
* 查询文章列表
* @param content 文章实体
...
...
@@ -106,7 +108,25 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
this
.
outString
(
response
,
"document.write(0)"
);
return
;
}
//获取ip
String
ip
=
BasicUtil
.
getIp
();
//获取端口(移动/web..)
boolean
isMobileDevice
=
BasicUtil
.
isMobileDevice
();
ContentEntity
content
=
(
ContentEntity
)
contentBiz
.
getEntity
(
contentId
);
//浏览数+1
content
.
setContentHit
(
content
.
getContentHit
()+
1
);
contentBiz
.
updateEntity
(
content
);
// cms_history 增加相应记录
HistoryLogEntity
entity
=
new
HistoryLogEntity
();
entity
.
setHlIsMobile
(
isMobileDevice
);
entity
.
setHlIp
(
ip
);
entity
.
setContentId
(
content
.
getId
());
entity
.
setCreateDate
(
new
Date
());
historyLogBiz
.
saveEntity
(
entity
);
if
(
content
==
null
){
this
.
outString
(
response
,
"document.write(0)"
);
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment