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

Commit ac94ca6a authored by anjiabin's avatar anjiabin

实现xuper相关艺术品上传

parent 34604e54
...@@ -23,6 +23,7 @@ public class GalaxyConstant { ...@@ -23,6 +23,7 @@ public class GalaxyConstant {
public static final String REDIS_KEY_GALAXY_PUBLISH_NFT="galaxy:publish:nft:"; //nft索引递增记录 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_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 public static final String ADAM_USER_SYNC_URL="/adam/rsc/syn/certmeta";// adam用户开通数字账户信息同步url
......
...@@ -117,6 +117,10 @@ public class IDGenerator { ...@@ -117,6 +117,10 @@ public class IDGenerator {
return "ZXLNFTIMAGE" + nextTimeId(); return "ZXLNFTIMAGE" + nextTimeId();
} }
public static String getXuperNftImageCosCode() {
return "XUPERNFTIMAGE" + nextTimeId();
}
public static String refundCode() { public static String refundCode() {
return "RED" + nextTimeId(); return "RED" + nextTimeId();
} }
......
package com.liquidnet.common.third.xuper.dto; package com.liquidnet.common.third.xuper.dto;
import com.baidu.xasset.client.base.BaseDef;
import com.baidu.xasset.client.xasset.XassetDef;
import lombok.Data; import lombok.Data;
/** /**
...@@ -16,8 +14,36 @@ import lombok.Data; ...@@ -16,8 +14,36 @@ import lombok.Data;
@Data @Data
public class XuperUploadFileRespDto { public class XuperUploadFileRespDto {
public String link; public String link;
public XassetDef.GetStokenResp resp; public GetStokenResp resp;
public BaseDef.RequestRes res; 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(); private static final XuperUploadFileRespDto obj = new XuperUploadFileRespDto();
public static XuperUploadFileRespDto getNew() { public static XuperUploadFileRespDto getNew() {
......
...@@ -60,7 +60,12 @@ public class XuperSdkUtil { ...@@ -60,7 +60,12 @@ public class XuperSdkUtil {
byte[] dataByte = reqDto.getDataByte(); byte[] dataByte = reqDto.getDataByte();
String property = reqDto.getProperty(); String property = reqDto.getProperty();
XassetDef.UploadFile uploadFile = getAsset().uploadFile(account, fileName, filePath, dataByte, property); XassetDef.UploadFile uploadFile = getAsset().uploadFile(account, fileName, filePath, dataByte, property);
BaseDef.RequestRes requestRes = uploadFile.res;
if(requestRes.httpCode==200){
log.info("xuperUploadFile resp : "+ JsonUtils.toJson(uploadFile)); log.info("xuperUploadFile resp : "+ JsonUtils.toJson(uploadFile));
respDto = JsonUtils.fromJson(JsonUtils.toJson(uploadFile),new TypeReference<XuperUploadFileRespDto>(){});
}
log.info("xuperUploadFile resp : "+ JsonUtils.toJson(respDto));
}catch(Exception e){ }catch(Exception e){
log.error("error msg "+e.getMessage(),e); log.error("error msg "+e.getMessage(),e);
throw new XupterException(XuperErrorEnum.SERVER_INNER_ERROR.getCode(),XuperErrorEnum.SERVER_INNER_ERROR.getMsg()); throw new XupterException(XuperErrorEnum.SERVER_INNER_ERROR.getCode(),XuperErrorEnum.SERVER_INNER_ERROR.getMsg());
......
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