Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-push
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
qg-push
Commits
491b056e
Commit
491b056e
authored
Oct 19, 2022
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取商户ID
parent
6b1d5403
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Result.java
src/main/java/cn/quantgroup/response/Result.java
+1
-1
StmsRemoteService.java
src/main/java/cn/quantgroup/server/StmsRemoteService.java
+1
-1
StmsServerImpl.java
src/main/java/cn/quantgroup/server/impl/StmsServerImpl.java
+4
-4
No files found.
src/main/java/cn/quantgroup/response/Result.java
View file @
491b056e
...
...
@@ -119,7 +119,7 @@ public class Result<T> implements java.io.Serializable {
}
public
boolean
isSuccess
()
{
return
(
"
0
000"
.
equals
(
code
)
||
"0"
.
equals
(
code
));
return
(
"
2
000"
.
equals
(
code
)
||
"0"
.
equals
(
code
));
}
public
static
String
getTraceId
(){
...
...
src/main/java/cn/quantgroup/server/StmsRemoteService.java
View file @
491b056e
...
...
@@ -10,5 +10,5 @@ import org.springframework.web.bind.annotation.RequestHeader;
public
interface
StmsRemoteService
{
@Headers
(
"Content-Type:application/json"
)
@PostMapping
(
value
=
"/v2/oauth/currentuserinfo"
)
Result
<
String
>
getCurrentuserinfo
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
);
Result
<
Object
>
getCurrentuserinfo
(
@RequestHeader
(
"Access-Token"
)
String
accessToken
);
}
src/main/java/cn/quantgroup/server/impl/StmsServerImpl.java
View file @
491b056e
package
cn
.
quantgroup
.
server
.
impl
;
import
cn.quantgroup.response.Result
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.quantgroup.server.IStmsServer
;
import
cn.quantgroup.server.StmsRemoteService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -10,6 +9,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.LinkedHashMap
;
@Slf4j
...
...
@@ -29,10 +29,10 @@ public class StmsServerImpl implements IStmsServer {
@Override
public
String
getStmsTokenInfo
(
String
token
)
{
try
{
Result
<
String
>
result
=
stmsRemoteService
.
getCurrentuserinfo
(
token
);
Result
<
Object
>
result
=
stmsRemoteService
.
getCurrentuserinfo
(
token
);
if
(
result
.
isSuccess
())
{
JSONObject
jsonData
=
JSONObject
.
parseObject
(
result
.
getData
().
toString
()
);
return
jsonData
.
get
String
(
"supplierCode"
);
LinkedHashMap
jsonData
=
(
LinkedHashMap
)
result
.
getData
(
);
return
jsonData
.
get
(
"supplierCode"
).
toString
(
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"Exception--{}"
,
e
.
getMessage
());
...
...
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