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

Commit 252739a1 authored by anjiabin's avatar anjiabin

实现xuper相关功能

parent 80456f58
<?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.jlbs</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.jlbs</groupId>
<artifactId>liquidnet-common-base</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jlbs</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.auth.XchainAccount;
import com.baidu.xasset.client.xasset.Asset;
import com.baidu.xasset.common.config.Config;
import com.baidu.xuper.api.Account;
import com.liquidnet.commons.lang.util.BASE64Util;
import com.liquidnet.commons.lang.util.MD5Utils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import java.io.UnsupportedEncodingException;
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
*/
@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;
private Asset asset = null;
private static Asset staticAsset = null;
@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);
// 初始化接口类
asset = new Asset(cfg, Logger.getGlobal());
}
//
// 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;
}
}
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;
}
}
}
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;
/**
* @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 Xuper004PublishAssetRespDto {
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 com.baidu.xasset.client.xasset.XassetDef;
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;
private String url1;
private String url2;
private String url3;
}
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;
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 com.baidu.xasset.client.xasset.XassetDef;
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 XassetDef.ShardMeta meta;
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;
/**
* @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 Xuper011ListSdsByAddrReqDto {
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;
/**
* @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 Xuper011ListSdsByAddrRespDto {
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;
/**
* @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 Xuper012ListSdsByAstReqDto {
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;
/**
* @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 Xuper012ListSdsByAstRespDto {
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;
/**
* @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 Xuper013HistoryReqDto {
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;
/**
* @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 Xuper013HistoryRespDto {
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;
/**
* @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 Xuper014FreezeAssetReqDto {
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;
/**
* @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 Xuper014FreezeAssetRespDto {
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 {
private String pubKeyStr;
private String priKeyStr;
private String address;
private String mnemonic;
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>
......@@ -41,5 +41,17 @@
<artifactId>liquidnet-service-adam-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jlbs</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>
......@@ -4,10 +4,7 @@ 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 java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
......@@ -66,4 +63,35 @@ 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();
}
}
}
package com.liquidnet.service.galaxy.router.xuper.biz;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft032SeriesResp;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
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.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
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: XuperTradeQueryBiz
* @Package com.liquidnet.service.galaxy.router.xuper.biz
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:11
*/
@Slf4j
@Component
public class XuperTradeQueryBiz {
@Autowired
private ZxlnftSdkUtil zxlnftSdkUtil;
@Autowired
private ZxlWalletSdkUtil zxlWalletSdkUtil;
@Autowired
private ZxlnftBiz zxlnftBiz;
@Autowired
private GalaxyDataUtils dataUtils;
public ResponseDto<GalaxyQueryNftInfoRespDto> queryNftInfo(GalaxyQueryNftInfoReqDto reqDto) {
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getMessage());
}
if(StringUtil.isEmpty(nftOrderBo.getNftId())){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getMessage());
}
Nft036InfoReqDto nft036InfoReqDto = Nft036InfoReqDto.getNew();
nft036InfoReqDto.setNftId(nftOrderBo.getNftId());
ZxlnftResponseDto<Nft036InfoRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft036Info(nft036InfoReqDto);
//查询结果
GalaxyQueryNftInfoRespDto queryNftInfoRespDto = GalaxyQueryNftInfoRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData().getNftInfo(),queryNftInfoRespDto);
return ResponseDto.success(queryNftInfoRespDto);
}
return ResponseDto.failure();
}
public ResponseDto<GalaxyQueryNftTradeListRespDto> queryNftTradeList(GalaxyQueryNftTradeListReqDto reqDto) {
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_ORDER_NOT_EXIST.getMessage());
}
if(StringUtil.isEmpty(nftOrderBo.getNftId())){
return ResponseDto.failure(GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getCode(),GalaxyErrorEnum.NFT_QUERY_FAIL_NFT_NOT_EXIST.getMessage());
}
Nft039TradeListReqDto nft039TradeListReqDto = Nft039TradeListReqDto.getNew();
nft039TradeListReqDto.setNftId(nftOrderBo.getNftId());
nft039TradeListReqDto.setLimit(1000l);
ZxlnftResponseDto<Nft039TradeListRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft039TradeList(nft039TradeListReqDto);
//查询结果
GalaxyQueryNftTradeListRespDto queryNftTradeListRespDto = GalaxyQueryNftTradeListRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData(),queryNftTradeListRespDto);
return ResponseDto.success(queryNftTradeListRespDto);
}
return ResponseDto.failure();
}
public ResponseDto<GalaxyQuerySeriesInfoRespDto> querySeriesInfo(GalaxyQuerySeriesInfoReqDto reqDto) {
//获取sku信息
GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
if(StringUtil.isNull(seriesNftInfoBo)){
return ResponseDto.failure(GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getMessage());
}
Nft032SeriesReqDto nft032SeriesReqDto = Nft032SeriesReqDto.getNew();
nft032SeriesReqDto.setSeriesId(seriesNftInfoBo.getSeriesId());
ZxlnftResponseDto<Nft032SeriesRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft032Series(nft032SeriesReqDto);
//查询结果
GalaxyQuerySeriesInfoRespDto querySeriesInfoRespDto = GalaxyQuerySeriesInfoRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
Nft032SeriesResp.SeriesInfo seriesInfo = zxlnftResponseDto.getData().getSeriesInfo();
BeanUtil.copy(seriesInfo,querySeriesInfoRespDto);
querySeriesInfoRespDto.setTotalCount(seriesInfo.getTotalCount().toString());
querySeriesInfoRespDto.setSeriesBeginFromZero(Boolean.toString(seriesInfo.isSeriesBeginFromZero()));
querySeriesInfoRespDto.setCrtCount(seriesInfo.getCrtCount().toString());
querySeriesInfoRespDto.setCreateTimeStamp(seriesInfo.getCreateTimeStamp().toString());
return ResponseDto.success(querySeriesInfoRespDto);
}
return ResponseDto.failure();
}
public ResponseDto<GalaxyQueryUserSeriesNftListRespDto> queryUserSeriesNftList(GalaxyQueryUserSeriesNftListReqDto reqDto) {
//获取用户信息
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId());
//获取sku信息
GalaxySeriesNftInfoBo seriesNftInfoBo = dataUtils.getSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
if(StringUtil.isNull(seriesNftInfoBo)){
return ResponseDto.failure(GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NFT_INFO_NOT_EXIST.getMessage());
}
Nft037AddressListReqDto nft037ReqDto = Nft037AddressListReqDto.getNew();
nft037ReqDto.setAddr(userInfoBo.getBlockChainAddress());
nft037ReqDto.setSeriesId(seriesNftInfoBo.getSeriesId());
nft037ReqDto.setLimit(1000l);
ZxlnftResponseDto<Nft037AddressListRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft037AddressList(nft037ReqDto);
GalaxyQueryUserSeriesNftListRespDto queryNftListRespDto = GalaxyQueryUserSeriesNftListRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData(),queryNftListRespDto);
queryNftListRespDto.setUserId(reqDto.getUserId());
queryNftListRespDto.setSeriesId(seriesNftInfoBo.getSeriesId());
}else{
return ResponseDto.failure();
}
return ResponseDto.success(queryNftListRespDto);
}
public ResponseDto<GalaxyQueryUserTradeAllListRespDto> queryUserTradeAllList(GalaxyQueryUserTradeAllListReqDto reqDto) {
Nft042TradeAllListReqDto nft042TradeAllListReqDto = Nft042TradeAllListReqDto.getNew();
nft042TradeAllListReqDto.setAddr(reqDto.getBlockChainAddress());
nft042TradeAllListReqDto.setLimit(1000l);
ZxlnftResponseDto<Nft042TradeAllListRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft042TradeAllList(nft042TradeAllListReqDto);
GalaxyQueryUserTradeAllListRespDto queryUserTradeAllListRespDto = GalaxyQueryUserTradeAllListRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData(),queryUserTradeAllListRespDto);
}else{
return ResponseDto.failure();
}
return ResponseDto.success(queryUserTradeAllListRespDto);
}
public ResponseDto<GalaxyQueryUserTradeInListRespDto> queryUserTradeInList(GalaxyQueryUserTradeInListReqDto reqDto) {
Nft040TradeInListReqDto nft040TradeInListReqDto = Nft040TradeInListReqDto.getNew();
nft040TradeInListReqDto.setAddr(reqDto.getBlockChainAddress());
nft040TradeInListReqDto.setLimit(1000l);
ZxlnftResponseDto<Nft040TradeInListRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft040TradeInList(nft040TradeInListReqDto);
GalaxyQueryUserTradeInListRespDto queryUserTradeInListRespDto = GalaxyQueryUserTradeInListRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData(),queryUserTradeInListRespDto);
}else{
return ResponseDto.failure();
}
return ResponseDto.success(queryUserTradeInListRespDto);
}
public ResponseDto<GalaxyQueryUserTradeOutListRespDto> queryUserTradeOutList(GalaxyQueryUserTradeOutListReqDto reqDto) {
Nft041TradeOutListReqDto nft041TradeOutListReqDto = Nft041TradeOutListReqDto.getNew();
nft041TradeOutListReqDto.setAddr(reqDto.getBlockChainAddress());
nft041TradeOutListReqDto.setLimit(1000l);
ZxlnftResponseDto<Nft041TradeOutListRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft041TradeOutList(nft041TradeOutListReqDto);
GalaxyQueryUserTradeOutListRespDto queryUserTradeOutListRespDto = GalaxyQueryUserTradeOutListRespDto.getNew();
if(zxlnftResponseDto.isSuccess()){
BeanUtil.copy(zxlnftResponseDto.getData(),queryUserTradeOutListRespDto);
}else{
return ResponseDto.failure();
}
return ResponseDto.success(queryUserTradeOutListRespDto);
}
}
package com.liquidnet.service.galaxy.router.xuper.biz;
import com.liquidnet.common.third.xuper.util.XuperSdkUtil;
import com.liquidnet.common.third.zxlnft.dto.Nft016IdentityBindQueryReqDto;
import com.liquidnet.service.base.ResponseDto;
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 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: XuperUserBiz
* @Package com.liquidnet.service.galaxy.router.xuper.biz
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:11
*/
@Slf4j
@Component
public class XuperUserBiz {
@Autowired
private XuperSdkUtil xuperSdkUtil;
@Autowired
private XuperUserCommonBiz xuperUserCommonBiz;
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return xuperUserCommonBiz.userRegister(reqDto);
}
public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto){
Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
nft016ReqDto.setAddressList(reqDto.getBlockChainAddress());
// ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> zxlnftResponseDto = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
//
GalaxyUserBindStatusQueryRespDto userBindStatusQueryRespDto = GalaxyUserBindStatusQueryRespDto.getNew();
// if(zxlnftResponseDto.isSuccess()){
// Nft016QueryRsData nft016QueryRsData = zxlnftResponseDto.getData().getList().get(0);
// userBindStatusQueryRespDto.setBlockChainAddress(nft016QueryRsData.getAddress());
// Integer userBindStatus = Integer.valueOf(GalaxyEnumBiz.getUserBindStatusEnum(reqDto.getRouterType(),nft016QueryRsData.getStatus()).getCode());
// userBindStatusQueryRespDto.setUserBindStatus(userBindStatus);
// }else{
// return ResponseDto.failure();
// }
return ResponseDto.success(userBindStatusQueryRespDto);
}
}
package com.liquidnet.service.galaxy.router.xuper.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyArtwork;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterArtworkHandler;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperArtworkBiz;
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: GalaxyRouterStrategyXuperArtworkImpl
* @Package com.liquidnet.service.galaxy.router.xuper.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:03
*/
@Slf4j
@Component
@StrategyGalaxyRouterArtworkHandler(GalaxyEnum.RouterTypeEnum.XUPER)
public class GalaxyRouterStrategyXuperArtworkImpl implements IGalaxyRouterStrategyArtwork {
@Autowired
private XuperArtworkBiz xuperArtworkBiz;
@Override
public ResponseDto<GalaxyNftImageRespDto> nftImageCheck(GalaxyNftImageReqDto reqDto) {
return xuperArtworkBiz.nftImageCheck(reqDto);
}
@Override
public ResponseDto<GalaxyNftUploadRespDto> nftUpload(GalaxyNftUploadReqDto reqDto) {
return xuperArtworkBiz.nftUpload(reqDto);
}
@Override
public ResponseDto<GalaxyArtSeriesClaimRespDto> seriesClaim(GalaxyArtSeriesClaimReqDto reqDto) {
return xuperArtworkBiz.seriesClaim(reqDto);
}
@Override
public ResponseDto<GalaxyArtSeriesClaimResultQueryRespDto> seriesClaimResultQuery(GalaxyArtSeriesClaimResultQueryReqDto reqDto) {
return xuperArtworkBiz.seriesClaimResultQuery(reqDto);
}
}
\ No newline at end of file
package com.liquidnet.service.galaxy.router.xuper.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
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.router.strategy.IGalaxyRouterStrategyPublish;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterPublishHandler;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperPublishBiz;
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: GalaxyRouterStrategyXuperPublishImpl
* @Package com.liquidnet.service.galaxy.router.xuper.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:03
*/
@Slf4j
@Component
@StrategyGalaxyRouterPublishHandler(GalaxyEnum.RouterTypeEnum.XUPER)
public class GalaxyRouterStrategyXuperPublishImpl implements IGalaxyRouterStrategyPublish {
@Autowired
private XuperPublishBiz xuperPublishBiz;
@Override
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(GalaxyNftPublishReqDto reqDto) {
return xuperPublishBiz.nftPublish(reqDto);
}
@Override
public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(GalaxyNftPublishResultQueryReqDto reqDto) {
return xuperPublishBiz.nftPublishResultQuery(reqDto);
}
}
package com.liquidnet.service.galaxy.router.xuper.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyTrade;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterTradeHandler;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperTradeBiz;
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: GalaxyRouterStrategyXuperTradeImpl
* @Package com.liquidnet.service.galaxy.router.xuper.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:04
*/
@Slf4j
@Component
@StrategyGalaxyRouterTradeHandler(GalaxyEnum.RouterTypeEnum.XUPER)
public class GalaxyRouterStrategyXuperTradeImpl implements IGalaxyRouterStrategyTrade {
@Autowired
private XuperTradeBiz xuperTradeBiz;
@Override
public ResponseDto<GalaxyNftPublishAndBuyRespDto> nftPublishAndBuy(GalaxyNftPublishAndBuyReqDto reqDto) {
//测试发送队列
// queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_PUBLISH_AND_BUY.getKey(), JsonUtils.toJson(reqDto));
// return ResponseDto.success();
return xuperTradeBiz.nftPublishAndBuy(reqDto);
}
@Override
public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(GalaxyNftBuyResultQueryReqDto reqDto) {
return xuperTradeBiz.nftBuyResultQuery(reqDto);
}
@Override
public ResponseDto<GalaxyNftBuyPayResultQueryRespDto> nftBuyPayResultQuery(GalaxyNftBuyPayResultQueryReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftPublishAndBuyResultQuery(GalaxyNftPublishAndBuyResultQueryReqDto reqDto) {
return xuperTradeBiz.nftPublishAndBuyResultQuery(reqDto);
}
@Override
public ResponseDto<GalaxyNftPublishAndBuyRouterBatchQueryRespDto> nftPublishAndBuyResultBatchQuery(GalaxyNftPublishAndBuyRouterBatchQueryReqDto reqDto) {
return null;
}
@Override
public ResponseDto<GalaxyNftBuyRespDto> nftBuy(GalaxyNftBuyReqDto reqDto) {
return xuperTradeBiz.nftBuy(reqDto);
}
}
\ No newline at end of file
package com.liquidnet.service.galaxy.router.xuper.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.IGalaxyRouterStrategyTradeQuery;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterTradeQueryHandler;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperTradeQueryBiz;
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: GalaxyRouterStrategyXuperTradeQueryImpl
* @Package com.liquidnet.service.galaxy.router.xuper.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:04
*/
@Slf4j
@Component
@StrategyGalaxyRouterTradeQueryHandler(GalaxyEnum.RouterTypeEnum.XUPER)
public class GalaxyRouterStrategyXuperTradeQueryImpl implements IGalaxyRouterStrategyTradeQuery {
@Autowired
private XuperTradeQueryBiz xuperTradeQueryBiz;
@Override
public ResponseDto<GalaxyQueryNftInfoRespDto> queryNftInfo(GalaxyQueryNftInfoReqDto reqDto) {
return xuperTradeQueryBiz.queryNftInfo(reqDto);
}
@Override
public ResponseDto<GalaxyQueryNftTradeListRespDto> queryNftTradeList(GalaxyQueryNftTradeListReqDto reqDto) {
return xuperTradeQueryBiz.queryNftTradeList(reqDto);
}
@Override
public ResponseDto<GalaxyQuerySeriesInfoRespDto> querySeriesInfo(GalaxyQuerySeriesInfoReqDto reqDto) {
return xuperTradeQueryBiz.querySeriesInfo(reqDto);
}
@Override
public ResponseDto<GalaxyQueryUserSeriesNftListRespDto> queryUserSeriesNftList(GalaxyQueryUserSeriesNftListReqDto reqDto) {
return xuperTradeQueryBiz.queryUserSeriesNftList(reqDto);
}
@Override
public ResponseDto<GalaxyQueryUserTradeAllListRespDto> queryUserTradeAllList(GalaxyQueryUserTradeAllListReqDto reqDto) {
return xuperTradeQueryBiz.queryUserTradeAllList(reqDto);
}
@Override
public ResponseDto<GalaxyQueryUserTradeInListRespDto> queryUserTradeInList(GalaxyQueryUserTradeInListReqDto reqDto) {
return xuperTradeQueryBiz.queryUserTradeInList(reqDto);
}
@Override
public ResponseDto<GalaxyQueryUserTradeOutListRespDto> queryUserTradeOutList(GalaxyQueryUserTradeOutListReqDto reqDto) {
return xuperTradeQueryBiz.queryUserTradeOutList(reqDto);
}
}
package com.liquidnet.service.galaxy.router.xuper.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
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.strategy.IGalaxyRouterStrategyUser;
import com.liquidnet.service.galaxy.router.strategy.annotation.StrategyGalaxyRouterUserHandler;
import com.liquidnet.service.galaxy.router.xuper.biz.XuperUserBiz;
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: GalaxyRouterStrategyXuperUserImpl
* @Package com.liquidnet.service.galaxy.router.xuper.service
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/6/27 11:05
*/
@Slf4j
@Component
@StrategyGalaxyRouterUserHandler(GalaxyEnum.RouterTypeEnum.XUPER)
public class GalaxyRouterStrategyXuperUserImpl implements IGalaxyRouterStrategyUser {
@Autowired
private XuperUserBiz xuperUserBiz;
@Override
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return xuperUserBiz.userRegister(reqDto);
}
@Override
public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto) {
return xuperUserBiz.userBindStatusQuery(reqDto);
}
}
package com.liquidnet.service.galaxy.router.zxin.service;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto;
......@@ -9,6 +11,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 +32,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