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
ddff175d
Commit
ddff175d
authored
Mar 06, 2024
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!468
parents
e96e1fb9
238deeee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
+8
-5
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
+17
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
View file @
ddff175d
...
...
@@ -61,8 +61,7 @@ public class AopLogRecord {
private
static
final
List
<
String
>
URL_PATTERNS
=
Arrays
.
asList
(
"/getNewAll"
,
"/getNew"
,
"/schedule"
);
@AfterReturning
(
value
=
"execution(public * com..controller..admin..*Controller.*(..)) || execution(* com..controller..app..*Controller.*(..)) || execution(* com..controller..LoginController.checkBind())"
,
returning
=
"ResponseResult"
)
private
void
beforeLog
(
JoinPoint
joinPoint
,
ResponseResult
ResponseResult
){
String
pid
=
null
;
private
void
beforeLog
(
JoinPoint
joinPoint
,
ResponseResult
ResponseResult
)
{
try
{
long
now
=
System
.
currentTimeMillis
();
// RequestContextHolder 顾名思义 持有 request 上下文的容器
...
...
@@ -87,7 +86,7 @@ public class AopLogRecord {
// 前后台,false:前台,true:后台
boolean
backstage
=
uri
.
contains
(
"admin"
);
String
token
=
request
.
getHeader
(
jwtKey
);
pid
=
request
.
getHeader
(
"pid"
);
String
pid
=
request
.
getHeader
(
"pid"
);
// 任意有一个不为空
if
(!(
Tools
.
isNullOrUndefined
(
token
)
||
Tools
.
isNullOrUndefined
(
pid
)))
{
Map
<
String
,
Object
>
map
=
JwtUtil
.
unsign
(
request
.
getHeader
(
jwtKey
),
Map
.
class
);
...
...
@@ -102,7 +101,11 @@ public class AopLogRecord {
}
String
userId
=
userIdObj
.
toString
();
String
projectId
=
request
.
getHeader
(
"pid"
);
UserInfo
userInfo
=
userService
.
queryUserInfo
(
userId
,
projectId
);
UserInfo
userInfo
;
if
(
null
==
(
userInfo
=
userService
.
queryUserInfo
(
userId
,
projectId
)))
{
log
.
error
(
"用户信息解析异常,pid:{},userId:{}"
,
pid
,
userId
);
return
;
}
String
nickName
=
userInfo
.
getNickname
();
// 请求地址和服务器地址
String
severAddress
=
InetAddress
.
getLocalHost
().
getHostAddress
();
...
...
@@ -121,7 +124,7 @@ public class AopLogRecord {
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"beforeLog
,pid:{}"
,
pid
,
e
);
log
.
error
(
"beforeLog
-"
,
e
);
}
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Project.java
View file @
ddff175d
...
...
@@ -36,6 +36,7 @@ public class Project extends AbstractProject {
/**
* 模块展示列表(1:标注库 2:大库)
*/
@Deprecated
private
List
<
Integer
>
moduleShowList
;
/**
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/vo/ProjectVO.java
View file @
ddff175d
...
...
@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.bson.types.ObjectId
;
import
java.util.*
;
...
...
@@ -159,6 +158,23 @@ public class ProjectVO {
project
.
setModuleShowList
(
this
.
getModuleShowList
());
project
.
setToolsetShowList
(
this
.
getToolsetShowList
());
project
.
setChannelFileUrl
(
this
.
getChannelFileUrl
());
// 负面渠道判断默认值
if
(
null
==
negativeChannelParams
)
{
this
.
negativeChannelParams
=
new
HashMap
<>();
negativeChannelParams
.
put
(
"negativeArticles"
,
0.6
);
negativeChannelParams
.
put
(
"negativeEvent"
,
0.3
);
negativeChannelParams
.
put
(
"specialArticles"
,
0.1
);
negativeChannelParams
.
put
(
"experience"
,
0.0
);
}
// 友好渠道判断默认值
if
(
null
==
positiveChannelParams
)
{
this
.
positiveChannelParams
=
new
HashMap
<>();
positiveChannelParams
.
put
(
"specialArticles"
,
0.1
);
positiveChannelParams
.
put
(
"positiveEvent"
,
0.3
);
positiveChannelParams
.
put
(
"negative"
,
0.25
);
positiveChannelParams
.
put
(
"neutral"
,
0.35
);
positiveChannelParams
.
put
(
"experience"
,
0.0
);
}
project
.
setNegativeChannelParams
((
this
.
getNegativeChannelParams
()));
project
.
setPositiveChannelParams
((
this
.
getPositiveChannelParams
()));
project
.
setBlackChannelGroup
(
this
.
getBlackChannelGroup
());
...
...
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