记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
341cdb7e
Commit
341cdb7e
authored
Apr 15, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-goblin调用adam同步数字账号逻辑;
parent
9a109820
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
75 deletions
+0
-75
GoblinRscController.java
.../service/goblin/controller/Inner/GoblinRscController.java
+0
-29
GoblinNftNumAccountServiceImpl.java
...e/goblin/service/impl/GoblinNftNumAccountServiceImpl.java
+0
-46
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinRscController.java
View file @
341cdb7e
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.service.impl.GoblinNftNumAccountServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.constraints.NotBlank
;
@Slf4j
@Api
(
tags
=
"@API:RSC"
)
@RestController
...
...
@@ -23,23 +13,4 @@ import javax.validation.constraints.NotBlank;
@RequestMapping
(
"/rsc"
)
public
class
GoblinRscController
{
@Autowired
GoblinNftNumAccountServiceImpl
accountService
;
@PostMapping
(
"nft/sync/acc"
)
@ApiOperation
(
"数字账户开通同步通知"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"userId"
,
value
=
"用户ID"
,
example
=
"1"
,
required
=
true
),
})
public
ResponseDto
syncNotice
(
@RequestParam
(
"userId"
)
@NotBlank
(
message
=
"用户ID不能为空"
)
String
userId
)
{
Boolean
notice
=
accountService
.
syncNotice
(
userId
);
if
(
notice
)
{
return
ResponseDto
.
success
(
"同步成功"
);
}
else
{
return
ResponseDto
.
failure
(
"未获取到数据"
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftNumAccountServiceImpl.java
deleted
100644 → 0
View file @
9a109820
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.adam.dto.vo.AdamUserBizAcctVo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.MultiValueMap
;
@Service
@Slf4j
public
class
GoblinNftNumAccountServiceImpl
{
@Autowired
private
GoblinRedisUtils
goblinRedisUtils
;
@Value
(
"${liquidnet.service.adam.url}"
)
private
String
adamUrl
;
public
Boolean
syncNotice
(
String
userId
)
{
// 请求adam
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON_UTF8_VALUE
);
headers
.
set
(
"Content-Type"
,
MediaType
.
APPLICATION_FORM_URLENCODED_VALUE
);
String
returnData
=
HttpUtil
.
getByUri
(
adamUrl
.
concat
(
"/adam/rsc/inquire/bizacc?bizCode=NFT_ZX&uid="
.
concat
(
userId
)),
headers
);
ResponseDto
<
AdamUserBizAcctVo
>
rsp
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
AdamUserBizAcctVo
>>()
{
});
AdamUserBizAcctVo
rspData
=
rsp
.
getData
();
if
(
null
!=
rspData
)
{
// 写入redis
goblinRedisUtils
.
setNftNumAccount
(
userId
);
return
true
;
}
else
{
log
.
info
(
"同步数字账号失败,信息不存在 [userId:{}]"
,
userId
);
return
false
;
}
}
}
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