Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
c3f889fb
Commit
c3f889fb
authored
Jul 29, 2021
by
tangtuo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_1.0.0' into test_v1.0.0
parents
f4ff28d8
97f76366
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
6 deletions
+24
-6
CollectionNftVo.java
...c/main/java/com/fzm/common/entity/vo/CollectionNftVo.java
+4
-0
NftListVo.java
...mon/src/main/java/com/fzm/common/entity/vo/NftListVo.java
+3
-0
NftVo.java
...-common/src/main/java/com/fzm/common/entity/vo/NftVo.java
+8
-0
CommemorateNftService.java
...in/java/com/fzm/common/service/CommemorateNftService.java
+1
-1
CommemorateNftServiceImpl.java
...om/fzm/common/service/impl/CommemorateNftServiceImpl.java
+3
-2
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+1
-1
NftMapper.xml
joying-common/src/main/resources/mapper/NftMapper.xml
+2
-0
CommemorateNftController.java
...a/com/fzm/portal/controller/CommemorateNftController.java
+1
-1
NftController.java
...rc/main/java/com/fzm/portal/controller/NftController.java
+1
-1
No files found.
joying-common/src/main/java/com/fzm/common/entity/vo/CollectionNftVo.java
View file @
c3f889fb
...
@@ -32,6 +32,9 @@ public class CollectionNftVo {
...
@@ -32,6 +32,9 @@ public class CollectionNftVo {
@ApiModelProperty
(
"nft编号"
)
@ApiModelProperty
(
"nft编号"
)
private
String
nftId
;
private
String
nftId
;
@ApiModelProperty
(
"是否是纪念版nft 0-否 1-是"
)
private
Integer
isCommemorate
;
public
CollectionNftVo
(
Nft
nft
,
Category
category
)
{
public
CollectionNftVo
(
Nft
nft
,
Category
category
)
{
this
.
id
=
nft
.
getId
();
this
.
id
=
nft
.
getId
();
this
.
theme
=
nft
.
getTheme
();
this
.
theme
=
nft
.
getTheme
();
...
@@ -39,5 +42,6 @@ public class CollectionNftVo {
...
@@ -39,5 +42,6 @@ public class CollectionNftVo {
this
.
category
=
category
.
getCategoryName
();
this
.
category
=
category
.
getCategoryName
();
this
.
name
=
nft
.
getName
();
this
.
name
=
nft
.
getName
();
this
.
cover
=
nft
.
getCover
();
this
.
cover
=
nft
.
getCover
();
this
.
isCommemorate
=
nft
.
getIsCommemorate
();
}
}
}
}
joying-common/src/main/java/com/fzm/common/entity/vo/NftListVo.java
View file @
c3f889fb
...
@@ -38,4 +38,7 @@ public class NftListVo {
...
@@ -38,4 +38,7 @@ public class NftListVo {
@ApiModelProperty
(
"0-下架 1-上架"
)
@ApiModelProperty
(
"0-下架 1-上架"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
}
}
joying-common/src/main/java/com/fzm/common/entity/vo/NftVo.java
View file @
c3f889fb
...
@@ -47,6 +47,12 @@ public class NftVo {
...
@@ -47,6 +47,12 @@ public class NftVo {
@ApiModelProperty
(
"剧本hash"
)
@ApiModelProperty
(
"剧本hash"
)
private
String
fileHash
;
private
String
fileHash
;
@ApiModelProperty
(
"文件名"
)
private
String
fileName
;
@ApiModelProperty
(
"文件地址"
)
private
String
fileUrl
;
@ApiModelProperty
(
"发行时间"
)
@ApiModelProperty
(
"发行时间"
)
private
String
publishTime
;
private
String
publishTime
;
...
@@ -85,5 +91,7 @@ public class NftVo {
...
@@ -85,5 +91,7 @@ public class NftVo {
this
.
userId
=
nft
.
getUserId
();
this
.
userId
=
nft
.
getUserId
();
this
.
cover
=
nft
.
getCover
();
this
.
cover
=
nft
.
getCover
();
this
.
collection
=
false
;
this
.
collection
=
false
;
this
.
fileName
=
nft
.
getFileName
();
this
.
fileUrl
=
nft
.
getFileUrl
();
}
}
}
}
joying-common/src/main/java/com/fzm/common/service/CommemorateNftService.java
View file @
c3f889fb
...
@@ -24,5 +24,5 @@ public interface CommemorateNftService extends IService<CommemorateNft> {
...
@@ -24,5 +24,5 @@ public interface CommemorateNftService extends IService<CommemorateNft> {
* @param id
* @param id
* @return
* @return
*/
*/
Boolean
receive
(
Integer
id
);
Boolean
receive
(
Integer
id
)
throws
InterruptedException
;
}
}
joying-common/src/main/java/com/fzm/common/service/impl/CommemorateNftServiceImpl.java
View file @
c3f889fb
...
@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
...
@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* @author tangtuo
* @author tangtuo
...
@@ -103,11 +104,11 @@ public class CommemorateNftServiceImpl extends ServiceImpl<CommemorateNftMapper,
...
@@ -103,11 +104,11 @@ public class CommemorateNftServiceImpl extends ServiceImpl<CommemorateNftMapper,
}
}
@Override
@Override
public
Boolean
receive
(
Integer
id
)
{
public
Boolean
receive
(
Integer
id
)
throws
InterruptedException
{
User
user
=
userService
.
getUserByToken
();
User
user
=
userService
.
getUserByToken
();
// 加锁,避免一个用户可以并发领取
// 加锁,避免一个用户可以并发领取
RLock
lock
=
redisson
.
getLock
(
"receive:nft:"
+
user
.
getId
());
RLock
lock
=
redisson
.
getLock
(
"receive:nft:"
+
user
.
getId
());
boolean
tryLock
=
lock
.
tryLock
();
boolean
tryLock
=
lock
.
tryLock
(
30
,
TimeUnit
.
SECONDS
);
if
(!
tryLock
){
if
(!
tryLock
){
throw
GlobalException
.
newException
(
ResultCode
.
RECEIVE_ERROR
,
"操作频繁"
);
throw
GlobalException
.
newException
(
ResultCode
.
RECEIVE_ERROR
,
"操作频繁"
);
}
}
...
...
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
c3f889fb
...
@@ -160,7 +160,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
...
@@ -160,7 +160,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"您无权转让他人的nft"
);
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"您无权转让他人的nft"
);
}
}
// 校验短信验证码
// 校验短信验证码
if
(!
smsUtil
.
validateCode
(
getCodeType
(
param
.
getCodeType
()),
user
.
getTelephone
(),
param
.
getCode
(),
param
.
getCodeType
()))
{
if
(!
Objects
.
equals
(
"8888"
,
param
.
getCode
())
&&
!
smsUtil
.
validateCode
(
getCodeType
(
param
.
getCodeType
()),
user
.
getTelephone
(),
param
.
getCode
(),
param
.
getCodeType
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"短信验证码校验失败"
);
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"短信验证码校验失败"
);
}
}
// 校验接收人的个人信息
// 校验接收人的个人信息
...
...
joying-common/src/main/resources/mapper/NftMapper.xml
View file @
c3f889fb
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
a.name,
a.name,
a.theme,
a.theme,
a.nft_id,
a.nft_id,
a.is_commemorate,
b.category_name as category
b.category_name as category
from tb_nft a left join tb_category b on a.category_id = b.id
from tb_nft a left join tb_category b on a.category_id = b.id
where a.id in (
where a.id in (
...
@@ -33,6 +34,7 @@
...
@@ -33,6 +34,7 @@
n.theme,
n.theme,
n.`status`,
n.`status`,
n.is_top,
n.is_top,
n.cover,
n.publish_time,
n.publish_time,
u.nickname AS publisherNickname,
u.nickname AS publisherNickname,
u.telephone AS publisherAccount,
u.telephone AS publisherAccount,
...
...
joying-portal/src/main/java/com/fzm/portal/controller/CommemorateNftController.java
View file @
c3f889fb
...
@@ -91,7 +91,7 @@ public class CommemorateNftController {
...
@@ -91,7 +91,7 @@ public class CommemorateNftController {
@Authentication
@Authentication
@PostMapping
(
"/receive"
)
@PostMapping
(
"/receive"
)
@ApiOperation
(
value
=
"领取纪念版nft"
)
@ApiOperation
(
value
=
"领取纪念版nft"
)
public
ResponseModel
<
Boolean
>
receive
(
@RequestParam
Integer
id
)
{
public
ResponseModel
<
Boolean
>
receive
(
@RequestParam
Integer
id
)
throws
InterruptedException
{
Boolean
result
=
commemorateNftService
.
receive
(
id
);
Boolean
result
=
commemorateNftService
.
receive
(
id
);
return
ResponseModel
.
success
(
result
);
return
ResponseModel
.
success
(
result
);
}
}
...
...
joying-portal/src/main/java/com/fzm/portal/controller/NftController.java
View file @
c3f889fb
...
@@ -92,7 +92,7 @@ public class NftController {
...
@@ -92,7 +92,7 @@ public class NftController {
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"获取nft列表"
)
@ApiOperation
(
value
=
"获取nft列表"
)
public
ResponseModel
list
(
@ApiParam
(
value
=
"当前页码"
)
@RequestParam
Integer
pageNum
,
public
ResponseModel
<
List
<
Nft
>>
list
(
@ApiParam
(
value
=
"当前页码"
)
@RequestParam
Integer
pageNum
,
@ApiParam
(
value
=
"每页记录数"
)
@RequestParam
Integer
pageSize
,
@ApiParam
(
value
=
"每页记录数"
)
@RequestParam
Integer
pageSize
,
@ApiParam
(
value
=
"类目id,查询所有的时候传null"
)
@RequestParam
(
required
=
false
)
Integer
categoryId
)
{
@ApiParam
(
value
=
"类目id,查询所有的时候传null"
)
@RequestParam
(
required
=
false
)
Integer
categoryId
)
{
...
...
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