Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
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
姚本章
dm_project
Commits
fc6e1d4e
Commit
fc6e1d4e
authored
Dec 03, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Plain Diff
commit
parents
faeff6ae
8684ae6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
7 deletions
+84
-7
ValidateCodeController.java
...ll/moduls/controller/customer/ValidateCodeController.java
+80
-0
FinanceTradeFlowController.java
...moduls/controller/finance/FinanceTradeFlowController.java
+1
-1
FinanceCustomerAssetsDao.java
...om/jz/dm/mall/moduls/mapper/FinanceCustomerAssetsDao.java
+1
-0
MallCustomerService.java
...va/com/jz/dm/mall/moduls/service/MallCustomerService.java
+1
-3
MallCustomerServiceImpl.java
.../dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
+1
-3
No files found.
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/customer/ValidateCodeController.java
0 → 100644
View file @
fc6e1d4e
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
customer
;
import
com.jz.common.constant.RedisMessageConstant
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.SMSUtils
;
import
com.jz.common.utils.ValidateCodeUtils
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.JedisPool
;
/**
* @ClassName: 短信发送接口
* @Author: Carl
* @Date: 2020/12/2
* @Version:
*/
@RestController
@RequestMapping
(
"/validateCode"
)
@Api
(
tags
=
"短信发送api"
)
public
class
ValidateCodeController
{
@Autowired
private
JedisPool
jedisPool
;
/**
* 注册时发送的验证码
* @param telephone
* @return
*/
@PostMapping
(
"/send4Login"
)
public
Result
send4Login
(
String
telephone
)
{
// 查询redis里是否存在该手机号
Jedis
jedis
=
jedisPool
.
getResource
();
String
key
=
RedisMessageConstant
.
SENDTYPE_LOGIN
+
"_"
+
telephone
;
String
codeInRedis
=
jedis
.
get
(
key
);
if
(
codeInRedis
!=
null
&&
!
codeInRedis
.
equals
(
""
))
{
// redis中的数据还未过期
return
new
Result
(
false
,
"验证码已发送,请注意查收!"
);
}
else
{
Integer
code
=
ValidateCodeUtils
.
generateValidateCode
(
6
);
try
{
SMSUtils
.
sendShortMessage
(
SMSUtils
.
VALIDATE_CODE
,
telephone
,
code
.
toString
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
jedis
.
setex
(
key
,
5
*
60
,
code
+
""
);
return
new
Result
(
true
,
"验证码发送成功!"
);
}
}
/**
* 修改密码发送验证码
* @param telephone
* @return
*/
@PostMapping
(
"/send4Code"
)
public
Result
send4Code
(
String
telephone
)
{
// 查询redis里是否存在该手机号
Jedis
jedis
=
jedisPool
.
getResource
();
String
key
=
RedisMessageConstant
.
SENDTYPE_GETPWD
+
"_"
+
telephone
;
String
codeInRedis
=
jedis
.
get
(
key
);
if
(
codeInRedis
!=
null
&&
!
codeInRedis
.
equals
(
""
))
{
// redis中的数据还未过期
return
new
Result
(
false
,
"验证码已发送,请注意查收!"
);
}
else
{
Integer
code
=
ValidateCodeUtils
.
generateValidateCode
(
6
);
try
{
SMSUtils
.
sendShortMessage
(
SMSUtils
.
VALIDATE_CODE
,
telephone
,
code
.
toString
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
jedis
.
setex
(
key
,
5
*
60
,
code
+
""
);
return
new
Result
(
true
,
"验证码发送成功!"
);
}
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/finance/FinanceTradeFlowController.java
View file @
fc6e1d4e
...
...
@@ -37,7 +37,7 @@ public class FinanceTradeFlowController extends BaseController {
@GetMapping
(
value
=
"/getAccountMoney"
)
@ApiOperation
(
value
=
"充值----获取账户余额"
,
notes
=
"获取账户余额"
)
public
Result
<
OrderDto
>
getAccountMoney
(
HttpServletRequest
req
)
throws
Exception
{
//
return
new
Result
<>();
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/FinanceCustomerAssetsDao.java
View file @
fc6e1d4e
package
com
.
jz
.
dm
.
mall
.
moduls
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.dm.mall.moduls.entity.FinanceCustomerAssets
;
/**
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/MallCustomerService.java
View file @
fc6e1d4e
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
java.util.Map
;
import
com.jz.common.entity.MallCustomer
;
/**
* 商城用户(TMallCustomer)表服务接口
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/MallCustomerServiceImpl.java
View file @
fc6e1d4e
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
com.jz.common.entity.MallCustomer
;
import
com.jz.dm.mall.moduls.mapper.MallCustomerDao
;
import
com.jz.dm.mall.moduls.service.MallCustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
/**
* 商城用户(TMallCustomer)表服务实现类
...
...
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