Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
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
曲欣亮
sentinel
Commits
ee37a593
Commit
ee37a593
authored
Apr 26, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
34499791
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
CinemaController.java
...n/java/com/egolm/film/api/web/admin/CinemaController.java
+1
-1
WebApiInterceptor.java
.../com/egolm/film/config/interceptor/WebApiInterceptor.java
+8
-5
No files found.
src/main/java/com/egolm/film/api/web/admin/CinemaController.java
View file @
ee37a593
...
...
@@ -152,7 +152,7 @@ public class CinemaController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"start_date"
,
value
=
"开始日期"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"end_date"
,
value
=
"结束日期"
),
})
public
Object
getShowtimeList
(
Integer
cinema_id
,
Date
start_date
,
Date
end_date
)
{
public
Object
getShowtimeList
(
Integer
cinema_id
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
start_date
,
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
Date
end_date
)
{
if
(
start_date
==
null
)
{
start_date
=
DateUtil
.
start
(
new
Date
());
}
else
{
...
...
src/main/java/com/egolm/film/config/interceptor/WebApiInterceptor.java
View file @
ee37a593
package
com
.
egolm
.
film
.
config
.
interceptor
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.TreeMap
;
...
...
@@ -34,7 +35,7 @@ public class WebApiInterceptor extends HandlerInterceptorAdapter {
parameterMap
.
remove
(
"sign"
);
StringBuffer
string
=
this
.
toString
(
parameterMap
);
String
sign_tmp
=
StringUtil
.
toMD5HexString
(
string
+
md5key
);
if
(
sign_tmp
.
equals
(
sign_string
))
{
if
(
sign_tmp
.
toLowerCase
().
equals
(
sign_string
.
toLowerCase
()
))
{
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
else
{
throw
new
XRException
(
"数据签名错误"
);
...
...
@@ -64,13 +65,15 @@ public class WebApiInterceptor extends HandlerInterceptorAdapter {
}
public
static
void
main
(
String
[]
args
)
{
String
md5key
=
"564cc4130ee949d4ae25b5681e784583"
;
String
timestamp
=
String
.
valueOf
(
System
.
currentTimeMillis
());
String
sign
=
StringUtil
.
toMD5HexString
(
timestamp
+
md5key
);
System
.
out
.
println
(
"10.10.0.111:20002/film/webapi/getFilmList?timestamp="
+
timestamp
+
"&sign="
+
sign
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"timestamp"
,
timestamp
);
String
sign
=
sign
(
params
);
System
.
out
.
println
(
"http://10.10.0.111:20002/film/webapi/getFilmList?timestamp="
+
timestamp
+
"&sign="
+
sign
);
}
public
String
sign
(
Map
<
String
,
String
>
params
)
{
public
static
String
sign
(
Map
<
String
,
String
>
params
)
{
String
md5key
=
"564cc4130ee949d4ae25b5681e784583"
;
StringBuffer
sb
=
new
StringBuffer
();
Map
<
String
,
String
>
sortMap
=
new
TreeMap
<
String
,
String
>(
params
);
...
...
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