记得上下班打卡 | git大法好,push需谨慎

Commit 3036a748 authored by 张国柄's avatar 张国柄

+queue:创建藏品+NFT素材上传、声明;

parent 227a3e48
...@@ -49,13 +49,16 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable { ...@@ -49,13 +49,16 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable {
@ApiModelProperty(position = 18, required = false, value = "商品标签列表") @ApiModelProperty(position = 18, required = false, value = "商品标签列表")
private List<String> tagList; private List<String> tagList;
@ApiModelProperty(position = 19, required = false, value = "注意事项[256]", example = "注意事项...") @ApiModelProperty(position = 19, required = true, value = "注意事项[256]", example = "注意事项...")
@Size(max = 256, message = "商品简介内容过长") // @NotBlank(message = "注意事项不能为空")
@Size(max = 256, message = "注意事项内容过长")
private String attention; private String attention;
@ApiModelProperty(position = 20, required = false, value = "创作者[25]", example = "创作者...") @ApiModelProperty(position = 20, required = true, value = "创作者[25]", example = "创作者...")
@NotBlank(message = "创作者不能为空")
@Size(max = 25, message = "创作者内容过长") @Size(max = 25, message = "创作者内容过长")
private String author; private String author;
@ApiModelProperty(position = 21, required = false, value = "发行方[25]", example = "发行方...") @ApiModelProperty(position = 21, required = true, value = "发行方[25]", example = "发行方...")
@NotBlank(message = "发行方不能为空")
@Size(max = 25, message = "发行方内容过长") @Size(max = 25, message = "发行方内容过长")
private String publisher; private String publisher;
......
...@@ -27,6 +27,10 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -27,6 +27,10 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@ApiModelProperty(position = 12, required = false, value = "单品ID,编辑时必传") @ApiModelProperty(position = 12, required = false, value = "单品ID,编辑时必传")
private String skuId; private String skuId;
@ApiModelProperty(position = 12, required = false, value = "NFT区块链[zxinchain-至信链]", allowableValues = "zxinchain", example = "zxinchain")
@Pattern(regexp = "\\b(zxinchain)\\b", message = "NFT区块链参数无效")
private String routeType;
@ApiModelProperty(position = 13, required = true, value = "藏品名称[36]", example = "藏品名称...") @ApiModelProperty(position = 13, required = true, value = "藏品名称[36]", example = "藏品名称...")
@NotNull(message = "藏品名称不能为空") @NotNull(message = "藏品名称不能为空")
@Size(max = 36, message = "藏品名称内容过长") @Size(max = 36, message = "藏品名称内容过长")
...@@ -35,11 +39,11 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -35,11 +39,11 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@NotNull(message = "款式名称不能为空") @NotNull(message = "款式名称不能为空")
@Size(max = 36, message = "款式名称内容过长") @Size(max = 36, message = "款式名称内容过长")
private String subtitle; private String subtitle;
@ApiModelProperty(position = 15, required = true, value = "藏品封面图片URL[256]", example = "http://123") @ApiModelProperty(position = 15, required = true, value = "藏品封面图片URL[256]", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.png")
@NotNull(message = "藏品封面图片不能为空") @NotNull(message = "藏品封面图片不能为空")
@Size(max = 256, message = "藏品封面图片URL过长") @Size(max = 256, message = "藏品封面图片URL过长")
private String skuPic; private String skuPic;
@ApiModelProperty(position = 16, required = true, value = "展示文件URL[256]", example = "1") @ApiModelProperty(position = 16, required = true, value = "展示文件URL[256]", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.png")
@NotNull(message = "展示文件不能为空") @NotNull(message = "展示文件不能为空")
@Size(max = 256, message = "展示文件URL过长") @Size(max = 256, message = "展示文件URL过长")
private String skuWatch; private String skuWatch;
...@@ -50,7 +54,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -50,7 +54,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@ApiModelProperty(position = 18, required = false, value = "我的藏品展示文件类型[1-图片|2-视频|3-模型],`unbox=0`时必传", example = "1") @ApiModelProperty(position = 18, required = false, value = "我的藏品展示文件类型[1-图片|2-视频|3-模型],`unbox=0`时必传", example = "1")
@Pattern(regexp = "\\b(1|2|3)\\b", message = "我的藏品展示文件类型参数无效") @Pattern(regexp = "\\b(1|2|3)\\b", message = "我的藏品展示文件类型参数无效")
private String materialType; private String materialType;
@ApiModelProperty(position = 19, required = false, value = "我的藏品展示文件URL[256],`unbox=0`时必传", example = "http://123") @ApiModelProperty(position = 19, required = false, value = "我的藏品展示文件URL[256],`unbox=0`时必传", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.png")
@Size(max = 256, message = "我的藏品展示文件URL过长") @Size(max = 256, message = "我的藏品展示文件URL过长")
private String materialUrl; private String materialUrl;
...@@ -138,6 +142,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -138,6 +142,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
GoblinGoodsSkuInfoVo initVo = GoblinGoodsSkuInfoVo.getNew(); GoblinGoodsSkuInfoVo initVo = GoblinGoodsSkuInfoVo.getNew();
initVo.setSkuId(this.getSpuId().concat(StringUtils.right(String.valueOf(System.nanoTime()), 5))); initVo.setSkuId(this.getSpuId().concat(StringUtils.right(String.valueOf(System.nanoTime()), 5)));
initVo.setSpuId(this.getSpuId()); initVo.setSpuId(this.getSpuId());
initVo.setRouteType(StringUtils.isNotBlank(this.getRouteType()) ? this.getRouteType() : "zxinchain");
initVo.setSkuNo(this.getSpuId()); initVo.setSkuNo(this.getSpuId());
initVo.setSkuType(1); initVo.setSkuType(1);
initVo.setName(this.getName()); initVo.setName(this.getName());
...@@ -185,6 +190,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -185,6 +190,7 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
public GoblinGoodsSkuInfoVo initEditGoodsSkuInfoVo() { public GoblinGoodsSkuInfoVo initEditGoodsSkuInfoVo() {
GoblinGoodsSkuInfoVo updateVo = GoblinGoodsSkuInfoVo.getNew(); GoblinGoodsSkuInfoVo updateVo = GoblinGoodsSkuInfoVo.getNew();
updateVo.setSkuId(this.getSkuId()); updateVo.setSkuId(this.getSkuId());
// updateVo.setRouteType(this.getRouteType());
updateVo.setDetails(this.getDetails()); updateVo.setDetails(this.getDetails());
updateVo.setShelvesHandle(this.getShelvesHandle()); updateVo.setShelvesHandle(this.getShelvesHandle());
......
...@@ -109,7 +109,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -109,7 +109,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private Integer openingLimit; private Integer openingLimit;
@ApiModelProperty(position = 33, value = "NFT路由") @ApiModelProperty(position = 33, value = "NFT路由")
private String routeType; private String routeType;
@ApiModelProperty(position = 33, value = "NFT上传声明状态[0-待上传|1-已上传|2-上传失败|9-上传中]") @ApiModelProperty(position = 33, value = "NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]")
private Integer upchain; private Integer upchain;
@ApiModelProperty(position = 33, value = "NFT预览图访问URL") @ApiModelProperty(position = 33, value = "NFT预览图访问URL")
private String displayUrl; private String displayUrl;
......
...@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.kylin.utils; ...@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.kylin.utils;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil; import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -22,7 +23,7 @@ public class QueueUtils { ...@@ -22,7 +23,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
redisDataSourceUtil.getRedisKylinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); redisDataSourceUtil.getRedisKylinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
...@@ -324,7 +324,7 @@ public class HttpUtil { ...@@ -324,7 +324,7 @@ public class HttpUtil {
// header // header
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Accept", MediaType.APPLICATION_JSON.toString()); httpHeaders.add("Accept", MediaType.APPLICATION_JSON_UTF8_VALUE);
httpHeaders.set("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE); httpHeaders.set("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
if (headers != null) { if (headers != null) {
httpHeaders.addAll(headers); httpHeaders.addAll(headers);
......
package com.liquidnet.service.base.constant; package com.liquidnet.service.base.constant;
public class MQConst { public class MQConst {
public static final String QUEUE_MESSAGE_KEY = "message";
public enum AdamQueue { public enum AdamQueue {
SMS_NOTICE("adam:stream:rk.sms.notice", "group.sms.sender", "短信通知"), SMS_NOTICE("adam:stream:rk.sms.notice", "group.sms.sender", "短信通知"),
// SMS_SPREAD("adam:stream:rk.sms.spread", "group.sms.sender", "短信推广"), // SMS_SPREAD("adam:stream:rk.sms.spread", "group.sms.sender", "短信推广"),
...@@ -285,7 +287,8 @@ public class MQConst { ...@@ -285,7 +287,8 @@ public class MQConst {
GOBLIN_UN_PAY_8("goblin:stream:order:back:8", "group.order:back", "回滚关闭订单库存队列"), GOBLIN_UN_PAY_8("goblin:stream:order:back:8", "group.order:back", "回滚关闭订单库存队列"),
GOBLIN_UN_PAY_9("goblin:stream:order:back:9", "group.order:back", "回滚关闭订单库存队列"), GOBLIN_UN_PAY_9("goblin:stream:order:back:9", "group.order:back", "回滚关闭订单库存队列"),
BIZ_ARTWORK_UPC("goblin:stream:biz_art:upc", "group.biz.artwork", "藏品声明查询"), BIZ_ARTWORK_UPL("goblin:stream:biz_art:upl", "group.biz.artwork", "藏品上传声明"),
BIZ_ARTWORK_CLQ("goblin:stream:biz_art:clq", "group.biz.artwork", "藏品声明查询"),
BIZ_ARTWORK_GEN("goblin:stream:biz_art:gen", "group.biz.artwork", "藏品生成"), BIZ_ARTWORK_GEN("goblin:stream:biz_art:gen", "group.biz.artwork", "藏品生成"),
SQL_ARTWORK_GEN("goblin:stream:sql_art:gen", "group.biz.artwork", "藏品生成"), SQL_ARTWORK_GEN("goblin:stream:sql_art:gen", "group.biz.artwork", "藏品生成"),
; ;
......
...@@ -45,7 +45,7 @@ public class GoblinGoodsSkuNft implements Serializable { ...@@ -45,7 +45,7 @@ public class GoblinGoodsSkuNft implements Serializable {
private String materialUrl; private String materialUrl;
/** /**
* NFT上传声明状态[0-待上传|1-已上传|2-上传失败|9-上传中] * NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]
*/ */
private Integer upchain; private Integer upchain;
......
package com.liquidnet.service.adam.util; package com.liquidnet.service.adam.util;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
...@@ -35,7 +36,7 @@ public class QueueUtils { ...@@ -35,7 +36,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
package com.liquidnet.service.candy.util; package com.liquidnet.service.candy.util;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
...@@ -22,7 +23,7 @@ public class QueueUtils { ...@@ -22,7 +23,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
...@@ -45,7 +45,7 @@ public class QueueUtils { ...@@ -45,7 +45,7 @@ public class QueueUtils {
} }
// public void sendMsgByRedis(String streamKey, String jsonMsg) { // public void sendMsgByRedis(String streamKey, String jsonMsg) {
// HashMap<String, String> map = CollectionUtil.mapStringString(); // HashMap<String, String> map = CollectionUtil.mapStringString();
// map.put("message", jsonMsg); // map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
// try { // try {
// stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); // stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
// } catch (Exception e) { // } catch (Exception e) {
......
...@@ -3,7 +3,8 @@ package com.liquidnet.service.consumer.kylin.config; ...@@ -3,7 +3,8 @@ 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.ConsumerGoblinBizArtworkGenRdsReceiver; import com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinBizArtworkGenRdsReceiver;
import com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinBizArtworkUpcRdsReceiver; import com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinBizArtworkClqRdsReceiver;
import com.liquidnet.service.consumer.kylin.receiver.ConsumerGoblinBizArtworkUplRdsReceiver;
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,20 +25,38 @@ public class ConsumerCommonBizRedisStreamConfig extends RedisStreamConfig { ...@@ -24,20 +25,38 @@ public class ConsumerCommonBizRedisStreamConfig extends RedisStreamConfig {
@Autowired @Autowired
StringRedisTemplate stringRedisTemplate; StringRedisTemplate stringRedisTemplate;
@Autowired @Autowired
ConsumerGoblinBizArtworkUpcRdsReceiver consumerGoblinBizArtworkUpcRdsReceiver; ConsumerGoblinBizArtworkUplRdsReceiver consumerGoblinBizArtworkUplRdsReceiver;
@Autowired
ConsumerGoblinBizArtworkClqRdsReceiver consumerGoblinBizArtworkClqRdsReceiver;
@Autowired @Autowired
ConsumerGoblinBizArtworkGenRdsReceiver consumerGoblinBizArtworkGenRdsReceiver; ConsumerGoblinBizArtworkGenRdsReceiver consumerGoblinBizArtworkGenRdsReceiver;
@Bean// 藏品上传声明
public List<Subscription> subscriptionBizArtworkUpl(RedisConnectionFactory factory) {
List<Subscription> subscriptionList = new ArrayList<>();
MQConst.GoblinQueue stream = MQConst.GoblinQueue.BIZ_ARTWORK_UPL;
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()), consumerGoblinBizArtworkUplRdsReceiver
));
listenerContainer.start();
}
return subscriptionList;
}
@Bean// 藏品声明查询 @Bean// 藏品声明查询
public List<Subscription> subscriptionBizArtworkUpc(RedisConnectionFactory factory) { public List<Subscription> subscriptionBizArtworkClq(RedisConnectionFactory factory) {
List<Subscription> subscriptionList = new ArrayList<>(); List<Subscription> subscriptionList = new ArrayList<>();
MQConst.GoblinQueue stream = MQConst.GoblinQueue.BIZ_ARTWORK_UPC; MQConst.GoblinQueue stream = MQConst.GoblinQueue.BIZ_ARTWORK_CLQ;
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup()); this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory); StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory);
subscriptionList.add(listenerContainer.receiveAutoAck( subscriptionList.add(listenerContainer.receiveAutoAck(
Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)), Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)),
StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerGoblinBizArtworkUpcRdsReceiver StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), consumerGoblinBizArtworkClqRdsReceiver
)); ));
listenerContainer.start(); listenerContainer.start();
} }
......
package com.liquidnet.service.consumer.kylin.receiver; package com.liquidnet.service.consumer.kylin.receiver;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.kylin.service.IBaseDao; import com.liquidnet.service.consumer.kylin.service.IBaseDao;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -24,7 +25,7 @@ public abstract class AbstractBizRedisReceiver implements StreamListener<String, ...@@ -24,7 +25,7 @@ public abstract class AbstractBizRedisReceiver implements StreamListener<String,
public void onMessage(MapRecord<String, String, String> message) { public void onMessage(MapRecord<String, String, String> message) {
String redisStreamKey = this.getRedisStreamKey(); String redisStreamKey = this.getRedisStreamKey();
log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue()); log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerMessageHandler(message.getValue().get("message")); boolean result = this.consumerMessageHandler(message.getValue().get(MQConst.QUEUE_MESSAGE_KEY));
log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId()); log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
try { try {
......
...@@ -33,7 +33,7 @@ alter table goblin_goods_sku add opening_limit int default 0 comment '盲盒开 ...@@ -33,7 +33,7 @@ alter table goblin_goods_sku add opening_limit int default 0 comment '盲盒开
# alter table goblin_goods_sku add route_type varchar(20) null comment 'NFT路由' after opening_limit; # alter table goblin_goods_sku add route_type varchar(20) null comment 'NFT路由' after opening_limit;
# alter table goblin_goods_sku add material_type char null comment '素材原始文件类型[1-图片|2-视频|3-模型]' after watch_type; # alter table goblin_goods_sku add material_type char null comment '素材原始文件类型[1-图片|2-视频|3-模型]' after watch_type;
# alter table goblin_goods_sku add material_url varchar(256) null comment '素材原始文件URL' after material_type; # alter table goblin_goods_sku add material_url varchar(256) null comment '素材原始文件URL' after material_type;
# alter table goblin_goods_sku add upchain tinyint default 0 null comment 'NFT上传声明状态[0-待上传|1-已上传|2-上传失败|9-上传中]' after route_type; # alter table goblin_goods_sku add upchain tinyint default 0 null comment 'NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]' after route_type;
# alter table goblin_goods_sku add display_url varchar(500) null comment 'NFT预览图URL' after upchain; # alter table goblin_goods_sku add display_url varchar(500) null comment 'NFT预览图URL' after upchain;
# alter table goblin_goods_sku add nft_url varchar(500) null comment 'NFT素材访问URL' after display_url; # alter table goblin_goods_sku add nft_url varchar(500) null comment 'NFT素材访问URL' after display_url;
# alter table goblin_goods_sku add series_id varchar(256) null comment 'NFT系列ID' after nft_url; # alter table goblin_goods_sku add series_id varchar(256) null comment 'NFT系列ID' after nft_url;
...@@ -49,7 +49,7 @@ create table goblin_goods_sku_nft ...@@ -49,7 +49,7 @@ create table goblin_goods_sku_nft
route_type varchar(20) null comment 'NFT路由', route_type varchar(20) null comment 'NFT路由',
material_type char null comment '素材原始文件类型[1-图片|2-视频|3-模型]', material_type char null comment '素材原始文件类型[1-图片|2-视频|3-模型]',
material_url varchar(256) null comment '素材原始文件URL', material_url varchar(256) null comment '素材原始文件URL',
upchain tinyint default 0 comment 'NFT上传声明状态[0-待上传|1-已上传|2-上传失败|9-上传中]', upchain tinyint default 0 comment 'NFT上传声明状态[0-待上传|1-已声明|2-声明失败|9-声明中]',
display_url varchar(500) null comment 'NFT预览图URL', display_url varchar(500) null comment 'NFT预览图URL',
nft_url varchar(500) null comment 'NFT素材访问URL', nft_url varchar(500) null comment 'NFT素材访问URL',
series_id varchar(256) null comment 'NFT系列ID', series_id varchar(256) null comment 'NFT系列ID',
......
...@@ -953,7 +953,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -953,7 +953,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
@Override @Override
public void digitalGoodsAddSku(String uid, GoblinGoodsSkuInfoVo initGoodsSkuInfoVo, GoblinGoodsInfoVo mgtGoodsInfoVo) { public void digitalGoodsAddSku(String uid, GoblinGoodsSkuInfoVo initGoodsSkuInfoVo, GoblinGoodsInfoVo mgtGoodsInfoVo) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
initGoodsSkuInfoVo.setRouteType("zxinchain");// TODO: 2022/3/25 ==zhanggb // initGoodsSkuInfoVo.setRouteType("zxinchain");
initGoodsSkuInfoVo.setUpchain(0); initGoodsSkuInfoVo.setUpchain(0);
initGoodsSkuInfoVo.setCreatedAt(now); initGoodsSkuInfoVo.setCreatedAt(now);
initGoodsSkuInfoVo.setCreatedBy(uid); initGoodsSkuInfoVo.setCreatedBy(uid);
...@@ -1020,6 +1020,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -1020,6 +1020,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
// LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr(); // LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr();
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(), SqlMapping.gets(toMqSqls, initGoodsSkuObjs, initGoodsSkuNftObjs, updateGoodsObjs)); queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(), SqlMapping.gets(toMqSqls, initGoodsSkuObjs, initGoodsSkuNftObjs, updateGoodsObjs));
if ("0".equals(initGoodsSkuInfoVo.getUnbox())) {
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.BIZ_ARTWORK_UPL.getKey(), skuId);// 藏品NFT上传、声明通过队列处理
}
} }
@Override @Override
......
...@@ -36,7 +36,7 @@ public class QueueUtils { ...@@ -36,7 +36,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
...@@ -52,7 +52,7 @@ public class QueueUtils { ...@@ -52,7 +52,7 @@ public class QueueUtils {
} else { } else {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", xlsPath); map.put(MQConst.QUEUE_MESSAGE_KEY, xlsPath);
map.put("type", type); map.put("type", type);
map.put("skuId", skuId); map.put("skuId", skuId);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(MQConst.GoblinQueue.GOBLIN_XLS_OPERA.getKey())); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(MQConst.GoblinQueue.GOBLIN_XLS_OPERA.getKey()));
......
...@@ -41,7 +41,7 @@ public class QueueUtils { ...@@ -41,7 +41,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
......
...@@ -40,7 +40,7 @@ public class QueueUtils { ...@@ -40,7 +40,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = ObjectUtil.cloneHashMapStringAndString(); HashMap<String, String> map = ObjectUtil.cloneHashMapStringAndString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
......
...@@ -2,6 +2,7 @@ package com.liquidnet.service.platform.utils; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.platform.utils;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil; import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -36,7 +37,7 @@ public class QueueUtils { ...@@ -36,7 +37,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
redisDataSourceUtil.getRedisKylinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); redisDataSourceUtil.getRedisKylinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
...@@ -48,7 +49,7 @@ public class QueueUtils { ...@@ -48,7 +49,7 @@ public class QueueUtils {
*/ */
public void sendMsgByCandyRedis(String streamKey, String jsonMsg) { public void sendMsgByCandyRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
redisDataSourceUtil.getRedisCandyUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); redisDataSourceUtil.getRedisCandyUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
...@@ -60,7 +61,7 @@ public class QueueUtils { ...@@ -60,7 +61,7 @@ public class QueueUtils {
*/ */
public void sendMsgByGoblinRedis(String streamKey, String jsonMsg) { public void sendMsgByGoblinRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
redisDataSourceUtil.getRedisGoblinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); redisDataSourceUtil.getRedisGoblinUtil().getStringRedisTemplate().opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
...@@ -36,7 +36,7 @@ public class QueueUtils { ...@@ -36,7 +36,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
...@@ -52,7 +52,7 @@ public class QueueUtils { ...@@ -52,7 +52,7 @@ public class QueueUtils {
} else { } else {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", xlsPath); map.put(MQConst.QUEUE_MESSAGE_KEY, xlsPath);
map.put("type", type); map.put("type", type);
map.put("skuId", skuId); map.put("skuId", skuId);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(MQConst.GoblinQueue.GOBLIN_XLS_OPERA.getKey())); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(MQConst.GoblinQueue.GOBLIN_XLS_OPERA.getKey()));
......
package com.liquidnet.service.stone.util; package com.liquidnet.service.stone.util;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
...@@ -35,7 +36,7 @@ public class QueueUtils { ...@@ -35,7 +36,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
package com.liquidnet.service.sweet.utils; package com.liquidnet.service.sweet.utils;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.base.constant.MQConst;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords; import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
...@@ -35,7 +36,7 @@ public class QueueUtils { ...@@ -35,7 +36,7 @@ public class QueueUtils {
*/ */
public void sendMsgByRedis(String streamKey, String jsonMsg) { public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString(); HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg); map.put(MQConst.QUEUE_MESSAGE_KEY, jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey)); stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment