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
01262836
Commit
01262836
authored
Jul 09, 2021
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改swagger配置
修改nft发行的逻辑
parent
3d8eab2f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
23 deletions
+29
-23
application-dev.yml
joying-admin/src/main/resources/application-dev.yml
+1
-1
application-local.yml
joying-admin/src/main/resources/application-local.yml
+1
-1
application-test.yml
joying-admin/src/main/resources/application-test.yml
+1
-1
ResultCode.java
...common/src/main/java/com/fzm/common/enums/ResultCode.java
+7
-6
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+7
-4
UserServiceImpl.java
...ain/java/com/fzm/common/service/impl/UserServiceImpl.java
+9
-7
application-dev.yml
joying-portal/src/main/resources/application-dev.yml
+1
-1
application-local.yml
joying-portal/src/main/resources/application-local.yml
+1
-1
application-test.yml
joying-portal/src/main/resources/application-test.yml
+1
-1
No files found.
joying-admin/src/main/resources/application-dev.yml
View file @
01262836
...
@@ -67,7 +67,7 @@ spring:
...
@@ -67,7 +67,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
后台管理系统
description
:
乐映影视后台管理系统RESTFUL API
description
:
乐映影视后台管理系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.admin.controller
base-package
:
com.fzm.admin.controller
...
...
joying-admin/src/main/resources/application-local.yml
View file @
01262836
...
@@ -67,7 +67,7 @@ spring:
...
@@ -67,7 +67,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
乐映影视后台管理系统
description
:
乐映影视后台管理系统RESTFUL API
description
:
乐映影视后台管理系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.admin.controller
base-package
:
com.fzm.admin.controller
...
...
joying-admin/src/main/resources/application-test.yml
View file @
01262836
...
@@ -67,7 +67,7 @@ spring:
...
@@ -67,7 +67,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
乐映影视后台管理系统
description
:
乐映影视后台管理系统RESTFUL API
description
:
乐映影视后台管理系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.admin.controller
base-package
:
com.fzm.admin.controller
...
...
joying-common/src/main/java/com/fzm/common/enums/ResultCode.java
View file @
01262836
...
@@ -7,12 +7,13 @@ public enum ResultCode implements IErrorCode {
...
@@ -7,12 +7,13 @@ public enum ResultCode implements IErrorCode {
UNAUTHORIZED
(
401
,
"认证失败"
),
UNAUTHORIZED
(
401
,
"认证失败"
),
FORBIDDEN
(
403
,
"没有相关权限"
),
FORBIDDEN
(
403
,
"没有相关权限"
),
DATA_ERROR
(
601
,
"没找到相关数据"
),
DATA_ERROR
(
601
,
"没找到相关数据"
),
REGISTER_ERROR
(
410
,
"您已注册过"
),
REGISTER_ERROR
(
410
,
"注册失败"
),
LOGIN_ERROR
(
411
,
"登录失败"
),
LOGIN_ERROR
(
411
,
"登录失败"
),
FILE_UPLOAD_ERROR
(
412
,
"文件上传失败"
),
FILE_UPLOAD_ERROR
(
412
,
"文件上传失败"
),
FILE_DOWNLOAD_ERROR
(
412
,
"文件下载失败"
),
FILE_DOWNLOAD_ERROR
(
412
,
"文件下载失败"
),
TOKEN_VALID_ERROR
(
413
,
"token校验失败"
),
TOKEN_VALID_ERROR
(
413
,
"token校验失败"
),
CODE_ERROR
(
414
,
"验证码发送失败"
),
CODE_ERROR
(
414
,
"验证码发送失败"
),
PUBLISH_ERROR
(
415
,
"nft发行失败"
),
;
;
...
...
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
01262836
...
@@ -108,12 +108,15 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
...
@@ -108,12 +108,15 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
String
tokenInfo
=
JsonUtil
.
toJson
(
map
);
String
tokenInfo
=
JsonUtil
.
toJson
(
map
);
log
.
info
(
"加密上链数据: {}"
,
tokenInfo
);
log
.
info
(
"加密上链数据: {}"
,
tokenInfo
);
String
tradeHash
=
paraChainClient
.
evmSetTokenInfo
(
contractName
,
tokenId
,
tokenInfo
,
wallet
,
privkey
,
true
);
String
tradeHash
=
paraChainClient
.
evmSetTokenInfo
(
contractName
,
tokenId
,
tokenInfo
,
wallet
,
privkey
,
true
);
System
.
out
.
println
(
hash
.
equals
(
tradeHash
));
if
(
StringUtils
.
isBlank
(
tradeHash
))
{
if
(
StringUtils
.
isBlank
(
tradeHash
))
{
throw
GlobalException
.
newException
(
ResultCode
.
FAILED
,
"nft发行失败"
);
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
"nft发行失败"
);
}
// 确认交易结果
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
hash
,
true
,
1000
);
if
(!
TxStatusEnum
.
SUCCESS
.
equals
(
txResult
.
getStatus
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
txResult
.
getErrMsg
().
getValue
());
}
}
paraChainClient
.
cycleConfirmTxWithHash
(
hash
,
true
,
1200
);
nft
.
setNftHash
(
hash
);
nft
.
setNftHash
(
split
[
0
]);
nft
.
setTokenId
(
tokenId
);
nft
.
setTokenId
(
tokenId
);
nft
.
setPublishTime
(
new
Date
());
nft
.
setPublishTime
(
new
Date
());
nft
.
setNftId
(
nftDto
.
getNftId
());
nft
.
setNftId
(
nftDto
.
getNftId
());
...
...
joying-common/src/main/java/com/fzm/common/service/impl/UserServiceImpl.java
View file @
01262836
...
@@ -5,6 +5,8 @@ import cn.fzm.chain.simplesdk.client.ParaChainClient;
...
@@ -5,6 +5,8 @@ import cn.fzm.chain.simplesdk.client.ParaChainClient;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.util.IdUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fzm.common.constant.SystemConstant
;
import
com.fzm.common.constant.SystemConstant
;
...
@@ -24,6 +26,7 @@ import com.fzm.common.service.UserService;
...
@@ -24,6 +26,7 @@ import com.fzm.common.service.UserService;
import
com.fzm.common.utils.RedisUtil
;
import
com.fzm.common.utils.RedisUtil
;
import
com.fzm.common.utils.SmsUtil
;
import
com.fzm.common.utils.SmsUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -82,6 +85,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
...
@@ -82,6 +85,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
// 当前手机号或者邮箱没有注册过,走注册逻辑
// 当前手机号或者邮箱没有注册过,走注册逻辑
User
registerUser
=
new
User
();
User
registerUser
=
new
User
();
BeanUtil
.
copyProperties
(
param
,
registerUser
,
true
);
BeanUtil
.
copyProperties
(
param
,
registerUser
,
true
);
// 生成钱包
String
wallet
=
paraClient
.
walletCreateAccount
(
IdUtil
.
simpleUUID
());
if
(
StringUtils
.
isBlank
(
wallet
))
{
throw
GlobalException
.
newException
(
ResultCode
.
UNAUTHORIZED
,
"注册失败,生成区块链钱包异常,请稍后再试"
);
}
registerUser
.
setWallet
(
wallet
);
if
(
StringUtils
.
isNotBlank
(
param
.
getPassword
()))
{
if
(
StringUtils
.
isNotBlank
(
param
.
getPassword
()))
{
registerUser
.
setPassword
(
passwordEncoder
.
encode
(
param
.
getPassword
()));
registerUser
.
setPassword
(
passwordEncoder
.
encode
(
param
.
getPassword
()));
}
else
{
}
else
{
...
@@ -91,13 +100,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
...
@@ -91,13 +100,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
}
}
}
}
save
(
registerUser
);
save
(
registerUser
);
// 生成钱包
String
wallet
=
paraClient
.
walletCreateAccount
(
registerUser
.
getId
().
toString
());
if
(
StringUtils
.
isNotBlank
(
wallet
))
{
User
u
=
new
User
().
setId
(
registerUser
.
getId
()).
setWallet
(
wallet
);
updateById
(
u
);
}
// 用户注册后,需要删除用户概览的缓存
redisUtil
.
delete
(
"user::statistic"
);
redisUtil
.
delete
(
"user::statistic"
);
return
getById
(
registerUser
.
getId
());
return
getById
(
registerUser
.
getId
());
}
else
{
}
else
{
...
...
joying-portal/src/main/resources/application-dev.yml
View file @
01262836
...
@@ -71,7 +71,7 @@ spring:
...
@@ -71,7 +71,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
门户系统
description
:
乐映影视门户系统RESTFUL API
description
:
乐映影视门户系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.portal.controller
base-package
:
com.fzm.portal.controller
...
...
joying-portal/src/main/resources/application-local.yml
View file @
01262836
...
@@ -71,7 +71,7 @@ spring:
...
@@ -71,7 +71,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
门户系统
description
:
乐映影视门户系统RESTFUL API
description
:
乐映影视门户系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.portal.controller
base-package
:
com.fzm.portal.controller
...
...
joying-portal/src/main/resources/application-test.yml
View file @
01262836
...
@@ -71,7 +71,7 @@ spring:
...
@@ -71,7 +71,7 @@ spring:
is-concurrent
:
false
is-concurrent
:
false
swagger
:
swagger
:
title
:
乐映影视
title
:
乐映影视
门户系统
description
:
乐映影视门户系统RESTFUL API
description
:
乐映影视门户系统RESTFUL API
version
:
1.0.0
version
:
1.0.0
base-package
:
com.fzm.portal.controller
base-package
:
com.fzm.portal.controller
...
...
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