Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-auth
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
王建峰
ydl-auth
Commits
d5a496f1
Commit
d5a496f1
authored
Dec 12, 2019
by
wangdayewjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed 修改post请求
parent
13e1bff4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
SignController.java
ydl-auth/ydl-auth-api/src/main/java/com/ydl/auth/apis/SignController.java
+7
-12
AccessRequestDto.java
ydl-auth/ydl-auth-api/src/main/java/com/ydl/auth/dto/AccessRequestDto.java
+15
-0
No files found.
ydl-auth/ydl-auth-api/src/main/java/com/ydl/auth/apis/SignController.java
View file @
d5a496f1
...
@@ -3,6 +3,7 @@ package com.ydl.auth.apis;
...
@@ -3,6 +3,7 @@ package com.ydl.auth.apis;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.ydl.auth.dto.AccessRequestDto
;
import
com.ydl.auth.dto.RequestDTO
;
import
com.ydl.auth.dto.RequestDTO
;
import
com.ydl.auth.inf.AppAuthFacade
;
import
com.ydl.auth.inf.AppAuthFacade
;
import
com.ydl.common.dto.BaseDtoResponse
;
import
com.ydl.common.dto.BaseDtoResponse
;
...
@@ -10,10 +11,7 @@ import com.ydl.common.helper.ResponseFormatterHelper;
...
@@ -10,10 +11,7 @@ import com.ydl.common.helper.ResponseFormatterHelper;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -26,20 +24,17 @@ public class SignController {
...
@@ -26,20 +24,17 @@ public class SignController {
@Reference
(
version
=
"1.0.0"
)
@Reference
(
version
=
"1.0.0"
)
private
AppAuthFacade
appAuthFacade
;
private
AppAuthFacade
appAuthFacade
;
@RequestMapping
(
value
=
"/getAccessKey"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"消息频道页消息列表"
)
public
BaseDtoResponse
<
String
>
getAccessKey
(
@RequestParam
(
value
=
"appKey"
)
String
appKey
,
@RequestParam
(
value
=
"path"
)
String
path
)
throws
Exception
{
@RequestMapping
(
value
=
"/getAccessKey"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
value
=
"消息频道页消息列表"
)
public
BaseDtoResponse
<
String
>
getAccessKey
(
@RequestBody
AccessRequestDto
requestDto
)
throws
Exception
{
String
appSecret
=
appAuthFacade
.
getSecretByAppKey
(
appKey
);
String
appSecret
=
appAuthFacade
.
getSecretByAppKey
(
requestDto
.
getAppKey
()
);
Long
timeStamp
=
System
.
currentTimeMillis
();
Long
timeStamp
=
System
.
currentTimeMillis
();
String
version
=
"1.0.0"
;
String
version
=
"1.0.0"
;
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"timestamp"
,
timeStamp
+
""
);
paramMap
.
put
(
"timestamp"
,
timeStamp
+
""
);
paramMap
.
put
(
"path"
,
path
);
paramMap
.
put
(
"path"
,
requestDto
.
getPath
()
);
paramMap
.
put
(
"version"
,
version
);
paramMap
.
put
(
"version"
,
version
);
String
sign
=
generateSign
(
appSecret
,
paramMap
);
String
sign
=
generateSign
(
appSecret
,
paramMap
);
return
ResponseFormatterHelper
.
success
(
sign
);
return
ResponseFormatterHelper
.
success
(
sign
);
...
...
ydl-auth/ydl-auth-api/src/main/java/com/ydl/auth/dto/AccessRequestDto.java
0 → 100644
View file @
d5a496f1
package
com
.
ydl
.
auth
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.io.Serializable
;
@Data
public
class
AccessRequestDto
implements
Serializable
{
@ApiModelProperty
(
value
=
"appKey"
,
required
=
true
)
private
String
appKey
;
@ApiModelProperty
(
value
=
"path"
,
required
=
true
)
private
String
path
;
}
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