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

Commit b2d4bfed authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_xuper' into dev_rc_xuper_op

parents ebe32ca8 8fd7f031
......@@ -7,6 +7,7 @@ public class AdamEnum {
public enum BizAcct {
IMHX("imhx", "即时通讯-环信"),
NFT_ZX("nft_zx", "NFT-至信链"),
NFT_XUPER("nft_xuper", "NFT-百度超级链"),
;
private final String code;
private final String desc;
......
......@@ -23,6 +23,7 @@ public class GalaxyConstant {
public static final String REDIS_KEY_GALAXY_PUBLISH_NFT="galaxy:publish:nft:"; //nft索引递增记录
public static final String SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明
public static final String SERIES_NAME_XUPER_PREFIX="NOW_XUPER_";// 系列存储目录名称和系列声明
public static final String ADAM_USER_SYNC_URL="/adam/rsc/syn/certmeta";// adam用户开通数字账户信息同步url
......
......@@ -148,6 +148,42 @@ public class GalaxyEnum {
}
}
/**
* 标记任务状态
*/
public enum AssetPublishStatusEnum{
INIT("-1","数据初始化"),
PROCESSING("0","发行中"),
SUCCESS("1","发行成功"),
FAIL("2","发行失败");
private String code;
private String message;
AssetPublishStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public AssetPublishStatusEnum getEnumByCode(String code){
AssetPublishStatusEnum[] arry = AssetPublishStatusEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].getCode().equals(code)) {
return arry[i];
}
}
return null;
}
public String getCode() {
return code;
}
public String getMessage(){
return message;
}
}
/**
* 标记任务状态
*/
......
......@@ -71,6 +71,16 @@ public class GalaxySeriesNftInfoBo implements Serializable,Cloneable {
*/
private String originalDisplayUrl;
/**
* nft发行状态
*/
private String nftPublishStatus;
/**
* nft发行交易hash
*/
private String nftPublishTradeHash;
//======================================
//=============以下都为购买信息=============
//======================================
......
......@@ -39,6 +39,11 @@ public class GalaxySeriesNftUploadBo implements Serializable,Cloneable {
*/
private String displayUrl;
/**
* nft介质hash值
*/
private String nftHashStr;
/**
* 创建时间
*/
......
......@@ -69,6 +69,45 @@ public class GalaxyQuerySeriesInfoRespDto implements Serializable,Cloneable {
return JsonUtils.toJson(this);
}
/**
* 以下为百度链新增字段****开始***********
*/
/**
* nft介质访问url
*/
@ApiModelProperty(position = 1, required = true, value = "nft介质访问url")
private String nftUrl;
/**
* nft缩略图icon
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图icon")
private String nftThumbIcon;
/**
* nft缩略图url1
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url1")
private String nftThumbUrl1;
/**
* nft缩略图url2
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url2")
private String nftThumbUrl2;
/**
* nft缩略图url3
*/
@ApiModelProperty(position = 1, required = true, value = "nft缩略图url3")
private String nftThumbUrl3;
/**
* 以下为百度链新增字段****结束***********
*/
private static final GalaxyQuerySeriesInfoRespDto obj = new GalaxyQuerySeriesInfoRespDto();
public static GalaxyQuerySeriesInfoRespDto getNew() {
......
......@@ -22,12 +22,20 @@ import java.io.Serializable;
@Data
public class GalaxyUserBindStatusQueryReqDto extends GalaxyBaseReqDto implements Serializable,Cloneable {
/**
* nftOrderPayId
* 用户id
*/
@ApiModelProperty(position = 1, required = true, value = "用户区块链地址")
@NotBlank(message = "用户区块链地址不能为空!")
@Size(min = 2, max = 100, message = "用户区块链地址不能超过100个字符")
private String blockChainAddress;
@ApiModelProperty(position = 1, required = true, value = "用户ID[30]")
@NotBlank(message = "用户ID不能为空!")
@Size(min = 1, max = 30, message = "用户ID限制2-30位且不能包含特殊字符")
private String userId;
// /**
// * nftOrderPayId
// */
// @ApiModelProperty(position = 1, required = true, value = "用户区块链地址")
// @NotBlank(message = "用户区块链地址不能为空!")
// @Size(min = 2, max = 100, message = "用户区块链地址不能超过100个字符")
// private String blockChainAddress;
@Override
public String toString(){
......
......@@ -19,6 +19,9 @@ import java.io.Serializable;
@ApiModel(value = "GalaxyUserBindStatusQueryRespDto", description = "用户绑定状态查询")
@Data
public class GalaxyUserBindStatusQueryRespDto implements Serializable,Cloneable {
@ApiModelProperty(position = 1, required = true, value = "用户ID[30]")
private String userId;
@ApiModelProperty(position = 3, required = true, value = "用户区块链地址")
private String blockChainAddress;
......
......@@ -27,8 +27,8 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@ApiModelProperty(position = 12, required = false, value = "单品ID,编辑时必传")
private String skuId;
@ApiModelProperty(position = 12, required = false, value = "NFT区块链[zxinchain-至信链]", allowableValues = "zxinchain", example = "zxinchain")
@Pattern(regexp = "\\b(zxinchain)\\b", message = "NFT区块链参数无效")
@ApiModelProperty(position = 12, required = false, value = "NFT区块链[zxinchain-至信链|xuper-百度链]", allowableValues = "zxinchain,xuper", example = "zxinchain")
@Pattern(regexp = "\\b(zxinchain|xuper)\\b", message = "NFT区块链参数无效")
private String routeType;
@ApiModelProperty(position = 13, required = true, value = "藏品名称[36]", example = "藏品名称...")
......
......@@ -28,6 +28,8 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
private Integer edition;
@ApiModelProperty(position = 17, value = "藏品NFT ID")
private String nftId;
@ApiModelProperty(position = 17, value = "藏品交易HASH")
private String tradingTxhash;
@ApiModelProperty(position = 18, value = "藏品生成时间[yyyy-MM-dd HH:mm:ss]")
private String generateTime;
......@@ -63,6 +65,7 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
}
public GoblinUserDigitalArtworkInfoVo copy(GoblinUserDigitalArtworkVo source) {
if (null == source) return this;
// this.setName();
// this.setSubtitle();
// this.setMaterialType();
......@@ -70,6 +73,7 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
// this.setEdition();
this.setEditionSn(source.getEditionSn());
this.setNftId(source.getNftId());
this.setTradingTxhash(source.getTradingTxhash());
this.setGenerateTime(source.getTradingAt());
this.setSource(source.getSource());
this.setState(source.getState());
......
......@@ -117,6 +117,10 @@ public class IDGenerator {
return "ZXLNFTIMAGE" + nextTimeId();
}
public static String getXuperNftImageCosCode() {
return "XUPERNFTIMAGE" + nextTimeId();
}
public static String refundCode() {
return "RED" + nextTimeId();
}
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-common-third</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-common-third-xuper</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-base</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redis</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>jakarta.validation</groupId>-->
<!-- <artifactId>jakarta.validation-api</artifactId>-->
<!-- </dependency>-->
<!-- 百度超级链-->
<dependency>
<groupId>com.baidu.xuper</groupId>
<artifactId>xasset-sdk-java</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.baidu.xuper</groupId>
<artifactId>xuper-java-sdk</artifactId>
<version>0.2.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.59.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>2020.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
package com.liquidnet.common.third.xuper.biz;
import com.baidu.xasset.auth.XchainAccount;
import com.baidu.xasset.client.xasset.Asset;
import com.baidu.xasset.common.config.Config;
import com.baidu.xuper.api.Account;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.logging.Logger;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: XuperCommonBiz
* @Package com.liquidnet.common.third.xuper.biz
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 17:59
*/
@Slf4j
@Component
public class XuperCommonBiz {
public Asset getAssetApi(){
long appId = 1182282645;
String ak = "3bdecf4afebd41849628389a20629ecc";
String sk = "3f901ef12d454b9c92ba2dde7c029140";
Config.XassetCliConfig cfg = new Config.XassetCliConfig();
cfg.setCredentials(appId, ak, sk);
cfg.setEndPoint("http://120.48.16.137:8360");
// 创建区块链账户
Account acc = XchainAccount.newXchainEcdsaAccount(XchainAccount.mnemStrgthStrong, XchainAccount.mnemLangEN);
// 初始化接口类
Asset handle = new Asset(cfg, Logger.getGlobal());
return handle;
}
}
package com.liquidnet.common.third.xuper.config;
import com.baidu.xasset.client.xasset.Asset;
import com.baidu.xasset.common.config.Config;
import com.liquidnet.commons.lang.util.MD5Utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import java.util.logging.Logger;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: Xuper配置
* @class: XuperConfig
* @Package com.liquidnet.common.third.xuper.config
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 17:42
*/
@Slf4j
@Configuration
public class XuperConfig {
@Value("${liquidnet.service.galaxy.xuper.appId:110381}")
private String appId;
@Value("${liquidnet.service.galaxy.xuper.accessKeyID:f3565df21f2b84d999dd7e2817ed80ea}")
private String accessKeyID;
@Value("${liquidnet.service.galaxy.xuper.secretAccessKey:b2ee53f6bb5555ee3582198fd52552cc}")
private String secretAccessKey;
@Value("${liquidnet.service.galaxy.xuper.nftApiUrl:http://120.48.16.137:8360}")
private String nftApiUrl;
@Value("${liquidnet.service.galaxy.xuper.nftPlatformMnemonic}")
private String nftPlatformMnemonic;
@Value("${liquidnet.service.galaxy.xuper.nftPlatformAddress}")
private String nftPlatformAddress;
private Asset asset = null;
private static Asset staticAsset = null;
private static Logger logger = Logger.getLogger(XuperConfig.class.getCanonicalName());
@PostConstruct
public void init(){
long _appId = Long.parseLong(appId);
// String ak = accessKeyID;
// String sk = secretAccessKey;
String ak = MD5Utils.md5(accessKeyID);
String sk = MD5Utils.md5(secretAccessKey);;
Config.XassetCliConfig cfg = new Config.XassetCliConfig();
cfg.setCredentials(_appId, ak, sk);
cfg.setEndPoint(nftApiUrl);
// 初始化接口类
// Logger logger = Logger.getGlobal();
// logger.getParent().setLevel(Level.INFO);
log.info("logger.getParent().getLevel() === {}",logger.getParent().getLevel());
// logger.setLevel(Level.INFO);
log.info("logger.getLevel() === {}",logger.getLevel());
asset = new Asset(cfg, logger);
}
//
// static{
// long appId = 1182282645;
// String ak = "";
// String sk = "";
// String apiUrl = "http://120.48.16.137:8360";
//
// Config.XassetCliConfig cfg = new Config.XassetCliConfig();
// cfg.setCredentials(appId, ak, sk);
// cfg.setEndPoint(apiUrl);
//
// // 初始化接口类
// staticAsset = new Asset(cfg, Logger.getGlobal());
// }
public Asset getAsset(){
return this.asset;
}
public String getAppId() {
return appId;
}
public String getAccessKeyID() {
return accessKeyID;
}
public String getSecretAccessKey() {
return secretAccessKey;
}
public String getNftApiUrl() {
return nftApiUrl;
}
public String getNftPlatformMnemonic() {
return nftPlatformMnemonic;
}
public String getNftPlatformAddress() {
return nftPlatformAddress;
}
}
package com.liquidnet.common.third.xuper.constant;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: XuperConstant
* @Package com.liquidnet.common.third.xuper.constant
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/22 11:49
*/
public class XuperConstant {
}
package com.liquidnet.common.third.xuper.constant;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: XuperEnum
* @Package com.liquidnet.common.third.xuper.constant
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/22 11:50
*/
public class XuperEnum {
/**
* 资产分类。1:艺术品 2:收藏品 3:门票 4:酒店
*/
public enum assetTypeEnum{
ARTWORK("1","艺术品"),
COLLECTION("2","收藏品"),
TICKETS("3","门票"),
HOTEL("4","酒店");
private String code;
private String message;
assetTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
public assetTypeEnum getEnumByCode(String code){
assetTypeEnum[] arry = assetTypeEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].getCode().equals(code)) {
return arry[i];
}
}
return null;
}
public String getCode() {
return code;
}
}
/**
* 资产发行状态 1:初始 3:发行中 4:发行成功 5:冻结中 6:已冻结 7:封禁中 8:已封禁
*/
public enum AssetPublishStatusEnum{
INIT("1","初始"),
PUBLISHING("3","发行中"),
PUBLISH_SUCCESS("4","发行成功"),
FREEZING("5","冻结中"),
BANNEDING("6","封禁中"),
BANNEDED("7","已封禁");
private String code;
private String message;
AssetPublishStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public AssetPublishStatusEnum getEnumByCode(String code){
AssetPublishStatusEnum[] arry = AssetPublishStatusEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].getCode().equals(code)) {
return arry[i];
}
}
return null;
}
public String getCode() {
return code;
}
public String getMessage(){
return message;
}
}
/**
* 资产授予状态 0:已上链 1:授予中 4:转移中 5: 核销中 6: 已核销 10:异常详情参考错误码和状态码
*/
public enum AssetGrantStatusEnum{
GRANT_SUCCESS("0","已上链"),
GRANTING("1","授予中"),
TRANSFERING("4","转移中"),
CANCELING("5","核销中"),
CANCELED("6","已核销"),
OTHER_ERROR("10","异常详情参考错误码和状态码");
private String code;
private String message;
AssetGrantStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public AssetGrantStatusEnum getEnumByCode(String code){
AssetGrantStatusEnum[] arry = AssetGrantStatusEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].getCode().equals(code)) {
return arry[i];
}
}
return null;
}
public String getCode() {
return code;
}
public String getMessage(){
return message;
}
}
}
package com.liquidnet.common.third.xuper.constant;
import java.util.Arrays;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: XuperErrorEnum
* @Package com.liquidnet.common.third.xuper.constant
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/21 14:09
*/
public enum XuperErrorEnum {
SECCESS("0","成功"),
FAILURE("1","失败"),
SYSTEM_ERROR("SYS0010001", "系统异常,请联系管理员"),
SERVER_INNER_ERROR("SYS0010002", "系统内部错误"),
SERVER_ERROR("SYS0010003", "服务不可用,调用后端服务失败"),
INVALID_PARAM_ERROR("XUPER0010001", "参数错误"),
GENERATE_KEYPAIR_ERROR("XUPER0010002", "生成公私钥错误"),
SIGN_ERROR("XUPER0010003", "签名错误"),
VERIFY_ERROR("XUPER0010004", "验签错误"),
ENCRYPT_ERROR("XUPER0010005", "加密数据错误"),
DECODE_ERROR("XUPER0010006", "解密数据错误"),
IMAGE_CHECK_ERROR("XUPER0010007", "图片内容检测未通过"),
PARAM_FORMAT_ERROR("XUPER0010008", "参数格式错误"),
ORDER_NOT_FOUND_ERROR("XUPER0010009", "此编号未查到对应信息"),
UPLOAD_TEMP_SECRET("XUPER0010010", "生成素材上传临时密钥失败");
private String code;
private String msg;
XuperErrorEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public String getCode() { return this.code; }
public String getMsg() { return this.msg; }
public static String errorMsg(String content) {
XuperErrorEnum err = Arrays.<XuperErrorEnum>asList(values()).stream().filter(errorEnum -> errorEnum.getCode().equals(content)).findFirst().orElse(SERVER_INNER_ERROR);
return err.getMsg();
}
}
package com.liquidnet.common.third.xuper.dto;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
public class Xuper000CreateAccountReqDto implements Serializable {
/**
* 创建资产账户地址
*/
private String addr;
/**
* 创建资产账户私钥签名
*/
private String sign;
/**
* 创建资产账户公钥
*/
private String pkey;
/**
* 随机数
*/
private Integer nonce;
private static final Xuper000CreateAccountReqDto obj = new Xuper000CreateAccountReqDto();
public static Xuper000CreateAccountReqDto getNew() {
try {
return (Xuper000CreateAccountReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper000CreateAccountReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenRespDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper000CreateAccountRespDto {
private String pubKeyStr;
private String priKeyStr;
private String address;
private String mnemonic;
private static final Xuper000CreateAccountRespDto obj = new Xuper000CreateAccountRespDto();
public static Xuper000CreateAccountRespDto getNew() {
try {
return (Xuper000CreateAccountRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper000CreateAccountRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper001GetStokenReqDto implements Serializable {
/**
* 助记词
*/
private String mnemonic;
// /**
// * 创建资产账户地址
// */
// private String addr;
// /**
// * 创建资产账户私钥签名,内容为:msg = Sprintf(“%d”, nonce),sign = XassetSignECDSA(account, msg)
// */
// private String sign;
// /**
// * 创建资产账户公钥
// */
// private String pkey;
// /**
// * 随机数,可用sdk内置算法gen_nonce()生成
// */
// private Integer nonce;
private static final Xuper001GetStokenReqDto obj = new Xuper001GetStokenReqDto();
public static Xuper001GetStokenReqDto getNew() {
try {
return (Xuper001GetStokenReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper001GetStokenReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenRespDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper001GetStokenRespDto {
/**
* 后端生成,用于问题反馈,建议业务日志纪录
*/
public long requestId;
/**
* 错误码 0为成功,其他可参考常用错误码
*/
public int errNo;
/**
* 错误信息
*/
public String errMsg;
/**
* 获取的临时授权的bos信息
*/
public AccessInfo accessInfo;
@Data
public static class AccessInfo {
/**
* 存储空间
*/
@JSONField(
name = "bucket"
)
public String bucket;
/**
* 访问域名
*/
@JSONField(
name = "endpoint"
)
public String endpoint;
/**
* 文件路径
*/
@JSONField(
name = "object_path"
)
public String objectPath;
/**
* 访问密钥公钥
*/
@JSONField(
name = "access_key_id"
)
public String accessKeyId;
/**
* 访问密钥私钥
*/
@JSONField(
name = "secret_access_key"
)
public String secretAccessKey;
/**
* 临时有权的token,有效期为30min
*/
@JSONField(
name = "session_token"
)
public String sessionToken;
/**
* 鉴权生效开始时间
*/
@JSONField(
name = "createTime"
)
public LocalDateTime createTime;
/**
* 鉴权失效时间
*/
@JSONField(
name = "expiration"
)
public LocalDateTime expiration;
}
private static final Xuper001GetStokenRespDto obj = new Xuper001GetStokenRespDto();
public static Xuper001GetStokenRespDto getNew() {
try {
return (Xuper001GetStokenRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper001GetStokenRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 创造数字资产
* @class: Xuper002CreateAssetReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper002CreateAssetReqDto {
/**
* 助记词
*/
private String mnemonic;
/**
* 资产碎片数量,小于1和大于200000代表不做库存限制
*/
private Integer amount;
/**
* 藏品显示售卖价格,单位为分
*/
private Long price;
/**
* (可选)业务侧用户标记,必要时请安全处理后设置
*/
private Long userId;
/**
* (可选)要存证的资产文件sm3散列值,如有多个文件逐个计算hash值后合并计算最终hash值
*/
private String fileHash;
/**
* 资产分类。1:艺术品 2:收藏品 3:门票 4:酒店
*/
private Integer assetCate;
/**
* 资产名称,小于30个字节
*/
private String title;
/**
* 资产缩略图。bos上传的图片,格式支持:”jpg”, “jpeg”, “png”, “bmp”, “webp”, “heic”。参数格式bos_v1://{bucket}/{object}/{width}_{height}
*/
private String thumb;
/**
* 短文字描述,小于300个字节
*/
private String shortDesc;
/**
* (可选)资产详情介绍长图。bos上传的图片,格式支持:”jpg”, “jpeg”, “png”, “bmp”, “webp”, “heic”。参数格式bos_v1://{bucket}/{object}/{width}_{height}
*/
private String imgDesc;
/**
* 资产原始文件。比如图片,图片本身就是资产。格式bos_v1://{bucket}/{object} ,文件大小<10M。文件名采用文件md5值,为了正常展现,需要正确携带文件后缀
*/
private String assetUrl;
/**
* (可选)长文字描述,小于1200个字节
*/
private String longDesc;
/**
* (可选)资产额外描述信息json字符串。比如标签
*/
private String assetExt;
/**
* (可选)资产组id。用于关联业务层酒店/店铺id
*/
private Long groupId;
private static final Xuper002CreateAssetReqDto obj = new Xuper002CreateAssetReqDto();
public static Xuper002CreateAssetReqDto getNew() {
try {
return (Xuper002CreateAssetReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper002CreateAssetReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 创造数字资产
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper002CreateAssetRespDto {
public long requestId;
public int errNo;
public String errMsg;
public long assetId;
private static final Xuper002CreateAssetRespDto obj = new Xuper002CreateAssetRespDto();
public static Xuper002CreateAssetRespDto getNew() {
try {
return (Xuper002CreateAssetRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper002CreateAssetRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 修改未发行的数字资产
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper003AlterAssetReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 助记词
*/
private String mnemonic;
/**
* 资产碎片数量,小于1和大于200000代表不做库存限制
*/
private Integer amount;
/**
* 藏品显示售卖价格,单位为分
*/
private Long price;
/**
* (可选)业务侧用户标记,必要时请安全处理后设置
*/
private Long userId;
/**
* (可选)要存证的资产文件sm3散列值,如有多个文件逐个计算hash值后合并计算最终hash值
*/
private String fileHash;
/**
* 资产分类。1:艺术品 2:收藏品 3:门票 4:酒店
*/
private Integer assetCate;
/**
* 资产名称,小于30个字节
*/
private String title;
/**
* 资产缩略图。bos上传的图片,格式支持:”jpg”, “jpeg”, “png”, “bmp”, “webp”, “heic”。参数格式bos_v1://{bucket}/{object}/{width}_{height}
*/
private String thumb;
/**
* 短文字描述,小于300个字节
*/
private String shortDesc;
/**
* (可选)资产详情介绍长图。bos上传的图片,格式支持:”jpg”, “jpeg”, “png”, “bmp”, “webp”, “heic”。参数格式bos_v1://{bucket}/{object}/{width}_{height}
*/
private String imgDesc;
/**
* 资产原始文件。比如图片,图片本身就是资产。格式bos_v1://{bucket}/{object} ,文件大小<10M。文件名采用文件md5值,为了正常展现,需要正确携带文件后缀
*/
private String assetUrl;
/**
* (可选)长文字描述,小于1200个字节
*/
private String longDesc;
/**
* (可选)资产额外描述信息json字符串。比如标签
*/
private String assetExt;
/**
* (可选)资产组id。用于关联业务层酒店/店铺id
*/
private Long groupId;
private static final Xuper003AlterAssetReqDto obj = new Xuper003AlterAssetReqDto();
public static Xuper003AlterAssetReqDto getNew() {
try {
return (Xuper003AlterAssetReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper003AlterAssetReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 修改未发行的数字资产
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper003AlterAssetRespDto {
public long requestId;
public int errNo;
public String errMsg;
private static final Xuper003AlterAssetRespDto obj = new Xuper003AlterAssetRespDto();
public static Xuper003AlterAssetRespDto getNew() {
try {
return (Xuper003AlterAssetRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper003AlterAssetRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 链上发行数字资产
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper004PublishAssetReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 助记词
*/
private String mnemonic;
private static final Xuper004PublishAssetReqDto obj = new Xuper004PublishAssetReqDto();
public static Xuper004PublishAssetReqDto getNew() {
try {
return (Xuper004PublishAssetReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper004PublishAssetReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 链上发行数字资产
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper004PublishAssetRespDto {
public long requestId;
public int errNo;
public String errMsg;
private static final Xuper004PublishAssetRespDto obj = new Xuper004PublishAssetRespDto();
public static Xuper004PublishAssetRespDto getNew() {
try {
return (Xuper004PublishAssetRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper004PublishAssetRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 查询数字商品详情
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper005QueryAssetReqDto {
/**
* 资产id
*/
private Long assetId;
private static final Xuper005QueryAssetReqDto obj = new Xuper005QueryAssetReqDto();
public static Xuper005QueryAssetReqDto getNew() {
try {
return (Xuper005QueryAssetReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper005QueryAssetReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 查询数字商品详情
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper005QueryAssetRespDto {
private long requestId;
private int errNo;
private String errMsg;
private AssetMeta meta;
@Data
public static class AssetMeta {
private long assetId;
private int assetCate;
private String title;
private Thumb[] thumb;
private String shortDesc;
private String longDesc;
private JSONArray imgDesc;
private JSONArray assetUrl;
private int amount;
private long price;
private int status;
private String assetExt;
private String createAddr;
private long groupId;
private String txId;
}
@Data
public static class Thumb {
private Urls urls;
private String width;
private String height;
}
@Data
public static class Urls {
private String icon;//60
private String url1;//140
private String url2;//360
private String url3;//850
}
private static final Xuper005QueryAssetRespDto obj = new Xuper005QueryAssetRespDto();
public static Xuper005QueryAssetRespDto getNew() {
try {
return (Xuper005QueryAssetRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper005QueryAssetRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取账户创造资产列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper006ListAssetByAddrReqDto {
//资产状态。0:全部 1:初试 3:发行中 4:发行成功。默认 0(可选)
private Integer status = 0;
//要拉取的区块链账户地址
private String addr;
//要拉取页数,第一页为1
private Integer page = 1;
//每页拉取数量,默认20,最大50(可选)
private Integer limit = 20;
private static final Xuper006ListAssetByAddrReqDto obj = new Xuper006ListAssetByAddrReqDto();
public static Xuper006ListAssetByAddrReqDto getNew() {
try {
return (Xuper006ListAssetByAddrReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper006ListAssetByAddrReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.util.ArrayList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取账户创造资产列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper006ListAssetByAddrRespDto {
public long requestId;
public int errNo;
public String errMsg;
public ArrayList list;
public int totalCnt;
private static final Xuper006ListAssetByAddrRespDto obj = new Xuper006ListAssetByAddrRespDto();
public static Xuper006ListAssetByAddrRespDto getNew() {
try {
return (Xuper006ListAssetByAddrRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper006ListAssetByAddrRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 授予数字商品碎片
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper007GrantShardReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 资产创建者助记词
*/
private String mnemonic;
/**
* 资产碎片id,需要确保asset下唯一,可以使用有序编号,也可以使用随机整数,默认使用sdk提供GenRandId方法生成
*/
private Long shardId;
/**
* 资产接收者区块链地址
*/
private String toAddr;
/**
* (可选)资产接收者用户id
*/
private Long toUserId;
/**
* (可选)碎片价格
*/
private Long price;
private static final Xuper007GrantShardReqDto obj = new Xuper007GrantShardReqDto();
public static Xuper007GrantShardReqDto getNew() {
try {
return (Xuper007GrantShardReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper007GrantShardReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 授予数字商品碎片
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper007GrantShardRespDto {
private long requestId;
private int errNo;
private String errMsg;
public long assetId;
public long shardId;
private static final Xuper007GrantShardRespDto obj = new Xuper007GrantShardRespDto();
public static Xuper007GrantShardRespDto getNew() {
try {
return (Xuper007GrantShardRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper007GrantShardRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import org.aspectj.lang.annotation.DeclareAnnotation;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 转移资产碎片(暂不开放)
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper008TransferShardReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 资产拥有者助记词
*/
private String mnemonic;
/**
* 资产碎片id,需要确保asset下唯一,可以使用有序编号,也可以使用随机整数,默认使用sdk提供GenRandId方法生成
*/
private Long shardId;
/**
* 资产接收者区块链地址
*/
private String toAddr;
/**
* (可选)资产接收者用户id
*/
private Long toUserId;
/**
* (可选)碎片价格
*/
private Long price;
private static final Xuper008TransferShardReqDto obj = new Xuper008TransferShardReqDto();
public static Xuper008TransferShardReqDto getNew() {
try {
return (Xuper008TransferShardReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper008TransferShardReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 转移资产碎片(暂不开放)
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper008TransferShardRespDto {
private long requestId;
private int errNo;
private String errMsg;
private static final Xuper008TransferShardRespDto obj = new Xuper008TransferShardRespDto();
public static Xuper008TransferShardRespDto getNew() {
try {
return (Xuper008TransferShardRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper008TransferShardRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 碎片核销
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
public class Xuper009ConsumeReqDto {
private static final Xuper009ConsumeReqDto obj = new Xuper009ConsumeReqDto();
public static Xuper009ConsumeReqDto getNew() {
try {
return (Xuper009ConsumeReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper009ConsumeReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 碎片核销
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper009ConsumeRespDto {
private long requestId;
private int errNo;
private String errMsg;
private static final Xuper009ConsumeRespDto obj = new Xuper009ConsumeRespDto();
public static Xuper009ConsumeRespDto getNew() {
try {
return (Xuper009ConsumeRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper009ConsumeRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 查询指定资产碎片信息
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper010QuerySdsReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 碎片id
*/
private Long shardId;
private static final Xuper010QuerySdsReqDto obj = new Xuper010QuerySdsReqDto();
public static Xuper010QuerySdsReqDto getNew() {
try {
return (Xuper010QuerySdsReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper010QuerySdsReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 查询指定资产碎片信息
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper010QuerySdsRespDto {
public long requestId;
public int errNo;
public String errMsg;
public ShardMeta meta;
@Data
public static class ShardMeta {
public long assetId;
public long shardId;
public String ownerAddr;
public long uid;
public long price;
public int status;
public String txId;
public ShardAssetInfo assetInfo;
public long ctime;
}
@Data
public static class ShardAssetInfo {
public String title;
public int assetCate;
public Thumb[] thumb;
public String shortDesc;
public String createAddr;
public long groupId;
}
@Data
public static class Thumb {
private Urls urls;
private String width;
private String height;
}
@Data
public static class Urls {
private String icon;
private String url1;
private String url2;
private String url3;
}
private static final Xuper010QuerySdsRespDto obj = new Xuper010QuerySdsRespDto();
public static Xuper010QuerySdsRespDto getNew() {
try {
return (Xuper010QuerySdsRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper010QuerySdsRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 分页拉取指定账户持有碎片列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper011ListSdsByAddrReqDto {
//要拉取的区块链账户地址
private String addr = "";
//要拉取页数,第一页为1
private int page = 1;
//每页拉取数量,默认20,最大50(可选)
private int limit = 50;
private static final Xuper011ListSdsByAddrReqDto obj = new Xuper011ListSdsByAddrReqDto();
public static Xuper011ListSdsByAddrReqDto getNew() {
try {
return (Xuper011ListSdsByAddrReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper011ListSdsByAddrReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.util.ArrayList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 分页拉取指定账户持有碎片列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper011ListSdsByAddrRespDto {
public long requestId;
public int errNo;
public String errMsg;
public ArrayList<ShardMeta> list;
public int totalCnt;
@Data
public static class ShardMeta {
public long assetId;
public long shardId;
public String ownerAddr;
public long uid;
public long price;
public int status;
public String txId;
public ShardAssetInfo assetInfo;
public long ctime;
}
@Data
public static class ShardAssetInfo {
public String title;
public int assetCate;
public Thumb[] thumb;
public String shortDesc;
public String createAddr;
public long groupId;
}
@Data
public static class Thumb {
private Urls urls;
private String width;
private String height;
}
@Data
public static class Urls {
private String icon;
private String url1;
private String url2;
private String url3;
}
private static final Xuper011ListSdsByAddrRespDto obj = new Xuper011ListSdsByAddrRespDto();
public static Xuper011ListSdsByAddrRespDto getNew() {
try {
return (Xuper011ListSdsByAddrRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper011ListSdsByAddrRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 分页拉取指定资产已授予碎片列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper012ListSdsByAstReqDto {
//资产id
private long assetId;
//分页游标,首页设置空字符串,后面的用上页返回的cursor值
private String cursor = "";
//每页拉取数量,默认20,最多50(可选)
private int limit = 20;
private static final Xuper012ListSdsByAstReqDto obj = new Xuper012ListSdsByAstReqDto();
public static Xuper012ListSdsByAstReqDto getNew() {
try {
return (Xuper012ListSdsByAstReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper012ListSdsByAstReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.util.ArrayList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 分页拉取指定资产已授予碎片列表
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper012ListSdsByAstRespDto {
public long requestId;
public int errNo;
public String errMsg;
public ArrayList<ShardAssetInfo> list;
public int hasMore;
public String cursor;
@Data
public static class ShardAssetInfo {
public long shardId;
public String ownerAddr;
public long price;
public String txId;
public String groupId;
public long ctime;
}
private static final Xuper012ListSdsByAstRespDto obj = new Xuper012ListSdsByAstRespDto();
public static Xuper012ListSdsByAstRespDto getNew() {
try {
return (Xuper012ListSdsByAstRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper012ListSdsByAstRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取数字商品历史登记记录
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper013HistoryReqDto {
//资产id
private long assetId;
//要拉取页数,第一页为1
private int page = 1;
//每页拉取数量,默认20,最大50(可选)
private int limit = 20;
private static final Xuper013HistoryReqDto obj = new Xuper013HistoryReqDto();
public static Xuper013HistoryReqDto getNew() {
try {
return (Xuper013HistoryReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper013HistoryReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.util.ArrayList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 拉取数字商品历史登记记录
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper013HistoryRespDto {
public long requestId;
public int errNo;
public String errMsg;
public ArrayList<AssetInfo> list;
public int totalCnt;
@Data
public static class AssetInfo {
public long assetId;
public long type;
public long shardId;
public long price;
public String txId;
public String from;
public String to;
public long ctime;
}
private static final Xuper013HistoryRespDto obj = new Xuper013HistoryRespDto();
public static Xuper013HistoryRespDto getNew() {
try {
return (Xuper013HistoryRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper013HistoryRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 冻结发行成功资产,后续授予操作将被禁止
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper014FreezeAssetReqDto {
/**
* 资产id
*/
private Long assetId;
/**
* 助记词
*/
private String mnemonic;
private static final Xuper014FreezeAssetReqDto obj = new Xuper014FreezeAssetReqDto();
public static Xuper014FreezeAssetReqDto getNew() {
try {
return (Xuper014FreezeAssetReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper014FreezeAssetReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 冻结发行成功资产,后续授予操作将被禁止
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper014FreezeAssetRespDto {
public long requestId;
public int errNo;
public String errMsg;
private static final Xuper014FreezeAssetRespDto obj = new Xuper014FreezeAssetRespDto();
public static Xuper014FreezeAssetRespDto getNew() {
try {
return (Xuper014FreezeAssetRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper014FreezeAssetRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取商品存证信息
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class Xuper015GetEvidenceInfoReqDto {
long assetId;
private static final Xuper015GetEvidenceInfoReqDto obj = new Xuper015GetEvidenceInfoReqDto();
public static Xuper015GetEvidenceInfoReqDto getNew() {
try {
return (Xuper015GetEvidenceInfoReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper015GetEvidenceInfoReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取商品存证信息
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
public class Xuper015GetEvidenceInfoRespDto {
private static final Xuper015GetEvidenceInfoRespDto obj = new Xuper015GetEvidenceInfoRespDto();
public static Xuper015GetEvidenceInfoRespDto getNew() {
try {
return (Xuper015GetEvidenceInfoRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new Xuper015GetEvidenceInfoRespDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import com.liquidnet.commons.lang.util.JsonUtils;
import java.io.Serializable;
/**
* REDIRECT(-1),
* SUCCESS(0),
* FAIL(1),
* UNAUTH(2),
*/
public class XuperResponseDto<T> implements Serializable, Cloneable {
private static final long serialVersionUID = 8377276776600901982L;
private String code;
private String message;
private T data;
public boolean isSuccess() {
return this.code.equals("0");
}
private XuperResponseDto() {
}
private XuperResponseDto(String code) {
this.code = code;
}
private XuperResponseDto(String code, T data) {
this.code = code;
this.data = data;
}
private XuperResponseDto(String code, String message) {
this.code = code;
this.message = message;
}
private XuperResponseDto(String code, String message, T data) {
this.code = code;
this.message = message;
this.data = data;
}
public String getCode() {
return code;
}
public String getMessage() {
return message;
}
/**
* <p>Getter for the field <code>data</code>.</p>
*
* @return a T object.
*/
public T getData() {
return data;
}
public static <Object> XuperResponseDto<Object> success() {
return new XuperResponseDto<>("0");
}
public static <Object> XuperResponseDto<Object> success(Object data) {
return new XuperResponseDto<>("0", data);
}
public static <Object> XuperResponseDto<Object> failure() {
return new XuperResponseDto<>("1", "系统繁忙,请稍后再试");
}
public static <Object> XuperResponseDto<Object> failure(String message) {
return new XuperResponseDto<>("1", message);
}
public static <Object> XuperResponseDto<Object> failure(String code, String message) {
return new XuperResponseDto<>(code, message);
}
public static <Object> XuperResponseDto<Object> failure(String code, String message, Object data) {
return new XuperResponseDto<>(code, message, data);
}
public <T> T getParseData(Class<T> clazz) {
try {
if (getData() != null) {
return JsonUtils.fromJson(JsonUtils.toJson(getData()), clazz);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public String toJson() {
return JsonUtils.toJson(this);
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenReqDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class XuperUploadFileReqDto implements Serializable {
/**
* 助记词
*/
private String mnemonic;
private String fileName;
private String filePath;
private byte[] dataByte;
private String property;
private static final XuperUploadFileReqDto obj = new XuperUploadFileReqDto();
public static XuperUploadFileReqDto getNew() {
try {
return (XuperUploadFileReqDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new XuperUploadFileReqDto();
}
}
}
package com.liquidnet.common.third.xuper.dto;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 获取访问BOS临时STS凭证
* @class: Xuper001GetStokenRespDto
* @Package com.liquidnet.common.third.xuper.dto
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public class XuperUploadFileRespDto {
public String link;
public GetStokenResp resp;
public RequestRes res;
@Data
public static class GetStokenResp {
public long requestId;
public int errNo;
public String errMsg;
public AccessInfo accessInfo;
}
@Data
public static class AccessInfo {
public String bucket;
public String endPoint;
public String objectPath;
public String accessKeyId;
public String secreteAccessKey;
public String sessionToken;
public String createTime;
public String expiration;
}
@Data
public static class RequestRes {
public int httpCode;
public String reqUrl;
public String traceId;
public String body;
}
private static final XuperUploadFileRespDto obj = new XuperUploadFileRespDto();
public static XuperUploadFileRespDto getNew() {
try {
return (XuperUploadFileRespDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new XuperUploadFileRespDto();
}
}
}
package com.liquidnet.common.third.xuper.exception;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: Xupter
* @Package com.liquidnet.common.third.xuper.exception
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/15 16:05
*/
public class XupterException extends RuntimeException{
private static final long serialVersionUID = -3916918823313768482L;
private String code;
private String msg;
public XupterException(String code, String msg) {
super(msg);
this.code = code;
this.msg = msg;
}
public XupterException(String code, String msg, Throwable t) {
super(msg, t);
this.code = code;
this.msg = msg;
}
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
package com.liquidnet.common.third.xuper.util;
import com.baidu.xasset.auth.XchainAccount;
import com.baidu.xasset.client.base.BaseDef.*;
import com.baidu.xasset.client.xasset.Asset;
import com.baidu.xasset.client.xasset.XassetDef.*;
import com.baidu.xasset.common.config.Config.*;
import com.baidu.xuper.api.Account;
import java.util.logging.Logger;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestXuperChain
* @Package com.liquidnet.common.third.xuper.util
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 13:21
*/
public class TestXuperChain {
public static void main(String[] args) {
// 配置AK/SK
long appId = 0;
String ak = "12121212121212121";
String sk = "1212121212122";
XassetCliConfig cfg = new XassetCliConfig();
cfg.setCredentials(appId, ak, sk);
cfg.setEndPoint("http://120.48.16.137:8360");
// 创建区块链账户
Account acc = XchainAccount.newXchainEcdsaAccount(XchainAccount.mnemStrgthStrong, XchainAccount.mnemLangEN);
// 初始化接口类
Asset handle = new Asset(cfg, Logger.getGlobal());
// 调用方法
Resp<GetStokenResp> result = handle.getStoken(acc);
System.out.println(result);
}
}
# prod
host=https://sdk.zxinchain.com
# user learn
#host=https://testsdk.zxchain.net:9087
# test
#host=https://testsdk.zxchain.net:9086
#host=http://127.0.0.1:7082
connectTimeout=30000
connectionRequestTimeout=10000
socketTimeout=6000
#是否使用默认证书库(jdk)
isDefaultTrustStore=true
trustStore=/home/dev/access.keystore
trustStorePassword=123456
proxy=false
proxy.host=182.140.146.66
proxy.port=10081
xl.cert.path=/api/v1/spider/sdk/certificate
xl.ev.path=/api/v1/spider/evidence
xl.ev.query.path=/api/v1/spider/sdk/evidence
sdk.version=java-v2.0.0
\ No newline at end of file
# 新增转发请求接口路由
xl.al.manager.request.fun = /api/v1/spider/sdk/req/forward
# 新增文件转发接口路由
xl.al.manager.file.request.fun = /api/v1/spider/sdk/req/file/forward
......@@ -15,5 +15,6 @@
<module>liquidnet-common-third-shumei</module>
<module>liquidnet-common-third-zxlnft</module>
<module>liquidnet-common-third-antchain</module>
<module>liquidnet-common-third-xuper</module>
</modules>
</project>
......@@ -127,7 +127,7 @@ liquidnet:
galaxy:
url: http://devgalaxy.zhengzai.tv
temp-file-path: /data/galaxy/tempFilePath
router: zxinchain,eth
router: zxinchain,xuper
zxlnft:
walletSdkUrl: http://127.0.0.1:30505
nftApiUrl: https://nfttest2.zxinchain.com
......@@ -137,6 +137,13 @@ liquidnet:
nftPlatformPubKey: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUZrd0V3WUhLb1pJemowQ0FRWUlLb0VjejFVQmdpMERRZ0FFbFNTQk00MHJIZlJFa0NjWUxlRm1RZzE0SHlIcAp5Rk9uSktzblFqbDBCL2JXOStFWnZPblArNW0vMEdkUCtXM29yeG5Kd3p5OHNoYS9OYkQ4QVBmNXlBPT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==
nftPlatformPriKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR1RBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUJITTlWQVlJdEJIa3dkd0lCQVFRZ1VhbTVWM2V6ZFZJTmNoZ28KVDRKL28zMHArMGJCd3hQWUZFL01FdEU3MTZhZ0NnWUlLb0VjejFVQmdpMmhSQU5DQUFTVkpJRXpqU3NkOUVTUQpKeGd0NFdaQ0RYZ2ZJZW5JVTZja3F5ZENPWFFIOXRiMzRSbTg2Yy83bWIvUVowLzViZWl2R2NuRFBMeXlGcjgxCnNQd0E5L25JCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
platformIdentification: 4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef
xuper:
nftApiUrl: http://120.48.16.137:8360
appId: 110353
accessKeyID: 44b69914377ed77613824781da9e8653
secretAccessKey: 99b946f9dba244e7a3d5bc7a1862ef39
nftPlatformMnemonic: person lucky trophy wall kangaroo body bounce coach unable sister second goat guitar virus tree security acoustic ankle kiss deputy sunny message weapon believe
nftPlatformAddress: YqsYxgBSP74piDhNQHTjWMH9wXnXxZbt8
other:
ticketSystemUrl: http://dev-report.capapiao.com
appId: 11920532
......
......@@ -127,7 +127,7 @@ liquidnet:
galaxy:
# url: http://testgalaxy.zhengzai.tv
temp-file-path: /data/galaxy/tempFilePath
router: zxinchain,eth
router: zxinchain,xuper
zxlnft:
walletSdkUrl: http://127.0.0.1:30505
nftApiUrl: https://nfttest2.zxinchain.com
......@@ -137,6 +137,13 @@ liquidnet:
nftPlatformPubKey: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUZrd0V3WUhLb1pJemowQ0FRWUlLb0VjejFVQmdpMERRZ0FFbFNTQk00MHJIZlJFa0NjWUxlRm1RZzE0SHlIcAp5Rk9uSktzblFqbDBCL2JXOStFWnZPblArNW0vMEdkUCtXM29yeG5Kd3p5OHNoYS9OYkQ4QVBmNXlBPT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==
nftPlatformPriKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR1RBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUJITTlWQVlJdEJIa3dkd0lCQVFRZ1VhbTVWM2V6ZFZJTmNoZ28KVDRKL28zMHArMGJCd3hQWUZFL01FdEU3MTZhZ0NnWUlLb0VjejFVQmdpMmhSQU5DQUFTVkpJRXpqU3NkOUVTUQpKeGd0NFdaQ0RYZ2ZJZW5JVTZja3F5ZENPWFFIOXRiMzRSbTg2Yy83bWIvUVowLzViZWl2R2NuRFBMeXlGcjgxCnNQd0E5L25JCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
platformIdentification: 4e40d5f6f65aa8ec9bc33ab424e0167e68783bbe95d4d265086314d749808eef
xuper:
nftApiUrl: http://120.48.16.137:8360
appId: 110353
accessKeyID: 44b69914377ed77613824781da9e8653
secretAccessKey: 99b946f9dba244e7a3d5bc7a1862ef39
nftPlatformMnemonic: person lucky trophy wall kangaroo body bounce coach unable sister second goat guitar virus tree security acoustic ankle kiss deputy sunny message weapon believe
nftPlatformAddress: YqsYxgBSP74piDhNQHTjWMH9wXnXxZbt8
other:
ticketSystemUrl: http://dev-report.capapiao.com/
appId: 11920532
......
......@@ -10,7 +10,7 @@ liquidnet:
path: /data/logs
name: service-goblin
max-history: 7
level: debug
level: info
mysql:
database-name: dev_ln_scene
mongodb:
......
......@@ -3,7 +3,7 @@
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinNftOrderMapper">
<select id="searchList" resultType="com.liquidnet.service.goblin.dto.admin.GoblinNftOrderListDto">
select c.trading_at, c.nft_id, a.* from (select
select c.trading_at, c.trading_txhash as nft_id, a.* from (select
user_id,order_code,order_id,order_type,pay_type,price_actual,
status,pay_time,created_at,sku_title as name, mid, ex_code, box_sku_id
from goblin_nft_order
......@@ -48,7 +48,7 @@
left join goblin_user_digital_artwork as c on c.order_id = a.order_id and c.del_flg = '0'
<where>
<if test="nftId!=''">
and c.nft_id = #{nftId}
and c.trading_txhash = #{nftId}
</if>
</where>
-- group by a.order_id
......
......@@ -7,7 +7,7 @@
d.refund_code,d.price,d.status,d.refund_at,d.error_reason,d.created_at,
a.user_id,a.order_code,a.order_type,a.pay_type,a.pay_time,a.created_at as order_created_at,
b.name,
c.trading_at, c.nft_id
c.trading_at, c.trading_txhash as nft_id
from goblin_nft_order_refund as d
left join goblin_nft_order as a on a.order_id = d.order_id
left join goblin_goods_sku as b on b.sku_id = a.sku_id
......@@ -26,7 +26,7 @@
and a.order_code = #{orderCode}
</if>
<if test="nftId!=''">
and c.nft_id = #{nftId}
and c.trading_txhash = #{nftId}
</if>
<if test="orderType != null and orderType!=''">
and a.order_type = #{orderType}
......
package com.liquidnet.service.consumer.nft.service.processor;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyRespDto;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperTradeCommonBiz;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinTradeCommonBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,12 +25,21 @@ public class ConsumerGalaxyJsonNftPublishAndBuyProcessor {
@Autowired
private ZxinTradeCommonBiz zxinTradeCommonBiz;
@Autowired
private XuperTradeCommonBiz xuperTradeCommonBiz;
/**
* 执行购买处理
* @param reqDto
* @return
*/
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
return zxinTradeCommonBiz.nftPublishAndBuy(reqDto);
if(reqDto.getRouterType().equalsIgnoreCase(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode())){
return zxinTradeCommonBiz.nftPublishAndBuy(reqDto);
}else if(reqDto.getRouterType().equalsIgnoreCase(GalaxyEnum.RouterTypeEnum.XUPER.getCode())){
return xuperTradeCommonBiz.nftPublishAndBuy(reqDto);
}else{
log.error("nftPublishAndBuy 区块链路由类型不存在 routerType : {}",reqDto.getRouterType());
return ResponseDto.failure();
}
}
}
package com.liquidnet.service.consumer.nft.service.processor;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperUserCommonBiz;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserCommonBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,12 +25,22 @@ public class ConsumerGalaxyJsonNftUserRegisterProcessor {
@Autowired
private ZxinUserCommonBiz zxinUserCommonBiz;
@Autowired
private XuperUserCommonBiz xuperUserCommonBiz;
/**
* 执行用户注册
* @param reqDto
* @return
*/
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserCommonBiz.userRegister(reqDto);
if(reqDto.getRouterType().equalsIgnoreCase(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode())){
return zxinUserCommonBiz.userRegister(reqDto);
}else if(reqDto.getRouterType().equalsIgnoreCase(GalaxyEnum.RouterTypeEnum.XUPER.getCode())){
return xuperUserCommonBiz.userRegister(reqDto);
}else{
log.error("userRegister 区块链路由类型不存在 routerType : {}",reqDto.getRouterType());
return ResponseDto.failure();
}
}
}
......@@ -41,5 +41,17 @@
<artifactId>liquidnet-service-adam-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-third-xuper</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
package com.liquidnet.service.galaxy.biz;
import com.liquidnet.common.third.antchain.constant.AntchainEnum;
import com.liquidnet.common.third.xuper.constant.XuperEnum;
import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
......@@ -16,7 +17,7 @@ import com.liquidnet.service.galaxy.constant.GalaxyEnum;
public class GalaxyEnumBiz {
/**
* 任务状态转换
* 任务状态转换(至信链通用状态 百度链为系列声明状态转换)
* @param routerType
* @param code
* @return
......@@ -46,6 +47,45 @@ public class GalaxyEnumBiz {
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_FAIL;
break;
}
case "xuper":
if(code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.INIT.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_SUCCESS;
break;
}{
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_FAIL;
break;
}
}
return taskStatusEnum;
}
/**
* 任务状态转换
* @param routerType
* @param code
* @return
*/
public static GalaxyEnum.AssetPublishStatusEnum getAssetPublishStatusEnum(String routerType, String code){
GalaxyEnum.AssetPublishStatusEnum taskStatusEnum = null;
switch (routerType){
case "xuper":
if(code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.INIT.getCode())){
taskStatusEnum = GalaxyEnum.AssetPublishStatusEnum.INIT;
break;
}else if(code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.PUBLISHING.getCode())){
taskStatusEnum = GalaxyEnum.AssetPublishStatusEnum.PROCESSING;
break;
}else if(code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.PUBLISH_SUCCESS.getCode())){
taskStatusEnum = GalaxyEnum.AssetPublishStatusEnum.SUCCESS;
break;
}else if(code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.FREEZING.getCode())
||code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.BANNEDING.getCode())
||code.equalsIgnoreCase(XuperEnum.AssetPublishStatusEnum.BANNEDED.getCode())
){
taskStatusEnum = GalaxyEnum.AssetPublishStatusEnum.FAIL;
break;
}
}
return taskStatusEnum;
}
......@@ -90,4 +130,53 @@ public class GalaxyEnumBiz {
}
return userBindStatusEnum;
}
}
/**
* 资产授予状态转换
* @param routerType
* @param code
* @return
*/
public static GalaxyEnum.TaskStatusEnum getGrantStatusEnum(String routerType, String code){
GalaxyEnum.TaskStatusEnum taskStatusEnum = null;
switch (routerType){
case "zxinchain":
if(code.equalsIgnoreCase(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.PROCESSING;
break;
}else if(code.equalsIgnoreCase(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_SUCCESS;
break;
}else if(code.equalsIgnoreCase(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_FAIL;
break;
}
case "antchain":
if(code.equalsIgnoreCase(AntchainEnum.TaskStatusEnum.PROCESSING.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.PROCESSING;
break;
}else if(code.equalsIgnoreCase(AntchainEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_SUCCESS;
break;
}else if(code.equalsIgnoreCase(AntchainEnum.TaskStatusEnum.TASK_FAIL.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_FAIL;
break;
}
case "xuper":
if(code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.GRANTING.getCode())||code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.TRANSFERING.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.PROCESSING;
break;
}else if(code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.GRANT_SUCCESS.getCode())){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_SUCCESS;
break;
}else if(code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.CANCELING.getCode())
||code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.CANCELED.getCode())
||code.equalsIgnoreCase(XuperEnum.AssetGrantStatusEnum.OTHER_ERROR.getCode())
){
taskStatusEnum = GalaxyEnum.TaskStatusEnum.TASK_FAIL;
break;
}
}
return taskStatusEnum;
}
}
\ No newline at end of file
package com.liquidnet.service.galaxy.router.xuper.biz;
import com.baidu.xuper.api.Account;
import com.liquidnet.common.third.xuper.dto.Xuper000CreateAccountReqDto;
import com.liquidnet.common.third.xuper.dto.Xuper000CreateAccountRespDto;
import com.liquidnet.common.third.xuper.dto.XuperResponseDto;
import com.liquidnet.common.third.xuper.exception.XupterException;
import com.liquidnet.common.third.xuper.util.XuperSdkUtil;
import com.liquidnet.common.third.zxlnft.constant.ZxlErrorEnum;
import com.liquidnet.commons.lang.util.BASE64Util;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.exception.GalaxyNftUserException;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ZxinUserCommonBiz
* @Package com.liquidnet.service.galaxy.router.zxin.biz
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/6/27 13:08
*/
@Slf4j
@Component
public class XuperUserCommonBiz {
@Autowired
private XuperSdkUtil xuperSdkUtil;
@Autowired
private GalaxyDataUtils dataUtils;
@Value("${liquidnet.service.adam.url}")
private String adamUrl;
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
long startTime = System.currentTimeMillis();
String userId = reqDto.getUserId();
String userName = reqDto.getUserName();
String mobile = reqDto.getMobile();
String idCardType = reqDto.getIdCardType();
String idCard = reqDto.getIdCard();
String mnemonic = null;
Long index = 0L;
String userIdentification = null;
String address = null;
String userPubKey = null;
String userPriKey = null;
//业务失败信息
String bizFailDesc = null;
//系统失败信息
String sysFailDesc = null;
//是否实名认证成功
boolean isRealNameAuthSuccess = true;
//是否绑定区块链地址
boolean isBindBlockAddressSuccess = false;
GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
//用户信息
GalaxyUserInfoBo userInfoBo = null;
try{
/**
* todo 把助记词进行redis存储 key=userID mnemonic/index/userIdentification/address
*/
userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),userId);
if(userInfoBo!=null){
mnemonic = userInfoBo.getMnemonic();
}else{
Xuper000CreateAccountReqDto xuper000CreateAccountReqDto = Xuper000CreateAccountReqDto.getNew();
// 创建区块链账户
Xuper000CreateAccountRespDto xuper000CreateAccountRespDto = null;
try {
XuperResponseDto<Xuper000CreateAccountRespDto> xuperResponseDto = xuperSdkUtil.xuper000CreateAccount(xuper000CreateAccountReqDto);
if(xuperResponseDto.isSuccess()){
xuper000CreateAccountRespDto = xuperResponseDto.getParseData(Xuper000CreateAccountRespDto.class);
}
}catch (XupterException e) {
log.error("biz error msg "+e.getMessage(),e);
}catch (Exception e) {
log.error("sys error msg "+e.getMessage(),e);
}
log.info("testXuper000CreateAccount resp : "+ JsonUtils.toJson(xuper000CreateAccountRespDto));
mnemonic = xuper000CreateAccountRespDto.getMnemonic();
}
if(StringUtil.isNotEmpty(mnemonic)){
Account account = xuperSdkUtil.getAccount(mnemonic);
userPubKey = BASE64Util.encoded(account.getKeyPair().getJSONPublicKey());
userPriKey = BASE64Util.encoded(account.getKeyPair().getJSONPrivateKey());
userIdentification = account.getAddress();
address = account.getAddress();
}
if(StringUtil.isNull(userInfoBo)){
//初始化用户信息
try{
//构造缓存数据
userInfoBo = GalaxyUserInfoBo.getNew();
userInfoBo.setUserId(userId);
userInfoBo.setUserName(userName);
userInfoBo.setMobile(mobile);
userInfoBo.setIdCardType(idCardType);
userInfoBo.setIdCard(idCard);
userInfoBo.setMnemonic(mnemonic);
userInfoBo.setIndex(index.toString());
userInfoBo.setUserIdentification(userIdentification);
userInfoBo.setUserPubKey(userPubKey);
userInfoBo.setUserPriKey(userPriKey);
userInfoBo.setRouterType(reqDto.getRouterType());
userInfoBo.setBlockChainAddress(address);
dataUtils.setGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId(),userInfoBo);
}catch(Exception e){
log.error("xuper设置用户信息异常 msg:{}",e.getMessage(),e);
throw new XupterException(ZxlErrorEnum.FAILURE.getCode(),"xuper设置用户信息异常");
}
}
}catch (GalaxyNftUserException e) {
bizFailDesc = e.getMessage();
log.info(e.getMessage());
}catch(XupterException e){
sysFailDesc = e.getMessage();
log.error(e.getMessage(),e);
}catch(Exception e){
sysFailDesc = e.getMessage();
log.error(e.getMessage(),e);
}
//如果实名认证成功-更新数据库
if(isRealNameAuthSuccess){
if(StringUtil.isNotNull(userInfoBo)&&StringUtil.isNotEmpty(userInfoBo.getBlockChainAddress())){
//构造返回参数
respDto.setUserId(userId);
respDto.setBlockChainType(GalaxyEnum.RouterTypeEnum.XUPER.getCode());
respDto.setBlockChainAddress(userInfoBo.getBlockChainAddress());
}
}
long endTime = System.currentTimeMillis();
log.info("开通数字账户userRegister总耗时:{} ",endTime-startTime);
if(StringUtil.isNotEmpty(sysFailDesc)){
return ResponseDto.failure(sysFailDesc);
}
if(StringUtil.isNotEmpty(bizFailDesc)){
return ResponseDto.failure(bizFailDesc);
}
return ResponseDto.success(respDto);
}
}
......@@ -3,6 +3,7 @@ package com.liquidnet.service.galaxy.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz;
......@@ -117,9 +118,9 @@ public abstract class AbstractDataUtils {
try{
this.getQueueUtil().sendMySqlRedis(
SqlMapping.get("galaxy_series_info.insert"),
new Object[]{seriesInfoBo.getSeriesInfoId(),seriesInfoBo.getSeriesName(),seriesCode,null,seriesInfoBo.getTotalCount()
new Object[]{seriesInfoBo.getSeriesInfoId(),seriesInfoBo.getSeriesName(),seriesCode,seriesInfoBo.getSeriesId(),seriesInfoBo.getTotalCount()
,seriesInfoBo.getCrtCount(),seriesInfoBo.getSeriesClaimTaskId(),seriesInfoBo.getSeriesClaimStatus(),seriesInfoBo.getCoverUrl(),seriesInfoBo.getSeriesDesc()
,nftCount,seriesInfoBo.getRouterType(),LocalDateTime.now(),null
,nftCount,seriesInfoBo.getTradeHash(),seriesInfoBo.getRouterType(),LocalDateTime.now(),null
}
, MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
);
......@@ -238,6 +239,33 @@ public abstract class AbstractDataUtils {
}
}
/**
* 更新系列nft发行状态
* @param routerType
* @param skuId
* @param seriesNftInfoBo
*/
public void updateSeriesNftPublishStatus(String routerType,String skuId, GalaxySeriesNftInfoBo seriesNftInfoBo) {
//更新系列nft状态
this.getRedisUtil().set(GalaxyConstant.REDIS_KEY_GALAXY_SERIES_NFT.concat(routerType).concat(":") + skuId,seriesNftInfoBo);
String nowTimeStr = DateUtil.Formatter.yyyyMMddHHmmss.format(seriesNftInfoBo.getUpdatedAt());
if(StringUtil.isEmpty(seriesNftInfoBo.getNftPublishStatus())){
seriesNftInfoBo.setNftPublishStatus(GalaxyEnum.AssetPublishStatusEnum.INIT.getCode());
}
try{
this.getQueueUtil().sendMySqlRedis(
SqlMapping.get("galaxy_series_nft_info.updateSeriesNftPublishStatus"),
new Object[]{seriesNftInfoBo.getNftPublishStatus(),seriesNftInfoBo.getNftPublishTradeHash(),nowTimeStr,seriesNftInfoBo.getSkuId()}
, MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
);
}catch(Exception e){
log.error(e.getMessage(),e);
log.error("#updateSeriesNftStatus error ==> MESSAGE:{}",e.getMessage());
}
}
//根据系列Id获取 一个系列对应多个skuId
// public List<String> getSkuIdListBySeriesCode(String seriesCode){
// //根据演出id获取用户信息 只查询5条
......
# ------------------------用户注册信息----------------------------
galaxy_user_info.insert=insert into galaxy_user_info (user_id, user_name, user_type, mobile, id_card_type, id_card, mnemonic, mnemonic_index,user_identification, user_pub_key, user_pri_key, block_chain_address, router_type,created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品系列信息----------------------------
galaxy_series_info.insert=insert into galaxy_series_info (series_info_id, series_name, series_code, series_id, total_count, crt_count,series_claim_task_id, series_claim_status, cover_url, series_desc, nft_count,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
galaxy_series_info.insert=insert into galaxy_series_info (series_info_id, series_name, series_code, series_id, total_count, crt_count,series_claim_task_id, series_claim_status, cover_url, series_desc, nft_count,trade_hash,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品系列NFT信息----------------------------
galaxy_series_nft_info.insert=insert into galaxy_series_nft_info (series_nft_info_id, series_info_id, sku_id, series_name, series_code,series_id, nft_total_count, nft_crt_count, nft_id_begin ,nft_id_begin_index ,nft_publish_number,original_nft_url, original_display_url,author, nft_name, nft_url, display_url, nft_desc, nft_flag, sell_count, nft_hash,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------数字藏品订单信息----------------------------
......@@ -27,6 +27,7 @@ galaxy_series_info.updateSeriesCrtCount=update galaxy_series_info t set t.crt_co
galaxy_series_nft_info.updateSeriesNftCrtCount=update galaxy_series_nft_info t set t.nft_crt_count = ?,t.updated_at =? where t.sku_id = ?
# ------------------------更新发行购买处理结果----------------------------
galaxy_nft_order_fail_log.updateDealWithStatus=update galaxy_nft_order_fail_log t set t.deal_with_status = ?,t.updated_at =? where t.nft_order_pay_id = ? and t.router_type = ?
# ------------------------更新系列NFT发行状态信息----------------------------
galaxy_series_nft_info.updateSeriesNftPublishStatus=update galaxy_series_nft_info t set t.publish_status = ?,t.publish_trade_hash = ?,t.updated_at =? where t.sku_id = ?
# ------------------------同步用户数字账户信息到adam---------------------------
adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
alter table galaxy_series_nft_info
add publish_status varchar(10) null comment 'nft发行状态(-1初始化 0发行中 1发行成功 2发行失败)' after router_type;
alter table galaxy_series_nft_info
add publish_trade_hash varchar(200) null comment 'nft发行交易hash' after publish_status;
alter table galaxy_series_info modify series_name varchar(30) not null comment '本地系列唯一名称(前缀+skuid)';
alter table galaxy_series_nft_info modify series_name varchar(30) not null comment '本地系列唯一名称(前缀+skuid)';
alter table galaxy_nft_order_fail_log modify series_name varchar(30) not null comment '系列的唯一名称';
alter table galaxy_nft_order_info modify series_name varchar(30) not null comment '系列的唯一名称(前缀+skuid)';
alter table galaxy_nft_trade_info modify series_name varchar(30) not null comment '系列的唯一名称';
package com.liquidnet.service.galaxy;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
public class MybatisPlusCodeGenerator {
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.adam 全限定类名
* @param tableNames 表名
*/
public static void doGenerator(String moduleRootPath,
DataSourceConfig dsc,
String parentName,
String[] tableNames) {
AutoGenerator mpg = new AutoGenerator();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(moduleRootPath + "/src/main/java");
gc.setAuthor("liquidnet");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(parentName);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return moduleRootPath + "/src/main/resources/com/liquidnet/service/galaxy/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(tableNames);
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
public static void main(String[] args) {
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl("jdbc:mysql://39.107.71.112:3308/dev_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST");
dsc.setUsername("root");
dsc.setPassword("Zhengzai@rd2U#");
String resourcePath = "/Users/anjiabin/Downloads/tmp";
String directory = "com.liquidnet.service.galaxy";
String[] dbTableArray = new String[]{"galaxy_user_info", "galaxy_series_info", "galaxy_series_nft_info","galaxy_nft_order_info", "galaxy_nft_trade_info","galaxy_nft_order_fail_log"};
doGenerator(resourcePath, dsc, directory, dbTableArray);
}
}
package com.liquidnet.service.galaxy.biz;
import com.liquidnet.commons.lang.util.CollectionUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
import java.util.HashMap;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
......@@ -66,4 +68,74 @@ public class GalaxyCommonBiz {
return null;
}
}
/*读取文件的字节数组*/
public static byte[] toByteArray(File file) throws IOException {
File f = file;
if (!f.exists()) {
throw new FileNotFoundException("file not exists");
}
ByteArrayOutputStream bos = new ByteArrayOutputStream((int) f.length());
BufferedInputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(f));
int buf_size = 1024;
byte[] buffer = new byte[buf_size];
int len = 0;
while (-1 != (len = in.read(buffer, 0, buf_size))) {
bos.write(buffer, 0, len);
}
return bos.toByteArray();
} catch (IOException e) {
e.printStackTrace();
throw e;
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
bos.close();
}
}
public static HashMap<String,Integer> getImageWidthAndHeight(String imgLocalFilePath){
HashMap rsHashMap = CollectionUtil.mapStringInteger();
// String imgLocalFilePath = "/Users/anjiabin/Downloads/zxl_image_test_001.jpg";
BufferedImage bufferedImage = null;
try {
bufferedImage = ImageIO.read(new FileInputStream(imgLocalFilePath));
} catch (IOException e) {
e.printStackTrace();
log.error("xuper getImageWidthAndHeight error:"+e.getMessage(),e);
}
int height = bufferedImage.getHeight();
int width = bufferedImage.getWidth();
rsHashMap.put("width",width);
rsHashMap.put("height",height);
log.info("getImageWidthAndHeight width=={} height=={}",width,height);
return rsHashMap;
}
public static boolean isImageType(String imageUrl){
// ”jpg”, “jpeg”, “png”, “bmp”, “webp”, “heic”
String[] imageArray = {"jpg","jpeg","png","bmp","webp","hejc"};
String imageType = null;
if(imageUrl.lastIndexOf("?")!=-1){
String tempUrl = imageUrl.substring(0,imageUrl.lastIndexOf("?"));
imageType = tempUrl.substring(tempUrl.lastIndexOf(".")+1,tempUrl.length());
}else{
imageType = imageUrl.substring(imageUrl.lastIndexOf(".")+1,imageUrl.length());
}
System.out.println("imageType====="+imageType);
if(Arrays.asList(imageArray).contains(imageType.toLowerCase())){
return true;
}
return false;
}
}
package com.liquidnet.service.galaxy.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto;
import com.liquidnet.service.galaxy.service.IGalaxyPublishService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: GalaxyPublishController
* @Package com.liquidnet.service.galaxy.controller
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 12:11
*/
@Api(tags = "NFT发行相关")
@RestController
@RequestMapping("nftPublish")
@Validated
@Slf4j
public class GalaxyPublishController {
@Resource(name = "galaxyPublishServiceImpl")
private IGalaxyPublishService galaxyPublishService;
@ControllerLog(description = "NFT发行")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT发行")
@PostMapping(value = {"nftPublish"})
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(@Valid @RequestBody GalaxyNftPublishReqDto reqDto){
return galaxyPublishService.nftPublish(reqDto);
}
@ControllerLog(description = "NFT发行结果查询")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "NFT发行结果查询")
@PostMapping(value = {"nftPublishResultQuery"})
public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(@Valid @RequestBody GalaxyNftPublishResultQueryReqDto reqDto) {
return galaxyPublishService.nftPublishResultQuery(reqDto);
}
}
//package com.liquidnet.service.galaxy.controller;
//
//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
//import com.liquidnet.service.base.ResponseDto;
//import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
//import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
//import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
//import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto;
//import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto;
//import com.liquidnet.service.galaxy.service.IGalaxyPublishService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import javax.validation.Valid;
//
///**
// * @author AnJiabin <anjiabin@zhengzai.tv>
// * @version V1.0
// * @Description: TODO
// * @class: GalaxyPublishController
// * @Package com.liquidnet.service.galaxy.controller
// * @Copyright: LightNet @ Copyright (c) 2021
// * @date 2022/3/15 12:11
// */
//@Api(tags = "NFT发行相关")
//@RestController
//@RequestMapping("nftPublish")
//@Validated
//@Slf4j
//public class GalaxyPublishController {
// @Resource(name = "galaxyPublishServiceImpl")
// private IGalaxyPublishService galaxyPublishService;
//
// @ControllerLog(description = "NFT发行")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT发行")
// @PostMapping(value = {"nftPublish"})
// public ResponseDto<GalaxyNftPublishRespDto> nftPublish(@Valid @RequestBody GalaxyNftPublishReqDto reqDto){
// return galaxyPublishService.nftPublish(reqDto);
// }
//
// @ControllerLog(description = "NFT发行结果查询")
// @ApiOperationSupport(order = 3)
// @ApiOperation(value = "NFT发行结果查询")
// @PostMapping(value = {"nftPublishResultQuery"})
// public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(@Valid @RequestBody GalaxyNftPublishResultQueryReqDto reqDto) {
// return galaxyPublishService.nftPublishResultQuery(reqDto);
// }
//}
package com.liquidnet.service.galaxy.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
import com.liquidnet.service.galaxy.dto.param.*;
......@@ -17,8 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
......@@ -38,21 +35,21 @@ public class GalaxyTradeController {
@Resource(name = "galaxyTradeServiceImpl")
private IGalaxyTradeService galaxyTradeService;
@ControllerLog(description = "NFT购买")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT购买")
@PostMapping(value = {"nftBuy"})
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(@Valid @RequestBody GalaxyNftBuyReqDto reqDto){
return galaxyTradeService.nftBuy(reqDto);
}
@ControllerLog(description = "NFT购买结果查询")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT购买结果查询")
@PostMapping(value = {"nftBuyResultQuery"})
public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(@Valid @RequestBody GalaxyNftBuyResultQueryReqDto reqDto){
return galaxyTradeService.nftBuyResultQuery(reqDto);
}
// @ControllerLog(description = "NFT购买")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT购买")
// @PostMapping(value = {"nftBuy"})
// public ResponseDto<GalaxyNftBuyRespDto> nftBuy(@Valid @RequestBody GalaxyNftBuyReqDto reqDto){
// return galaxyTradeService.nftBuy(reqDto);
// }
//
// @ControllerLog(description = "NFT购买结果查询")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT购买结果查询")
// @PostMapping(value = {"nftBuyResultQuery"})
// public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(@Valid @RequestBody GalaxyNftBuyResultQueryReqDto reqDto){
// return galaxyTradeService.nftBuyResultQuery(reqDto);
// }
@ControllerLog(description = "NFT购买(发行+购买)")
@ApiOperationSupport(order = 1)
......@@ -75,30 +72,30 @@ public class GalaxyTradeController {
return galaxyTradeService.nftPublishAndBuyResultQuery(reqDto);
}
@ControllerLog(description = "NFT发行购买结果批量查询")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT发行购买结果批量查询")
@PostMapping(value = {"nftPublishAndBuyResultBatchQuery"})
public ResponseDto<GalaxyNftPublishAndBuyResultBatchQueryRespDto> nftPublishAndBuyResultBatchQuery(@Valid @RequestBody GalaxyNftPublishAndBuyResultBatchQueryReqDto reqDto){
//定义返回结果
List<GalaxyNftPublishAndBuyResultQueryRespDto> routerBuyInfoList = new ArrayList<>();
//获取请求信息
List<GalaxyNftPublishAndBuyResultBatchQueryReqDto.RouterOrderInfo> routerOrderInfoList = reqDto.getRouterOrderInfoList();
routerOrderInfoList.forEach(routerOrderInfo -> {
GalaxyNftPublishAndBuyRouterBatchQueryReqDto batchQueryReqDto = GalaxyNftPublishAndBuyRouterBatchQueryReqDto.getNew();
batchQueryReqDto.setUserId(routerOrderInfo.getUserId());
batchQueryReqDto.setRouterType(routerOrderInfo.getRouterType());
batchQueryReqDto.setNftOrderPayIdList(routerOrderInfo.getNftOrderPayIdList());
//进行批量查询
ResponseDto<GalaxyNftPublishAndBuyRouterBatchQueryRespDto> responseDtoTemp = galaxyTradeService.nftPublishAndBuyResultBatchQuery(batchQueryReqDto);
if(StringUtil.isNotNull(responseDtoTemp)&&responseDtoTemp.isSuccess()){
routerBuyInfoList.addAll(responseDtoTemp.getData().getBuyInfoList());
}
});
GalaxyNftPublishAndBuyResultBatchQueryRespDto respDto = GalaxyNftPublishAndBuyResultBatchQueryRespDto.getNew();
respDto.setRouterBuyInfoList(routerBuyInfoList);
return ResponseDto.success(respDto);
}
// @ControllerLog(description = "NFT发行购买结果批量查询")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT发行购买结果批量查询")
// @PostMapping(value = {"nftPublishAndBuyResultBatchQuery"})
// public ResponseDto<GalaxyNftPublishAndBuyResultBatchQueryRespDto> nftPublishAndBuyResultBatchQuery(@Valid @RequestBody GalaxyNftPublishAndBuyResultBatchQueryReqDto reqDto){
// //定义返回结果
// List<GalaxyNftPublishAndBuyResultQueryRespDto> routerBuyInfoList = new ArrayList<>();
// //获取请求信息
// List<GalaxyNftPublishAndBuyResultBatchQueryReqDto.RouterOrderInfo> routerOrderInfoList = reqDto.getRouterOrderInfoList();
// routerOrderInfoList.forEach(routerOrderInfo -> {
// GalaxyNftPublishAndBuyRouterBatchQueryReqDto batchQueryReqDto = GalaxyNftPublishAndBuyRouterBatchQueryReqDto.getNew();
// batchQueryReqDto.setUserId(routerOrderInfo.getUserId());
// batchQueryReqDto.setRouterType(routerOrderInfo.getRouterType());
// batchQueryReqDto.setNftOrderPayIdList(routerOrderInfo.getNftOrderPayIdList());
// //进行批量查询
// ResponseDto<GalaxyNftPublishAndBuyRouterBatchQueryRespDto> responseDtoTemp = galaxyTradeService.nftPublishAndBuyResultBatchQuery(batchQueryReqDto);
// if(StringUtil.isNotNull(responseDtoTemp)&&responseDtoTemp.isSuccess()){
// routerBuyInfoList.addAll(responseDtoTemp.getData().getBuyInfoList());
// }
// });
// GalaxyNftPublishAndBuyResultBatchQueryRespDto respDto = GalaxyNftPublishAndBuyResultBatchQueryRespDto.getNew();
// respDto.setRouterBuyInfoList(routerBuyInfoList);
// return ResponseDto.success(respDto);
// }
// @ControllerLog(description = "NFT购买支付结果查询")
// @ApiOperationSupport(order = 1)
......
package com.liquidnet.service.galaxy.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.adam.constant.AdamEnum;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperUserCommonBiz;
import com.liquidnet.service.galaxy.service.IGalaxyUserService;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import io.swagger.annotations.Api;
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.RequestBody;
......@@ -19,6 +30,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.LinkedList;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
......@@ -38,6 +51,12 @@ public class GalaxyUserController {
@Resource(name = "galaxyUserServiceImpl")
private IGalaxyUserService galaxyUserService;
@Autowired
private XuperUserCommonBiz xuperUserCommonBiz;
@Autowired
private GalaxyDataUtils dataUtils;
@ControllerLog(description = "NFT用户注册")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT用户注册")
......@@ -53,4 +72,36 @@ public class GalaxyUserController {
public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(@Valid @RequestBody GalaxyUserBindStatusQueryReqDto reqDto) {
return galaxyUserService.userBindStatusQuery(reqDto);
}
@ControllerLog(description = "NFT百度用户同步")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "NFT百度用户同步")
@PostMapping(value = {"xuperUserSync"})
public ResponseDto<String> xuperUserSync(@Valid @RequestBody GalaxyUserRegisterReqDto reqDto) {
//判断百度链用户是否已经存在
GalaxyUserInfoBo xuperUserInfoBo = dataUtils.getGalaxyUserInfo(GalaxyEnum.RouterTypeEnum.XUPER.getCode(), reqDto.getUserId());
if(StringUtil.isNotNull(xuperUserInfoBo)&&StringUtil.isNotEmpty(xuperUserInfoBo.getBlockChainAddress())){
log.error("NFT百度用户同步 error 该用户百度链用户已经开通成功无需再次开通 reqParam:{}", JsonUtils.toJson(reqDto));
return ResponseDto.success("已开通成功");
}
//获取至信链用户开通信息
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode(), reqDto.getUserId());
if(StringUtil.isNotNull(userInfoBo)&&StringUtil.isNotEmpty(userInfoBo.getBlockChainAddress())){
reqDto.setRouterType(GalaxyEnum.RouterTypeEnum.XUPER.getCode());
ResponseDto<GalaxyUserRegisterRespDto> responseDto = xuperUserCommonBiz.userRegister(reqDto);
if(responseDto.isSuccess()){
//同步业务账号关联关系到adam
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqlsDataA.add(new Object[]{
reqDto.getUserId(), AdamEnum.BizAcct.NFT_XUPER.name(), responseDto.getData().getBlockChainAddress(), null, null, 1, LocalDateTime.now()
});
dataUtils.getQueueUtil().sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("adam_user_busi_acct.add",sqlsDataA)
);
return ResponseDto.success("开通成功");
};
}
log.error("NFT百度用户同步 error 该用户至信链数字账户未开通 reqParam:{}", JsonUtils.toJson(reqDto));
return ResponseDto.failure("开通失败");
}
}
package com.liquidnet.service.galaxy.router.xuper.biz;
import com.liquidnet.common.third.xuper.config.XuperConfig;
import com.liquidnet.common.third.xuper.util.XuperSdkUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import com.liquidnet.service.galaxy.utils.QueueUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: XuperTradeBiz
* @Package com.liquidnet.service.galaxy.router.xuper.biz
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:11
*/
@Slf4j
@Component
public class XuperTradeBiz {
@Autowired
private XuperSdkUtil xuperSdkUtil;
@Autowired
private XuperConfig xuperConfig;
@Autowired
private GalaxyDataUtils dataUtils;
@Autowired
private GalaxyBeanTransferBiz galaxyBeanTransferBiz;
@Autowired
private XuperTradeCommonBiz xuperTradeCommonBiz;
@Autowired
private QueueUtil queueUtil;
@Autowired
private XuperPublishBiz xuperPublishBiz;
/**
* 发行和购买
* @param reqDto
* @return
*/
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
return xuperTradeCommonBiz.nftPublishAndBuy(reqDto);
}
/**
* NFT发行和购买
* @param reqDto
* @return
*/
public ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftPublishAndBuyResultQuery(GalaxyNftPublishAndBuyResultQueryReqDto reqDto) {
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getCode(), GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getMessage());
}
/**
* TODO 如果订单信息是购买失败,则直接调用至信链查询购买结果
*/
//是否需要发起二次购买
boolean isNeedSecondBuy = false;
if(StringUtil.isNotEmpty(nftOrderBo.getNftPublishStatus())
&& (GalaxyEnum.TaskStatusEnum.INIT.getCode().equalsIgnoreCase(nftOrderBo.getNftPublishStatus())
||GalaxyEnum.TaskStatusEnum.PROCESSING.getCode().equalsIgnoreCase(nftOrderBo.getNftPublishStatus()))){
//判断是否需要二次购买
if(StringUtil.isEmpty(nftOrderBo.getNftPublishTaskId())){
isNeedSecondBuy = true;
}
//执行nft发行结果查询
GalaxyNftPublishResultQueryReqDto nftPublishResultQueryReqDto = GalaxyNftPublishResultQueryReqDto.getNew();
nftPublishResultQueryReqDto.setNftOrderPayId(reqDto.getNftOrderPayId());
nftPublishResultQueryReqDto.setRouterType(reqDto.getRouterType());
ResponseDto<GalaxyNftPublishResultQueryRespDto> publishResultQueryRespDto = xuperPublishBiz.nftPublishResultQuery(nftPublishResultQueryReqDto);
if(publishResultQueryRespDto.isSuccess()){
GalaxyNftPublishResultQueryRespDto nftPublishResultQueryRespDtoTemp = publishResultQueryRespDto.getData();
BeanUtil.copy(nftPublishResultQueryRespDtoTemp,nftOrderBo);
}
}else if(StringUtil.isNotEmpty(nftOrderBo.getNftBuyStatus())
&& (GalaxyEnum.TaskStatusEnum.INIT.getCode().equalsIgnoreCase(nftOrderBo.getNftBuyStatus())
||GalaxyEnum.TaskStatusEnum.PROCESSING.getCode().equalsIgnoreCase(nftOrderBo.getNftBuyStatus()))){
//判断是否需要二次购买
if(StringUtil.isEmpty(nftOrderBo.getNftBuyTaskId())){
isNeedSecondBuy = true;
}
//执行nft购买结果查询
GalaxyNftBuyResultQueryReqDto nftBuyResultQueryReqDto = GalaxyNftBuyResultQueryReqDto.getNew();
nftBuyResultQueryReqDto.setNftOrderPayId(reqDto.getNftOrderPayId());
nftBuyResultQueryReqDto.setRouterType(reqDto.getRouterType());
ResponseDto<GalaxyNftBuyResultQueryRespDto> buyResultQueryRespDto= xuperTradeCommonBiz.nftBuyResultQuery(nftBuyResultQueryReqDto,nftOrderBo);
if(buyResultQueryRespDto.isSuccess()){
GalaxyNftBuyResultQueryRespDto nftBuyResultQueryRespDtoTemp = buyResultQueryRespDto.getData();
BeanUtil.copy(nftBuyResultQueryRespDtoTemp,nftOrderBo);
}
}
GalaxyNftPublishAndBuyResultQueryRespDto resultQueryRespDto = GalaxyNftPublishAndBuyResultQueryRespDto.getNew();
if(nftOrderBo.getNftPublishStatus().equalsIgnoreCase(GalaxyEnum.TaskStatusEnum.TASK_SUCCESS.getCode())&&
nftOrderBo.getNftBuyStatus().equalsIgnoreCase(GalaxyEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
BeanUtil.copy(nftOrderBo,resultQueryRespDto);
return ResponseDto.success(resultQueryRespDto);
}
return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage(),resultQueryRespDto);
}
}
......@@ -9,6 +9,7 @@ import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyUser;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterUserHandler;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserBiz;
import com.liquidnet.service.galaxy.utils.QueueUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -29,8 +30,14 @@ public class GalaxyRouterStrategyZxlUserImpl implements IGalaxyRouterStrategyUse
@Autowired
private ZxinUserBiz zxinUserBiz;
@Autowired
private QueueUtil queueUtil;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
//测试发送队列
// queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getKey(), JsonUtils.toJson(reqDto));
// return ResponseDto.success();
return zxinUserBiz.userRegister(reqDto);
}
......
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