记得上下班打卡 | 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
f84811c3
Commit
f84811c3
authored
Jul 01, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现xuper发行购买功能
parent
f4b6e45e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
19 deletions
+106
-19
Xuper012ListSdsByAstReqDto.java
...et/common/third/xuper/dto/Xuper012ListSdsByAstReqDto.java
+10
-0
Xuper012ListSdsByAstRespDto.java
...t/common/third/xuper/dto/Xuper012ListSdsByAstRespDto.java
+22
-0
Xuper013HistoryReqDto.java
...quidnet/common/third/xuper/dto/Xuper013HistoryReqDto.java
+10
-0
Xuper013HistoryRespDto.java
...uidnet/common/third/xuper/dto/Xuper013HistoryRespDto.java
+3
-0
Xuper014FreezeAssetReqDto.java
...net/common/third/xuper/dto/Xuper014FreezeAssetReqDto.java
+12
-0
Xuper014FreezeAssetRespDto.java
...et/common/third/xuper/dto/Xuper014FreezeAssetRespDto.java
+7
-0
XuperSdkUtil.java
...a/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
+25
-7
TestXuperSdkUtil.java
...liquidnet/service/goblin/test/xuper/TestXuperSdkUtil.java
+17
-12
No files found.
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper012ListSdsByAstReqDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,7 +11,15 @@ 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
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper012ListSdsByAstRespDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
import
java.util.ArrayList
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,7 +13,25 @@ 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
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper013HistoryReqDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,7 +11,15 @@ 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
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper013HistoryRespDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,6 +11,7 @@ package com.liquidnet.common.third.xuper.dto;
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/4/18 15:10
*/
@Data
public
class
Xuper013HistoryRespDto
{
private
static
final
Xuper013HistoryRespDto
obj
=
new
Xuper013HistoryRespDto
();
public
static
Xuper013HistoryRespDto
getNew
()
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper014FreezeAssetReqDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,7 +11,17 @@ 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
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/dto/Xuper014FreezeAssetRespDto.java
View file @
f84811c3
package
com
.
liquidnet
.
common
.
third
.
xuper
.
dto
;
import
lombok.Data
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -9,7 +11,12 @@ 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
{
...
...
liquidnet-bus-common/liquidnet-common-third/liquidnet-common-third-xuper/src/main/java/com/liquidnet/common/third/xuper/util/XuperSdkUtil.java
View file @
f84811c3
...
...
@@ -464,12 +464,18 @@ public class XuperSdkUtil {
Xuper012ListSdsByAstRespDto
respDto
=
Xuper012ListSdsByAstRespDto
.
getNew
();
try
{
//资产id
long
assetId
=
123
;
//分页游标,首页设置空字符串
(可选)
String
cursor
=
"123"
;
long
assetId
=
reqDto
.
getAssetId
()
;
//分页游标,首页设置空字符串
,后面的用上页返回的cursor值
String
cursor
=
reqDto
.
getCursor
()
;
//每页拉取数量,默认20,最多50(可选)
int
limit
=
20
;
int
limit
=
reqDto
.
getLimit
()
;
BaseDef
.
Resp
<
BaseDef
.
ListCursorResp
>
listCursorResp
=
getAsset
().
listShardsByAsset
(
assetId
,
cursor
,
limit
);
log
.
info
(
"xuper012ListSdsByAst resp : "
+
JsonUtils
.
toJson
(
listCursorResp
));
BaseDef
.
RequestRes
requestRes
=
listCursorResp
.
res
;
if
(
requestRes
.
httpCode
==
200
){
log
.
info
(
"xuper012ListSdsByAst apiResp : "
+
JsonUtils
.
toJson
(
listCursorResp
.
apiResp
));
respDto
=
JsonUtils
.
fromJson
(
JsonUtils
.
toJson
(
listCursorResp
.
apiResp
),
new
TypeReference
<
Xuper012ListSdsByAstRespDto
>(){});
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
XupterException
(
XuperErrorEnum
.
SERVER_INNER_ERROR
.
getCode
(),
XuperErrorEnum
.
SERVER_INNER_ERROR
.
getMsg
());
...
...
@@ -486,12 +492,18 @@ public class XuperSdkUtil {
Xuper013HistoryRespDto
respDto
=
Xuper013HistoryRespDto
.
getNew
();
try
{
//资产id
long
assetId
=
123
;
long
assetId
=
reqDto
.
getAssetId
()
;
//要拉取页数,第一页为1
int
page
=
1
;
int
page
=
reqDto
.
getPage
()
;
//每页拉取数量,默认20,最大50(可选)
int
limit
=
20
;
int
limit
=
reqDto
.
getLimit
()
;
BaseDef
.
Resp
<
BaseDef
.
ListPageResp
>
listPageResp
=
getAsset
().
history
(
assetId
,
page
,
limit
);
log
.
info
(
"xuper013History resp : "
+
JsonUtils
.
toJson
(
listPageResp
));
BaseDef
.
RequestRes
requestRes
=
listPageResp
.
res
;
if
(
requestRes
.
httpCode
==
200
){
log
.
info
(
"xuper013History apiResp : "
+
JsonUtils
.
toJson
(
listPageResp
.
apiResp
));
respDto
=
JsonUtils
.
fromJson
(
JsonUtils
.
toJson
(
listPageResp
.
apiResp
),
new
TypeReference
<
Xuper013HistoryRespDto
>(){});
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
XupterException
(
XuperErrorEnum
.
SERVER_INNER_ERROR
.
getCode
(),
XuperErrorEnum
.
SERVER_INNER_ERROR
.
getMsg
());
...
...
@@ -512,6 +524,12 @@ public class XuperSdkUtil {
//资产id
long
assetId
=
123
;
BaseDef
.
Resp
<
BaseDef
.
BaseResp
>
baseResp
=
getAsset
().
freezeAsset
(
assetId
,
account
);
log
.
info
(
"xuper014FreezeAsset resp : "
+
JsonUtils
.
toJson
(
baseResp
));
BaseDef
.
RequestRes
requestRes
=
baseResp
.
res
;
if
(
requestRes
.
httpCode
==
200
){
log
.
info
(
"xuper014FreezeAsset apiResp : "
+
JsonUtils
.
toJson
(
baseResp
.
apiResp
));
respDto
=
JsonUtils
.
fromJson
(
JsonUtils
.
toJson
(
baseResp
.
apiResp
),
new
TypeReference
<
Xuper014FreezeAssetRespDto
>(){});
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
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 @
f84811c3
...
...
@@ -495,17 +495,22 @@ public class TestXuperSdkUtil {
@Test
public
void
testXuper012ListSdsByAst
(){
Xuper0
04PublishAssetReqDto
reqDto
=
Xuper004PublishAsse
tReqDto
.
getNew
();
Xuper0
12ListSdsByAstReqDto
reqDto
=
Xuper012ListSdsByAs
tReqDto
.
getNew
();
// 定义返回结果对象
Xuper004PublishAssetRespDto
respDto
=
null
;
long
assetId
=
171095615845019437
l
;
// long assetId = 1532351545249738541l;
Xuper012ListSdsByAstRespDto
respDto
=
null
;
//xuper-skuid-003
long
assetId
=
477060752401870637
l
;
//xuper-skuid-004
assetId
=
2203931451566698285
l
;
//xuper-skuid-008
assetId
=
139521326019882797
l
;
try
{
reqDto
.
setMnemonic
(
creatorMnemonic
);
reqDto
.
setAssetId
(
assetId
);
XuperResponseDto
<
Xuper004PublishAssetRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper004PublishAsset
(
reqDto
);
reqDto
.
setCursor
(
""
);
reqDto
.
setLimit
(
20
);
XuperResponseDto
<
Xuper012ListSdsByAstRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper012ListSdsByAst
(
reqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
04PublishAsse
tRespDto
.
class
);
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
12ListSdsByAs
tRespDto
.
class
);
}
}
catch
(
XupterException
e
)
{
log
.
error
(
"biz error msg "
+
e
.
getMessage
(),
e
);
...
...
@@ -539,24 +544,24 @@ public class TestXuperSdkUtil {
@Test
public
void
testXuper014FreezeAsset
(){
Xuper0
04PublishAssetReqDto
reqDto
=
Xuper004Publish
AssetReqDto
.
getNew
();
Xuper0
14FreezeAssetReqDto
reqDto
=
Xuper014Freeze
AssetReqDto
.
getNew
();
// 定义返回结果对象
Xuper0
04Publish
AssetRespDto
respDto
=
null
;
Xuper0
14Freeze
AssetRespDto
respDto
=
null
;
long
assetId
=
171095615845019437
l
;
// long assetId = 1532351545249738541l;
try
{
reqDto
.
setMnemonic
(
creatorMnemonic
);
reqDto
.
setAssetId
(
assetId
);
XuperResponseDto
<
Xuper0
04PublishAssetRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper004Publish
Asset
(
reqDto
);
XuperResponseDto
<
Xuper0
14FreezeAssetRespDto
>
xuperResponseDto
=
xuperSdkUtil
.
xuper014Freeze
Asset
(
reqDto
);
if
(
xuperResponseDto
.
isSuccess
()){
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
04Publish
AssetRespDto
.
class
);
respDto
=
xuperResponseDto
.
getParseData
(
Xuper0
14Freeze
AssetRespDto
.
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
(
"testXuper0
04Publish
Asset resp : "
+
JsonUtils
.
toJson
(
respDto
));
log
.
info
(
"testXuper0
14Freeze
Asset resp : "
+
JsonUtils
.
toJson
(
respDto
));
}
@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