记得上下班打卡 | 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
29b6b521
Commit
29b6b521
authored
Jun 09, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~queue:consumer-base.BIZ_ARTWORK:恢复;
parent
de77ac07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
GoblinQueBizArtworkClqService.java
...lin/service/impl/inner/GoblinQueBizArtworkClqService.java
+8
-7
GoblinQueBizArtworkUplService.java
...lin/service/impl/inner/GoblinQueBizArtworkUplService.java
+13
-13
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinQueBizArtworkClqService.java
View file @
29b6b521
...
...
@@ -12,7 +12,6 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -20,23 +19,26 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
@Slf4j
@Service
public
class
GoblinQueBizArtworkClqService
{
@Autowired
QueueUtils
queueUtils
;
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
GoblinMongoUtils
goblinMongoUtils
;
@Autowired
MongoTemplate
mongoTemplate
;
@Autowired
StringRedisTemplate
stringRedisTemplate
;
@Resource
(
name
=
"galaxyArtworkServiceImpl"
)
private
IGalaxyArtworkService
galaxyArtworkService
;
...
...
@@ -76,15 +78,14 @@ public class GoblinQueBizArtworkClqService {
goblinRedisUtils
.
del
(
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
));
// Mysql持久化
//
HashMap<String, String> sqlUpdateMap = CollectionUtil.mapStringString();
HashMap
<
String
,
String
>
sqlUpdateMap
=
CollectionUtil
.
mapStringString
();
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
toMqSqls
.
add
(
SQL_UPDATE_GOODS_SKU_NFT
);
LinkedList
<
Object
[]>
updateGoodsSkuNftObjs
=
CollectionUtil
.
linkedListObjectArr
();
updateGoodsSkuNftObjs
.
add
(
new
Object
[]{
1
,
seriesId
,
txHash
,
nftHash
,
chainTimestamp
,
now
,
skuId
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
(),
SqlMapping
.
gets
(
toMqSqls
,
updateGoodsSkuNftObjs
));
// sqlUpdateMap.put(MQConst.QUEUE_MESSAGE_KEY, SqlMapping.gets(toMqSqls, updateGoodsSkuNftObjs));
// stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(sqlUpdateMap).withStreamKey(MQConst.GoblinQueue.SQL_GOODS.getKey()));
sqlUpdateMap
.
put
(
MQConst
.
QUEUE_MESSAGE_KEY
,
SqlMapping
.
gets
(
toMqSqls
,
updateGoodsSkuNftObjs
));
stringRedisTemplate
.
opsForStream
().
add
(
StreamRecords
.
mapBacked
(
sqlUpdateMap
).
withStreamKey
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
()));
return
ResponseDto
.
success
();
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinQueBizArtworkUplService.java
View file @
29b6b521
...
...
@@ -15,7 +15,6 @@ import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -23,23 +22,27 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.data.redis.core.StreamOperations
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
@Slf4j
@Service
public
class
GoblinQueBizArtworkUplService
{
@Autowired
QueueUtils
queueUtils
;
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
GoblinMongoUtils
goblinMongoUtils
;
@Autowired
MongoTemplate
mongoTemplate
;
@Autowired
StringRedisTemplate
stringRedisTemplate
;
@Resource
(
name
=
"galaxyArtworkServiceImpl"
)
private
IGalaxyArtworkService
galaxyArtworkService
;
...
...
@@ -102,23 +105,20 @@ public class GoblinQueBizArtworkUplService {
goblinRedisUtils
.
del
(
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
));
// Mysql持久化
//
HashMap<String, String> sqlUpdateMap = CollectionUtil.mapStringString();
HashMap
<
String
,
String
>
sqlUpdateMap
=
CollectionUtil
.
mapStringString
();
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
toMqSqls
.
add
(
SQL_UPDATE_GOODS_SKU_NFT
);
LinkedList
<
Object
[]>
updateGoodsSkuNftObjs
=
CollectionUtil
.
linkedListObjectArr
();
updateGoodsSkuNftObjs
.
add
(
new
Object
[]{
upchain
,
displayUrl
,
nftUrl
,
skuId
});
//
sqlUpdateMap.put(MQConst.QUEUE_MESSAGE_KEY, SqlMapping.gets(toMqSqls, updateGoodsSkuNftObjs));
sqlUpdateMap
.
put
(
MQConst
.
QUEUE_MESSAGE_KEY
,
SqlMapping
.
gets
(
toMqSqls
,
updateGoodsSkuNftObjs
));
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
(),
SqlMapping
.
gets
(
toMqSqls
,
updateGoodsSkuNftObjs
));
// StreamOperations<String, Object, Object> streamOperations = stringRedisTemplate.opsForStream();
// streamOperations.add(StreamRecords.mapBacked(sqlUpdateMap).withStreamKey(MQConst.GoblinQueue.SQL_GOODS.getKey()));
StreamOperations
<
String
,
Object
,
Object
>
streamOperations
=
stringRedisTemplate
.
opsForStream
();
streamOperations
.
add
(
StreamRecords
.
mapBacked
(
sqlUpdateMap
).
withStreamKey
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
()));
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
BIZ_ARTWORK_CLQ
.
getKey
(),
skuId
.
concat
(
","
).
concat
(
String
.
valueOf
(
LocalDateTime
.
now
())));
// HashMap<String, String> toQueueBeClaimQueryMsg = CollectionUtil.mapStringString();
// toQueueBeClaimQueryMsg.put(MQConst.QUEUE_MESSAGE_KEY, skuId.concat(",").concat(String.valueOf(LocalDateTime.now())));
// streamOperations.add(StreamRecords.mapBacked(toQueueBeClaimQueryMsg).withStreamKey(MQConst.GoblinQueue.BIZ_ARTWORK_CLQ.getKey()));
// return true;
HashMap
<
String
,
String
>
toQueueBeClaimQueryMsg
=
CollectionUtil
.
mapStringString
();
toQueueBeClaimQueryMsg
.
put
(
MQConst
.
QUEUE_MESSAGE_KEY
,
skuId
.
concat
(
","
).
concat
(
String
.
valueOf
(
LocalDateTime
.
now
())));
streamOperations
.
add
(
StreamRecords
.
mapBacked
(
toQueueBeClaimQueryMsg
).
withStreamKey
(
MQConst
.
GoblinQueue
.
BIZ_ARTWORK_CLQ
.
getKey
()));
return
ResponseDto
.
success
();
}
...
...
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