Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
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
xyqb-user2
Commits
d0954e9a
Commit
d0954e9a
authored
Dec 30, 2021
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改渠道地址获取方式,通过Apollo配置获取
parent
074fe1a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
PlatformApiController.java
...b/controller/external/platform/PlatformApiController.java
+20
-7
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/platform/PlatformApiController.java
View file @
d0954e9a
...
...
@@ -13,6 +13,7 @@ import cn.quantgroup.xyqb.service.user.IUserDetailService;
import
com.google.common.collect.ImmutableMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -31,17 +32,24 @@ public class PlatformApiController implements IBaseController {
@Autowired
private
IUserDetailService
userDetailService
;
@Value
(
"${merchant.config.returnUrl}"
)
private
String
merchantConfigReturnUrl
;
@RequestMapping
(
"/page/return_url"
)
public
JsonResult
returnUrl
(
String
key
)
{
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
if
(
null
==
merchant
)
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
}
MerchantConfig
config
=
merchantService
.
findConfigByMerchantIdAndConfigName
(
merchant
.
getId
(),
"returnUrl"
);
if
(
null
==
config
)
{
// MerchantConfig config = merchantService.findConfigByMerchantIdAndConfigName(merchant.getId(), "returnUrl");
if
(
merchantConfigReturnUrl
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
}
String
configValue
=
merchantConfigReturnUrl
.
split
(
","
)[
4
];
if
(
null
==
configValue
)
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
""
,
config
.
getConfigValue
()
);
return
JsonResult
.
buildSuccessResult
(
""
,
config
Value
);
}
@RequestMapping
(
"/page/next"
)
...
...
@@ -54,8 +62,12 @@ public class PlatformApiController implements IBaseController {
Boolean
isFinal
=
nextPageTuple
.
getValue
();
String
nextPage
=
nextPageTuple
.
getKey
();
if
(
Constants
.
PAGE_NEXT_KEY_XYQB
.
equals
(
key
))
{
MerchantConfig
merchantConfig
=
merchantService
.
findConfigByMerchantIdAndConfigName
(
4L
,
"returnUrl"
);
return
JsonResult
.
buildSuccessResult
(
""
,
ImmutableMap
.
of
(
"type"
,
"external"
,
"transition"
,
merchantConfig
.
getConfigValue
()));
// MerchantConfig merchantConfig = merchantService.findConfigByMerchantIdAndConfigName(4L, "returnUrl");
if
(
merchantConfigReturnUrl
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
}
String
configValue
=
merchantConfigReturnUrl
.
split
(
","
)[
4
];
return
JsonResult
.
buildSuccessResult
(
""
,
ImmutableMap
.
of
(
"type"
,
"external"
,
"transition"
,
configValue
));
}
if
(
isFinal
)
{
Merchant
merchant
=
merchantService
.
findMerchantByName
(
key
);
...
...
@@ -63,10 +75,11 @@ public class PlatformApiController implements IBaseController {
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
}
MerchantConfig
merchantConfig
=
merchantService
.
findConfigByMerchantIdAndConfigName
(
merchant
.
getId
(),
"returnUrl"
);
if
(
merchantConfig
==
null
)
{
if
(
merchantConfig
ReturnUrl
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
""
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
""
,
ImmutableMap
.
of
(
"type"
,
"external"
,
"transition"
,
merchantConfig
.
getConfigValue
()));
String
configValue
=
merchantConfigReturnUrl
.
split
(
","
)[
merchant
.
getId
().
intValue
()];
return
JsonResult
.
buildSuccessResult
(
""
,
ImmutableMap
.
of
(
"type"
,
"external"
,
"transition"
,
configValue
));
}
if
(
StringUtils
.
isBlank
(
nextPage
))
{
return
JsonResult
.
buildErrorStateResult
(
""
,
null
);
...
...
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