记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
f4b6e45e
Commit
f4b6e45e
authored
Jul 01, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper发行购买功能
parent
ea0af45b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
23 deletions
+91
-23
Xuper011ListSdsByAddrReqDto.java
...t/common/third/xuper/dto/Xuper011ListSdsByAddrReqDto.java
+10
-0
Xuper011ListSdsByAddrRespDto.java
.../common/third/xuper/dto/Xuper011ListSdsByAddrRespDto.java
+49
-0
XuperSdkUtil.java
...a/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
+9
-3
TestXuperSdkUtil.java
...liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
+23
-20
No files found.
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper011ListSdsByAddrReqDto.java
View file @
f4b6e45e
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @version V1.0
...
@@ -9,7 +11,15 @@ package com.liquidnet.common.third.xuper.dto;
...
@@ -9,7 +11,15 @@ package com.liquidnet.common.third.xuper.dto;
* @Copyright: LightNet @ Copyright (c) 2022
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
* @date 2022/4/18 15:10
*/
*/
@Data
public
class
Xuper011ListSdsByAddrReqDto
{
public
class
Xuper011ListSdsByAddrReqDto
{
//要拉取的区块链账户地址
private
String
addr
=
""
;
//要拉取页数,第一页为1
private
int
page
=
1
;
//每页拉取数量,默认20,最大50(可选)
private
int
limit
=
50
;
private
static
final
Xuper011ListSdsByAddrReqDto
obj
=
new
Xuper011ListSdsByAddrReqDto
();
private
static
final
Xuper011ListSdsByAddrReqDto
obj
=
new
Xuper011ListSdsByAddrReqDto
();
public
static
Xuper011ListSdsByAddrReqDto
getNew
()
{
public
static
Xuper011ListSdsByAddrReqDto
getNew
()
{
try
{
try
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper011ListSdsByAddrRespDto.java
View file @
f4b6e45e
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
import
java.util.ArrayList
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @version V1.0
...
@@ -9,7 +13,52 @@ package com.liquidnet.common.third.xuper.dto;
...
@@ -9,7 +13,52 @@ package com.liquidnet.common.third.xuper.dto;
* @Copyright: LightNet @ Copyright (c) 2022
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
* @date 2022/4/18 15:10
*/
*/
@Data
public
class
Xuper011ListSdsByAddrRespDto
{
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
();
private
static
final
Xuper011ListSdsByAddrRespDto
obj
=
new
Xuper011ListSdsByAddrRespDto
();
public
static
Xuper011ListSdsByAddrRespDto
getNew
()
{
public
static
Xuper011ListSdsByAddrRespDto
getNew
()
{
try
{
try
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
View file @
f4b6e45e
...
@@ -436,12 +436,18 @@ public class XuperSdkUtil {
...
@@ -436,12 +436,18 @@ public class XuperSdkUtil {
Xuper011ListSdsByAddrRespDto
respDto
=
Xuper011ListSdsByAddrRespDto
.
getNew
();
Xuper011ListSdsByAddrRespDto
respDto
=
Xuper011ListSdsByAddrRespDto
.
getNew
();
try
{
try
{
//要拉取的区块链账户地址
//要拉取的区块链账户地址
String
addr
=
""
;
String
addr
=
reqDto
.
getAddr
()
;
//要拉取页数,第一页为1
//要拉取页数,第一页为1
int
page
=
1
;
int
page
=
reqDto
.
getPage
()
;
//每页拉取数量,默认20,最大50(可选)
//每页拉取数量,默认20,最大50(可选)
int
limit
=
20
;
int
limit
=
reqDto
.
getLimit
()
;
BaseDef
.
Resp
<
BaseDef
.
ListPageResp
>
listPageResp
=
getAsset
().
listShardsAddr
(
addr
,
page
,
limit
);
BaseDef
.
Resp
<
BaseDef
.
ListPageResp
>
listPageResp
=
getAsset
().
listShardsAddr
(
addr
,
page
,
limit
);
log
.
debug
(
"xuper011ListSdsByAddr resp : "
+
JsonUtils
.
toJson
(
listPageResp
));
BaseDef
.
RequestRes
requestRes
=
listPageResp
.
res
;
if
(
requestRes
.
httpCode
==
200
){
log
.
debug
(
"xuper011ListSdsByAddr apiResp : "
+
JsonUtils
.
toJson
(
listPageResp
.
apiResp
));
respDto
=
JsonUtils
.
fromJson
(
JsonUtils
.
toJson
(
listPageResp
.
apiResp
),
new
TypeReference
<
Xuper011ListSdsByAddrRespDto
>(){});
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
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
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/test/java/com/liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
View file @
f4b6e45e
...
@@ -342,13 +342,13 @@ public class TestXuperSdkUtil {
...
@@ -342,13 +342,13 @@ public class TestXuperSdkUtil {
Xuper006ListAssetByAddrRespDto
respDto
=
null
;
Xuper006ListAssetByAddrRespDto
respDto
=
null
;
try
{
try
{
//资产状态。0:全部 1:初试 3:发行中 4:发行成功。默认 0(可选)
//资产状态。0:全部 1:初试 3:发行中 4:发行成功。默认 0(可选)
int
status
=
0
;
int
status
=
4
;
//要拉取的区块链账户地址
//要拉取的区块链账户地址
String
addr
=
xuperSdkUtil
.
getAccount
(
creatorMnemonic
).
getAddress
();
String
addr
=
xuperSdkUtil
.
getAccount
(
creatorMnemonic
).
getAddress
();
//要拉取页数,第一页为1
//要拉取页数,第一页为1
int
page
=
1
;
int
page
=
1
;
//每页拉取数量,默认20,最大50(可选)
//每页拉取数量,默认20,最大50(可选)
int
limit
=
2
0
;
int
limit
=
5
0
;
reqDto
.
setStatus
(
status
);
reqDto
.
setStatus
(
status
);
reqDto
.
setAddr
(
addr
);
reqDto
.
setAddr
(
addr
);
reqDto
.
setPage
(
page
);
reqDto
.
setPage
(
page
);
...
@@ -470,24 +470,27 @@ public class TestXuperSdkUtil {
...
@@ -470,24 +470,27 @@ public class TestXuperSdkUtil {
@Test
@Test
public
void
testXuper011ListSdsByAddr
(){
public
void
testXuper011ListSdsByAddr
(){
Xuper004PublishAssetReqDto
reqDto
=
Xuper004PublishAssetReqDto
.
getNew
();
//要查询的区块链账户地址
String
addr
=
xuperConfig
.
getNftPlatformAddress
();
//xuper-userid-002
addr
=
"acsuf4Mrz9r38KERQGabsoDsa4MPEcF85"
;
Xuper011ListSdsByAddrReqDto
reqDto
=
Xuper011ListSdsByAddrReqDto
.
getNew
();
// 定义返回结果对象
// 定义返回结果对象
Xuper004PublishAssetRespDto
respDto
=
null
;
Xuper011ListSdsByAddrRespDto
respDto
=
null
;
long
assetId
=
171095615845019437
l
;
// long assetId = 1532351545249738541l;
try
{
try
{
reqDto
.
setMnemonic
(
creatorMnemonic
);
reqDto
.
setAddr
(
addr
);
reqDto
.
setAssetId
(
assetId
);
reqDto
.
setPage
(
1
);
XuperResponseDto
<
Xuper004PublishAssetRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper004PublishAsset
(
reqDto
);
reqDto
.
setLimit
(
50
);
XuperResponseDto
<
Xuper011ListSdsByAddrRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper011ListSdsByAddr
(
reqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
if
(
xuperResponseDto
.
isSuccess
()){
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
04PublishAsset
RespDto
.
class
);
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
11ListSdsByAddr
RespDto
.
class
);
}
}
}
catch
(
XupterException
e
)
{
}
catch
(
XupterException
e
)
{
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"testXuper0
04PublishAsset
resp : "
+
JsonUtils
.
toJson
(
respDto
));
log
.
info
(
"testXuper0
11ListSdsByAddr
resp : "
+
JsonUtils
.
toJson
(
respDto
));
}
}
@Test
@Test
...
@@ -509,29 +512,29 @@ public class TestXuperSdkUtil {
...
@@ -509,29 +512,29 @@ public class TestXuperSdkUtil {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"testXuper0
04PublishAsse
t resp : "
+
JsonUtils
.
toJson
(
respDto
));
log
.
info
(
"testXuper0
12ListSdsByAs
t resp : "
+
JsonUtils
.
toJson
(
respDto
));
}
}
@Test
@Test
public
void
testXuper013History
(){
public
void
testXuper013History
(){
Xuper0
04PublishAssetReqDto
reqDto
=
Xuper004PublishAsset
ReqDto
.
getNew
();
Xuper0
13HistoryReqDto
reqDto
=
Xuper013History
ReqDto
.
getNew
();
// 定义返回结果对象
// 定义返回结果对象
Xuper0
04PublishAsset
RespDto
respDto
=
null
;
Xuper0
13History
RespDto
respDto
=
null
;
long
assetId
=
1
7109561584501943
7
l
;
long
assetId
=
1
3952132601988279
7
l
;
// long assetId = 1532351545249738541l;
// long assetId = 1532351545249738541l;
try
{
try
{
reqDto
.
setMnemonic
(
creatorMnemonic
);
//
reqDto.setMnemonic(creatorMnemonic);
reqDto
.
setAssetId
(
assetId
);
//
reqDto.setAssetId(assetId);
XuperResponseDto
<
Xuper0
04PublishAssetRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper004PublishAsset
(
reqDto
);
XuperResponseDto
<
Xuper0
13HistoryRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper013History
(
reqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
if
(
xuperResponseDto
.
isSuccess
()){
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
04PublishAsset
RespDto
.
class
);
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
13History
RespDto
.
class
);
}
}
}
catch
(
XupterException
e
)
{
}
catch
(
XupterException
e
)
{
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
log
.
error
(
"sys error msg "
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"testXuper0
04PublishAsset
resp : "
+
JsonUtils
.
toJson
(
respDto
));
log
.
info
(
"testXuper0
13History
resp : "
+
JsonUtils
.
toJson
(
respDto
));
}
}
@Test
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment