记得上下班打卡 | 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
5fbb81d8
Commit
5fbb81d8
authored
Apr 06, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_nft_411' into dev_nft_411
parents
fb5a9911
c6129d33
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
266 additions
and
220 deletions
+266
-220
RedisStreamConfig.java
...iquidnet.common.cache/redis/config/RedisStreamConfig.java
+2
-1
AdamUserBusiAcctServiceImpl.java
...ervice/adam/service/impl/AdamUserBusiAcctServiceImpl.java
+6
-13
ConsumerCommonSqlRedisStreamConfig.java
...umer/kylin/config/ConsumerCommonSqlRedisStreamConfig.java
+56
-3
ConsumerGoblinSqlUstoreRedisStreamConfig.java
...ylin/config/ConsumerGoblinSqlUstoreRedisStreamConfig.java
+194
-194
GoblinGalaxyService.java
...ervice/goblin/service/impl/inner/GoblinGalaxyService.java
+8
-9
No files found.
liquidnet-bus-common/liquidnet-common-cache/liquidnet-common-cache-redis/src/main/java/com.liquidnet.common.cache/redis/config/RedisStreamConfig.java
View file @
5fbb81d8
...
@@ -33,6 +33,7 @@ public class RedisStreamConfig {
...
@@ -33,6 +33,7 @@ public class RedisStreamConfig {
try
{
try
{
if
(
stringRedisTemplate
.
hasKey
(
key
))
{
if
(
stringRedisTemplate
.
hasKey
(
key
))
{
log
.
info
(
"redis stream exist[{},{}]"
,
key
,
group
);
log
.
info
(
"redis stream exist[{},{}]"
,
key
,
group
);
stringRedisTemplate
.
opsForStream
().
createGroup
(
key
,
group
);
}
else
{
}
else
{
log
.
info
(
"redis stream init[{},{}]"
,
key
,
group
);
log
.
info
(
"redis stream init[{},{}]"
,
key
,
group
);
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -43,7 +44,7 @@ public class RedisStreamConfig {
...
@@ -43,7 +44,7 @@ public class RedisStreamConfig {
stringObjectObjectStreamOperations
.
delete
(
key
,
recordId
.
getValue
());
stringObjectObjectStreamOperations
.
delete
(
key
,
recordId
.
getValue
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Ex:redis stream init [{},{}]
"
,
key
,
group
,
e
);
log
.
error
(
"Ex:redis stream init [{},{}]
,ex:{}"
,
key
,
group
,
e
.
getMessage
()
);
}
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamUserBusiAcctServiceImpl.java
View file @
5fbb81d8
...
@@ -45,6 +45,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
...
@@ -45,6 +45,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
// @Value("${liquidnet.service.galaxy.url}")// TODO: 2022/3/29 ==zhanggb
// @Value("${liquidnet.service.galaxy.url}")// TODO: 2022/3/29 ==zhanggb
// private String sevGalaxyUrl;
// private String sevGalaxyUrl;
private
static
final
String
BIZ_ACC_OPEN_NFT_ZXIN_BODY
=
"{\"routerType\":\"zxinchain\",\"idCardType\":\"1\",\"idCard\":\"P3\",\"userName\":\"P4\",\"mobile\":\"P5\",\"userId\":\"P6\"}"
;
@Override
@Override
public
ResponseDto
<
AdamUserBizAcctVo
>
openAccount
(
String
uid
,
String
bizCode
,
String
name
,
String
idCard
,
String
mobile
)
{
public
ResponseDto
<
AdamUserBizAcctVo
>
openAccount
(
String
uid
,
String
bizCode
,
String
name
,
String
idCard
,
String
mobile
)
{
List
<
AdamUserBizAcctVo
>
userBizAcctVoList
=
adamRdmService
.
getBizAcctVosByUid
(
uid
);
List
<
AdamUserBizAcctVo
>
userBizAcctVoList
=
adamRdmService
.
getBizAcctVosByUid
(
uid
);
...
@@ -101,29 +103,20 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
...
@@ -101,29 +103,20 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
}
}
}
}
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
String
postBody
=
BIZ_ACC_OPEN_NFT_ZXIN_BODY
.
replace
(
"P3"
,
idCard
).
replace
(
"P4"
,
name
).
replace
(
"P5"
,
mobile
).
replace
(
"P6"
,
uid
);
paramsMap
.
add
(
"routerType"
,
"zxinchain"
);
// TODO: 2022/3/29 ==zhanggb
paramsMap
.
add
(
"userId"
,
uid
);
paramsMap
.
add
(
"idCardType"
,
"1"
);
paramsMap
.
add
(
"idCard"
,
idCard
);
paramsMap
.
add
(
"userName"
,
name
);
paramsMap
.
add
(
"mobile"
,
mobile
);
// String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/29 ==zhanggb
// String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/29 ==zhanggb
String
postUrl
=
"https://ENVgalaxy.zhengzai.tv/galaxy/user/register"
.
replace
(
"ENV"
,
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)),
blockChainAddress
;
String
postUrl
=
"https://ENVgalaxy.zhengzai.tv/galaxy/user/register"
.
replace
(
"ENV"
,
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)),
blockChainAddress
;
try
{
try
{
LinkedMultiValueMap
<
String
,
String
>
headerMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
String
postRespStr
=
HttpUtil
.
postRaw
(
postUrl
,
postBody
,
null
);
headerMap
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON_VALUE
);
String
postRespStr
=
HttpUtil
.
post
(
postUrl
,
paramsMap
,
headerMap
);
JsonNode
postRespJNode
=
JsonUtils
.
fromJson
(
postRespStr
,
JsonNode
.
class
),
postRespCode
;
JsonNode
postRespJNode
=
JsonUtils
.
fromJson
(
postRespStr
,
JsonNode
.
class
),
postRespCode
;
if
(
null
==
postRespJNode
||
null
==
(
postRespCode
=
postRespJNode
.
get
(
"code"
))
||
!
postRespCode
.
asText
().
equals
(
"0"
))
{
if
(
null
==
postRespJNode
||
null
==
(
postRespCode
=
postRespJNode
.
get
(
"code"
))
||
!
postRespCode
.
asText
().
equals
(
"0"
))
{
log
.
warn
(
"#开通业务账号:至信数字藏品账号开通失败[p
aramsMap={},postRespStr={}]"
,
paramsMap
,
postRespStr
);
log
.
warn
(
"#开通业务账号:至信数字藏品账号开通失败[p
ostBody={},postRespStr={}]"
,
postBody
,
postRespStr
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10113"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10113"
));
}
}
JsonNode
postRespDataJNode
=
postRespJNode
.
get
(
"data"
);
JsonNode
postRespDataJNode
=
postRespJNode
.
get
(
"data"
);
blockChainAddress
=
postRespDataJNode
.
get
(
"blockChainAddress"
).
asText
();
blockChainAddress
=
postRespDataJNode
.
get
(
"blockChainAddress"
).
asText
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Ex.开通业务账号:至信数字藏品账号开通请求异常[
UID={},url={},paramsMap={}],ex:{}"
,
uid
,
postUrl
,
paramsMap
,
e
.
getMessage
());
log
.
error
(
"Ex.开通业务账号:至信数字藏品账号开通请求异常[
url={},postBody={}],ex:{}"
,
postUrl
,
postBody
,
e
.
getMessage
());
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10113"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10113"
));
}
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/config/ConsumerCommonSqlRedisStreamConfig.java
View file @
5fbb81d8
...
@@ -2,8 +2,7 @@ package com.liquidnet.service.consumer.kylin.config;
...
@@ -2,8 +2,7 @@ package com.liquidnet.service.consumer.kylin.config;
import
com.liquidnet.common.cache.redis.config.RedisStreamConfig
;
import
com.liquidnet.common.cache.redis.config.RedisStreamConfig
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinNftOrderRdsReceiver
;
import
com.liquidnet.service.consumer.kylin.receiver.*
;
import
com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinSqlArtworkGenRdsReceiver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -24,10 +23,64 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
...
@@ -24,10 +23,64 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
@Autowired
@Autowired
StringRedisTemplate
stringRedisTemplate
;
StringRedisTemplate
stringRedisTemplate
;
@Autowired
@Autowired
ConsumerGoblinSqlStoreRdsReceiver
consumerGoblinSqlStoreRdsReceiver
;
@Autowired
ConsumerGoblinSqlGoodsRdsReceiver
consumerGoblinSqlGoodsRdsReceiver
;
@Autowired
ConsumerGoblinSqlCouponRdsReceiver
consumerGoblinSqlCouponRdsReceiver
;
@Autowired
ConsumerGoblinSqlArtworkGenRdsReceiver
consumerGoblinSqlArtworkGenRdsReceiver
;
ConsumerGoblinSqlArtworkGenRdsReceiver
consumerGoblinSqlArtworkGenRdsReceiver
;
@Autowired
@Autowired
ConsumerGoblinNftOrderRdsReceiver
consumerGoblinNftOrderRdsReceiver
;
ConsumerGoblinNftOrderRdsReceiver
consumerGoblinNftOrderRdsReceiver
;
@Bean
// 店铺相关
public
List
<
Subscription
>
subscriptionSqlStore
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_STORE
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
subscriptionList
.
add
(
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
stream
.
getGroup
(),
getConsumerName
(
stream
.
name
()
+
i
)),
StreamOffset
.
create
(
stream
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlStoreRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 商品相关
public
List
<
Subscription
>
subscriptionSqlGoods
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_GOODS
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
subscriptionList
.
add
(
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
stream
.
getGroup
(),
getConsumerName
(
stream
.
name
()
+
i
)),
StreamOffset
.
create
(
stream
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlGoodsRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 店铺优惠券相关
public
List
<
Subscription
>
subscriptionSqlStoreCoupon
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
SQL_COUPON
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
subscriptionList
.
add
(
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
stream
.
getGroup
(),
getConsumerName
(
stream
.
name
()
+
i
)),
StreamOffset
.
create
(
stream
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlCouponRdsReceiver
));
listenerContainer
.
start
();
}
return
subscriptionList
;
}
@Bean
// 藏品生成
@Bean
// 藏品生成
public
List
<
Subscription
>
subscriptionSqlArtworkGen
(
RedisConnectionFactory
factory
)
{
public
List
<
Subscription
>
subscriptionSqlArtworkGen
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
...
@@ -45,7 +98,7 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
...
@@ -45,7 +98,7 @@ public class ConsumerCommonSqlRedisStreamConfig extends RedisStreamConfig {
}
}
@Bean
// NFT订单
@Bean
// NFT订单
public
List
<
Subscription
>
subscription
Biz
NftOrder
(
RedisConnectionFactory
factory
)
{
public
List
<
Subscription
>
subscription
Sql
NftOrder
(
RedisConnectionFactory
factory
)
{
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
List
<
Subscription
>
subscriptionList
=
new
ArrayList
<>();
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
;
MQConst
.
GoblinQueue
stream
=
MQConst
.
GoblinQueue
.
GOBLIN_NFT_ORDER
;
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
this
.
initStream
(
stringRedisTemplate
,
stream
.
getKey
(),
stream
.
getGroup
());
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/config/ConsumerGoblinSqlUstoreRedisStreamConfig.java
View file @
5fbb81d8
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinGalaxyService.java
View file @
5fbb81d8
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
inner
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
inner
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
...
@@ -89,20 +90,18 @@ public class GoblinGalaxyService {
...
@@ -89,20 +90,18 @@ public class GoblinGalaxyService {
* @return
* @return
*/
*/
public
List
<
String
>
checkNftTradeResult
(
String
uid
,
String
orderId
,
String
routerType
)
{
public
List
<
String
>
checkNftTradeResult
(
String
uid
,
String
orderId
,
String
routerType
)
{
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
ObjectNode
postBodyNode
=
JsonUtils
.
OM
().
createObjectNode
();
p
aramsMap
.
add
(
"userId"
,
uid
);
p
ostBodyNode
.
put
(
"userId"
,
uid
);
p
aramsMap
.
add
(
"nftOrderPayId"
,
orderId
);
// TODO: 2022/3/31 ==zhanggb
p
ostBodyNode
.
put
(
"nftOrderPayId"
,
orderId
);
p
aramsMap
.
add
(
"routerType"
,
routerType
);
p
ostBodyNode
.
put
(
"routerType"
,
routerType
);
// String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/31 ==zhanggb
// String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/31 ==zhanggb
String
postUrl
=
"https://ENVgalaxy.zhengzai.tv/galaxy/nftTrade/nftPublishAndBuyResultQuery"
.
replace
(
"ENV"
,
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)),
blockChainAddress
;
String
postUrl
=
"https://ENVgalaxy.zhengzai.tv/galaxy/nftTrade/nftPublishAndBuyResultQuery"
.
replace
(
"ENV"
,
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
)),
blockChainAddress
;
try
{
try
{
LinkedMultiValueMap
<
String
,
String
>
headerMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
String
postRespStr
=
HttpUtil
.
postRaw
(
postUrl
,
postBodyNode
.
toString
(),
null
);
headerMap
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON_VALUE
);
String
postRespStr
=
HttpUtil
.
post
(
postUrl
,
paramsMap
,
headerMap
);
JsonNode
postRespJNode
=
JsonUtils
.
fromJson
(
postRespStr
,
JsonNode
.
class
),
postRespCode
;
JsonNode
postRespJNode
=
JsonUtils
.
fromJson
(
postRespStr
,
JsonNode
.
class
),
postRespCode
;
if
(
null
==
postRespJNode
||
null
==
(
postRespCode
=
postRespJNode
.
get
(
"code"
))
||
!
postRespCode
.
asText
().
equals
(
"0"
))
{
if
(
null
==
postRespJNode
||
null
==
(
postRespCode
=
postRespJNode
.
get
(
"code"
))
||
!
postRespCode
.
asText
().
equals
(
"0"
))
{
log
.
warn
(
"#NFT发行购买结果查询:查询失败[p
aramsMap={},postRespStr={}]"
,
paramsMap
,
postRespStr
);
log
.
warn
(
"#NFT发行购买结果查询:查询失败[p
ostBody={},postRespStr={}]"
,
postBodyNode
,
postRespStr
);
return
null
;
return
null
;
}
}
JsonNode
postRespDataJNode
=
postRespJNode
.
get
(
"data"
);
JsonNode
postRespDataJNode
=
postRespJNode
.
get
(
"data"
);
...
@@ -115,7 +114,7 @@ public class GoblinGalaxyService {
...
@@ -115,7 +114,7 @@ public class GoblinGalaxyService {
respDataList
.
add
(
postRespDataJNode
.
get
(
"nftBuyTxHash"
).
asText
());
respDataList
.
add
(
postRespDataJNode
.
get
(
"nftBuyTxHash"
).
asText
());
return
respDataList
;
return
respDataList
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Ex.NFT发行购买结果查询:请求异常[
UID={},url={},paramsMap={}],ex:{}"
,
uid
,
postUrl
,
paramsMap
,
e
.
getMessage
());
log
.
error
(
"Ex.NFT发行购买结果查询:请求异常[
url={},postBody={}],ex:{}"
,
postUrl
,
postBodyNode
,
e
.
getMessage
());
return
null
;
return
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