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
61c259df
Commit
61c259df
authored
Apr 22, 2024
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载报错修复
parent
65dc384b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
+5
-4
src/main/java/com/zhiwei/brandkbs2/controller/app/AppUserCenterController.java
+1
-2
No files found.
src/main/java/com/zhiwei/brandkbs2/aop/AopLogRecord.java
View file @
61c259df
...
@@ -61,7 +61,7 @@ public class AopLogRecord {
...
@@ -61,7 +61,7 @@ public class AopLogRecord {
private
static
final
List
<
String
>
URL_PATTERNS
=
Arrays
.
asList
(
"/getNewAll"
,
"/getNew"
,
"/schedule"
);
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"
)
@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
,
ResponseResul
t
ResponseResult
)
{
private
void
beforeLog
(
JoinPoint
joinPoint
,
Objec
t
ResponseResult
)
{
try
{
try
{
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
// RequestContextHolder 顾名思义 持有 request 上下文的容器
// RequestContextHolder 顾名思义 持有 request 上下文的容器
...
@@ -128,7 +128,7 @@ public class AopLogRecord {
...
@@ -128,7 +128,7 @@ public class AopLogRecord {
}
}
}
}
private
UserLogRecord
userLogRecord
(
String
projectId
,
UserInfo
userInfo
,
JoinPoint
joinPoint
,
MethodSignature
methodSignature
,
ResponseResul
t
responseResult
)
{
private
UserLogRecord
userLogRecord
(
String
projectId
,
UserInfo
userInfo
,
JoinPoint
joinPoint
,
MethodSignature
methodSignature
,
Objec
t
responseResult
)
{
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
Object
[]
args
=
joinPoint
.
getArgs
();
Object
[]
args
=
joinPoint
.
getArgs
();
Method
method
=
methodSignature
.
getMethod
();
Method
method
=
methodSignature
.
getMethod
();
...
@@ -193,10 +193,11 @@ public class AopLogRecord {
...
@@ -193,10 +193,11 @@ public class AopLogRecord {
return
new
UserLogRecord
(
projectId
,
userInfo
.
getUserId
(),
userInfo
.
getNickname
(),
prefix
+
suffix
,
userInfo
.
getRoleId
(),
now
,
now
);
return
new
UserLogRecord
(
projectId
,
userInfo
.
getUserId
(),
userInfo
.
getNickname
(),
prefix
+
suffix
,
userInfo
.
getRoleId
(),
now
,
now
);
}
}
// 获取接口返回值(value为获取返回值的具体字段)并与操作描述description拼接返回,返回值为实体
// 获取接口返回值(value为获取返回值的具体字段)并与操作描述description拼接返回,返回值为实体
if
(!
method
.
getAnnotation
(
LogRecord
.
class
).
arguments
()
&&
method
.
getAnnotation
(
LogRecord
.
class
).
entity
())
{
if
(!
method
.
getAnnotation
(
LogRecord
.
class
).
arguments
()
&&
method
.
getAnnotation
(
LogRecord
.
class
).
entity
()
&&
Objects
.
nonNull
(
responseResult
)
)
{
List
<
Object
>
res
=
new
ArrayList
<>(
value
.
length
);
List
<
Object
>
res
=
new
ArrayList
<>(
value
.
length
);
for
(
String
v
:
value
)
{
for
(
String
v
:
value
)
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
responseResult
.
getData
());
ResponseResult
result
=
(
ResponseResult
)
responseResult
;
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
result
.
getData
());
String
s
=
String
.
valueOf
(
jsonObject
.
get
(
v
));
String
s
=
String
.
valueOf
(
jsonObject
.
get
(
v
));
if
(
Objects
.
nonNull
(
s
))
{
if
(
Objects
.
nonNull
(
s
))
{
res
.
add
(
s
);
res
.
add
(
s
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/app/AppUserCenterController.java
View file @
61c259df
...
@@ -77,9 +77,8 @@ public class AppUserCenterController extends BaseController {
...
@@ -77,9 +77,8 @@ public class AppUserCenterController extends BaseController {
@ApiOperation
(
"任务中心-下载"
)
@ApiOperation
(
"任务中心-下载"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"任务id"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"任务id"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/download-task/download/{id}"
)
@GetMapping
(
"/download-task/download/{id}"
)
public
ResponseResult
download
(
@PathVariable
String
id
)
{
public
void
download
(
@PathVariable
String
id
)
{
DownloadTask
task
=
downloadTaskService
.
findTask
(
id
);
DownloadTask
task
=
downloadTaskService
.
findTask
(
id
);
Tools
.
downloadFile
(
task
.
getFileAddress
(),
response
);
Tools
.
downloadFile
(
task
.
getFileAddress
(),
response
);
return
ResponseResult
.
success
();
}
}
}
}
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