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
04d254e0
Commit
04d254e0
authored
Jul 27, 2021
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加转让nft的短信模板
修改主题接口
parent
d32bd475
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
79 additions
and
34 deletions
+79
-34
LabelController.java
...c/main/java/com/fzm/admin/controller/LabelController.java
+5
-4
SmsProperties.java
...rc/main/java/com/fzm/common/properties/SmsProperties.java
+22
-3
LabelService.java
...on/src/main/java/com/fzm/common/service/LabelService.java
+1
-1
CommemorateNftServiceImpl.java
...om/fzm/common/service/impl/CommemorateNftServiceImpl.java
+0
-3
LabelServiceImpl.java
...in/java/com/fzm/common/service/impl/LabelServiceImpl.java
+9
-3
NftServiceImpl.java
...main/java/com/fzm/common/service/impl/NftServiceImpl.java
+15
-3
UserServiceImpl.java
...ain/java/com/fzm/common/service/impl/UserServiceImpl.java
+3
-3
LabelController.java
.../main/java/com/fzm/portal/controller/LabelController.java
+4
-3
VerificationCodeController.java
...com/fzm/portal/controller/VerificationCodeController.java
+2
-2
application-dev.yml
joying-portal/src/main/resources/application-dev.yml
+6
-3
application-local.yml
joying-portal/src/main/resources/application-local.yml
+6
-3
application-test.yml
joying-portal/src/main/resources/application-test.yml
+6
-3
No files found.
joying-admin/src/main/java/com/fzm/admin/controller/LabelController.java
View file @
04d254e0
...
...
@@ -7,6 +7,7 @@ import com.fzm.common.service.LabelService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -26,9 +27,9 @@ public class LabelController {
@Resource
private
LabelService
labelService
;
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询所有
标签
信息"
)
public
ResponseModel
<
List
<
Label
>>
list
()
{
return
ResponseModel
.
success
(
labelService
.
listAll
());
@GetMapping
(
"/list
/{categoryId}
"
)
@ApiOperation
(
value
=
"查询所有
主题
信息"
)
public
ResponseModel
<
List
<
Label
>>
list
(
@PathVariable
Integer
categoryId
)
{
return
ResponseModel
.
success
(
labelService
.
listAll
(
categoryId
));
}
}
joying-common/src/main/java/com/fzm/common/properties/SmsProperties.java
View file @
04d254e0
package
com
.
fzm
.
common
.
properties
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
...
...
@@ -13,17 +14,35 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties
(
prefix
=
"sms"
)
public
class
SmsProperties
{
@ApiModelProperty
(
"app key"
)
private
String
appKey
;
@ApiModelProperty
(
"app秘钥"
)
private
String
appSecret
;
@ApiModelProperty
(
"发送短信验证码接口地址"
)
private
String
sendSmsUrl
;
@ApiModelProperty
(
"校验验证码接口地址"
)
private
String
validateCodeUrl
;
private
String
messageLoginCodetype
;
@ApiModelProperty
(
"登录短信验证码模板"
)
private
String
loginMessageCodetype
;
@ApiModelProperty
(
"登录邮件验证码模板"
)
private
String
loginMailCodetype
;
@ApiModelProperty
(
"登录语音验证码模板"
)
private
String
loginVoiceCodetype
;
@ApiModelProperty
(
"转让nft短信验证码模板"
)
private
String
transferNftMessageCodetype
;
@ApiModelProperty
(
"转让nft邮件验证码模板"
)
private
String
transferNftEmailCodetype
;
@ApiModelProperty
(
"转让nft语言验证码模板"
)
private
String
transferNftVoiceCodetype
;
private
String
emailLoginCodetype
;
private
String
voiceLoginCodetype
;
}
joying-common/src/main/java/com/fzm/common/service/LabelService.java
View file @
04d254e0
...
...
@@ -12,6 +12,6 @@ import java.util.List;
*/
public
interface
LabelService
extends
IService
<
Label
>
{
List
<
Label
>
listAll
();
List
<
Label
>
listAll
(
Integer
categoryId
);
}
joying-common/src/main/java/com/fzm/common/service/impl/CommemorateNftServiceImpl.java
View file @
04d254e0
...
...
@@ -79,9 +79,6 @@ public class CommemorateNftServiceImpl extends ServiceImpl<CommemorateNftMapper,
long
tokenId
=
Long
.
parseLong
(
split
[
1
]);
// 构建上链信息
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"publishAddress"
,
user
.
getWallet
());
map
.
put
(
"name"
,
commemorateNft
.
getName
());
map
.
put
(
"author"
,
user
.
getNickname
());
map
.
put
(
"hash"
,
commemorateNft
.
getFileHash
());
String
tokenInfo
=
JSONUtil
.
toJsonStr
(
map
);
log
.
info
(
"加密上链数据: {}"
,
tokenInfo
);
...
...
joying-common/src/main/java/com/fzm/common/service/impl/LabelServiceImpl.java
View file @
04d254e0
package
com
.
fzm
.
common
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fzm.common.entity.Category
;
import
com.fzm.common.entity.Label
;
...
...
@@ -10,6 +11,7 @@ import com.fzm.common.service.LabelService;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
...
...
@@ -19,10 +21,14 @@ import java.util.List;
@Service
public
class
LabelServiceImpl
extends
ServiceImpl
<
LabelMapper
,
Label
>
implements
LabelService
{
@Resource
private
LabelMapper
labelMapper
;
@Override
@Cacheable
(
value
=
"label"
,
key
=
"'list'"
)
public
List
<
Label
>
listAll
()
{
return
list
();
@Cacheable
(
value
=
"label:list"
,
key
=
"#categoryId"
)
public
List
<
Label
>
listAll
(
Integer
categoryId
)
{
QueryWrapper
<
Label
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"category_id"
,
categoryId
);
return
labelMapper
.
selectList
(
queryWrapper
);
}
}
joying-common/src/main/java/com/fzm/common/service/impl/NftServiceImpl.java
View file @
04d254e0
...
...
@@ -126,7 +126,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
if
(
StringUtils
.
isBlank
(
tradeHash
))
{
throw
GlobalException
.
newException
(
ResultCode
.
PUBLISH_ERROR
,
"nft发行失败"
);
}
log
.
info
(
"tokenInfo:{}"
,
paraChainClient
.
evmGetTokenInfo
(
contractName
,
paraChainClient
.
evmQueryAddrByName
(
contractName
),
tokenId
,
wallet
));
log
.
info
(
"tokenInfo:{}"
,
paraChainClient
.
evmGetTokenInfo
(
contractName
,
paraChainClient
.
evmQueryAddrByName
(
contractName
),
tokenId
,
wallet
));
// 确认交易结果
TxResult
txResult
=
paraChainClient
.
cycleConfirmTxWithHash
(
hash
,
true
,
1000
);
if
(!
TxStatusEnum
.
SUCCESS
.
equals
(
txResult
.
getStatus
()))
{
...
...
@@ -160,8 +160,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"您无权转让他人的nft"
);
}
// 校验短信验证码
// todo 现在用的是登录验证码模板,后续需要修改短信模板
if
(!
smsUtil
.
validateCode
(
smsProperties
.
getMessageLoginCodetype
(),
user
.
getTelephone
(),
param
.
getCode
(),
param
.
getCodeType
()))
{
if
(!
smsUtil
.
validateCode
(
getCodeType
(
param
.
getCodeType
()),
user
.
getTelephone
(),
param
.
getCode
(),
param
.
getCodeType
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
TRANSFER_ERROR
,
"短信验证码校验失败"
);
}
// 校验接收人的个人信息
...
...
@@ -204,6 +203,19 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
return
true
;
}
private
String
getCodeType
(
String
type
)
{
switch
(
type
)
{
case
"sms"
:
return
smsProperties
.
getTransferNftMessageCodetype
();
case
"email"
:
return
smsProperties
.
getTransferNftEmailCodetype
();
case
"voice"
:
return
smsProperties
.
getTransferNftVoiceCodetype
();
default
:
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
,
"短信类型【"
+
type
+
"】的传参有误,取值范围是{sms,email,voice}"
);
}
}
@Override
public
List
<
Nft
>
list
(
Integer
pageNum
,
Integer
pageSize
,
Integer
categoryId
)
{
return
nftMapper
.
list
(
pageNum
,
pageSize
,
categoryId
);
...
...
joying-common/src/main/java/com/fzm/common/service/impl/UserServiceImpl.java
View file @
04d254e0
...
...
@@ -138,11 +138,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
public
String
getLoginCodeType
(
String
type
)
{
switch
(
type
)
{
case
"sms"
:
return
smsProperties
.
get
MessageLogin
Codetype
();
return
smsProperties
.
get
LoginMessage
Codetype
();
case
"email"
:
return
smsProperties
.
get
EmailLogin
Codetype
();
return
smsProperties
.
get
LoginMail
Codetype
();
case
"voice"
:
return
smsProperties
.
get
VoiceLogin
Codetype
();
return
smsProperties
.
get
LoginVoice
Codetype
();
default
:
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
,
"短信类型【"
+
type
+
"】的传参有误,取值范围是{sms,email,voice}"
);
}
...
...
joying-portal/src/main/java/com/fzm/portal/controller/LabelController.java
View file @
04d254e0
...
...
@@ -6,6 +6,7 @@ import com.fzm.common.service.LabelService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -24,9 +25,9 @@ public class LabelController {
@Resource
private
LabelService
labelService
;
@GetMapping
(
"/list"
)
@GetMapping
(
"/list
/{categoryId}
"
)
@ApiOperation
(
value
=
"查询所有主题信息"
)
public
ResponseModel
<
List
<
Label
>>
list
()
{
return
ResponseModel
.
success
(
labelService
.
listAll
());
public
ResponseModel
<
List
<
Label
>>
list
(
@PathVariable
Integer
categoryId
)
{
return
ResponseModel
.
success
(
labelService
.
listAll
(
categoryId
));
}
}
joying-portal/src/main/java/com/fzm/portal/controller/VerificationCodeController.java
View file @
04d254e0
...
...
@@ -58,7 +58,7 @@ public class VerificationCodeController {
if
(
user
==
null
||
StringUtils
.
isBlank
(
user
.
getTelephone
()))
{
throw
GlobalException
.
newException
(
ResultCode
.
UNAUTHORIZED
,
"当前用户的手机号为空"
);
}
Boolean
result
=
smsUtil
.
sendSms
(
smsProperties
.
get
MessageLogin
Codetype
(),
user
.
getTelephone
());
Boolean
result
=
smsUtil
.
sendSms
(
smsProperties
.
get
TransferNftMessage
Codetype
(),
user
.
getTelephone
());
return
ResponseModel
.
success
(
result
);
}
...
...
@@ -66,7 +66,7 @@ public class VerificationCodeController {
private
String
getCodeType
(
Integer
type
)
{
switch
(
type
)
{
case
1
:
return
smsProperties
.
get
MessageLogin
Codetype
();
return
smsProperties
.
get
LoginMessage
Codetype
();
default
:
throw
GlobalException
.
newException
(
ResultCode
.
CODE_ERROR
);
}
...
...
joying-portal/src/main/resources/application-dev.yml
View file @
04d254e0
...
...
@@ -70,11 +70,14 @@ swagger:
sms
:
app-key
:
Yiru
app-secret
:
mx5oaR^RY8!(ziHn
message-login
-codetype
:
quick
email-login
-codetype
:
quick
voice-login
-codetype
:
quick
login-message
-codetype
:
quick
login-email
-codetype
:
quick
login-voice
-codetype
:
quick
send-sms-url
:
http://118.31.52.32/send/sms2
validate-code-url
:
http://118.31.52.32/validate/code
transfer-nft-message-codetype
:
notice_transfer
transfer-nft-email-codetype
:
notice_transfer
transfer-nft-voice-codetype
:
notice_transfer
chain
:
para
:
...
...
joying-portal/src/main/resources/application-local.yml
View file @
04d254e0
...
...
@@ -87,11 +87,14 @@ aliyun:
sms
:
app-key
:
Yiru
app-secret
:
mx5oaR^RY8!(ziHn
message-login
-codetype
:
quick
email-login
-codetype
:
quick
voice-login
-codetype
:
quick
login-message
-codetype
:
quick
login-email
-codetype
:
quick
login-voice
-codetype
:
quick
send-sms-url
:
http://118.31.52.32/send/sms2
validate-code-url
:
http://118.31.52.32/validate/code
transfer-nft-message-codetype
:
notice_transfer
transfer-nft-email-codetype
:
notice_transfer
transfer-nft-voice-codetype
:
notice_transfer
chain
:
para
:
...
...
joying-portal/src/main/resources/application-test.yml
View file @
04d254e0
...
...
@@ -79,11 +79,14 @@ swagger:
sms
:
app-key
:
Yiru
app-secret
:
mx5oaR^RY8!(ziHn
message-login
-codetype
:
quick
email-login
-codetype
:
quick
voice-login
-codetype
:
quick
login-message
-codetype
:
quick
login-email
-codetype
:
quick
login-voice
-codetype
:
quick
send-sms-url
:
http://118.31.52.32/send/sms2
validate-code-url
:
http://118.31.52.32/validate/code
transfer-nft-message-codetype
:
notice_transfer
transfer-nft-email-codetype
:
notice_transfer
transfer-nft-voice-codetype
:
notice_transfer
chain
:
para
:
...
...
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