Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
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
shenjunjie
brandkbs2
Commits
ea440514
Commit
ea440514
authored
Sep 20, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
关闭旧版日志存储 See merge request
!42
parents
65372643
b6e91782
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
+18
-21
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
View file @
ea440514
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.dao.BehaviorDao
;
import
com.zhiwei.brandkbs2.dao.BehaviorDao
;
import
com.zhiwei.brandkbs2.dao.UserDao
;
import
com.zhiwei.brandkbs2.dao.UserDao
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.listener.ApplicationProjectListener
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.User
;
import
com.zhiwei.brandkbs2.pojo.User
;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
...
@@ -13,7 +11,6 @@ import com.zhiwei.brandkbs2.pojo.vo.BehaviorVO;
...
@@ -13,7 +11,6 @@ import com.zhiwei.brandkbs2.pojo.vo.BehaviorVO;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.tuple.Pair
;
import
org.apache.commons.lang3.tuple.Pair
;
...
@@ -53,24 +50,24 @@ public class BehaviorServiceImpl implements BehaviorService {
...
@@ -53,24 +50,24 @@ public class BehaviorServiceImpl implements BehaviorService {
@Override
@Override
public
void
pushBehaviorOld
(
Behavior
.
Operation
operation
,
String
module
,
HttpServletRequest
request
)
{
public
void
pushBehaviorOld
(
Behavior
.
Operation
operation
,
String
module
,
HttpServletRequest
request
)
{
try
{
//
try {
String
userId
=
UserThreadLocal
.
getUserId
();
//
String userId = UserThreadLocal.getUserId();
String
projectId
=
UserThreadLocal
.
getProjectId
();
//
String projectId = UserThreadLocal.getProjectId();
String
collectionName
=
behaviorDao
.
generateCollectionName
();
//
String collectionName = behaviorDao.generateCollectionName();
ApplicationProjectListener
.
getThreadPool
().
execute
(()
->
{
//
ApplicationProjectListener.getThreadPool().execute(() -> {
Behavior
behavior
=
new
Behavior
();
//
Behavior behavior = new Behavior();
behavior
.
setUserId
(
userId
);
//
behavior.setUserId(userId);
behavior
.
setProjectId
(
projectId
);
//
behavior.setProjectId(projectId);
behavior
.
setIp
(
Tools
.
getIpAddress
(
request
));
//
behavior.setIp(Tools.getIpAddress(request));
behavior
.
setCTime
(
new
Date
().
getTime
());
//
behavior.setCTime(new Date().getTime());
behavior
.
setPage
(
operation
.
getPage
());
//
behavior.setPage(operation.getPage());
behavior
.
setModule
(
module
);
//
behavior.setModule(module);
behavior
.
setBackstage
(
operation
.
isBackstage
());
//
behavior.setBackstage(operation.isBackstage());
behaviorDao
.
insertOne
(
behavior
,
collectionName
);
//
behaviorDao.insertOne(behavior, collectionName);
});
//
});
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
log
.
error
(
"用户行为保存失败,失败原因:"
,
e
);
//
log.error("用户行为保存失败,失败原因:", e);
}
//
}
}
}
@Override
@Override
...
...
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