Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dmhub-plugin
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
qinxunjia
dmhub-plugin
Commits
3589f5f1
Commit
3589f5f1
authored
Jun 27, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信验证码记录
parent
6d84a479
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
0 deletions
+103
-0
DmCodeInfo.java
src/main/java/com/bgy/sms/repository/domain/DmCodeInfo.java
+61
-0
DmCodeMapper.java
...main/java/com/bgy/sms/repository/mapper/DmCodeMapper.java
+8
-0
DmCodeService.java
src/main/java/com/bgy/sms/service/DmCodeService.java
+9
-0
DmCodeServiceImpl.java
...main/java/com/bgy/sms/service/impl/DmCodeServiceImpl.java
+14
-0
MessageServiceImpl.java
...ain/java/com/bgy/sms/service/impl/MessageServiceImpl.java
+11
-0
No files found.
src/main/java/com/bgy/sms/repository/domain/DmCodeInfo.java
0 → 100644
View file @
3589f5f1
package
com
.
bgy
.
sms
.
repository
.
domain
;
import
com.baomidou.mybatisplus.annotations.TableName
;
import
java.util.Date
;
@TableName
(
"dm_code"
)
public
class
DmCodeInfo
{
private
Long
id
;
private
String
mobile
;
private
String
areaId
;
private
String
code
;
private
Date
dateCreated
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getAreaId
()
{
return
areaId
;
}
public
void
setAreaId
(
String
areaId
)
{
this
.
areaId
=
areaId
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Date
getDateCreated
()
{
return
dateCreated
;
}
public
void
setDateCreated
(
Date
dateCreated
)
{
this
.
dateCreated
=
dateCreated
;
}
}
src/main/java/com/bgy/sms/repository/mapper/DmCodeMapper.java
0 → 100644
View file @
3589f5f1
package
com
.
bgy
.
sms
.
repository
.
mapper
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.bgy.sms.repository.domain.DmBatchInfo
;
import
com.bgy.sms.repository.domain.DmCodeInfo
;
public
interface
DmCodeMapper
extends
BaseMapper
<
DmCodeInfo
>
{
}
src/main/java/com/bgy/sms/service/DmCodeService.java
0 → 100644
View file @
3589f5f1
package
com
.
bgy
.
sms
.
service
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.bgy.sms.repository.domain.DmBatchInfo
;
import
com.bgy.sms.repository.domain.DmCodeInfo
;
public
interface
DmCodeService
extends
IService
<
DmCodeInfo
>
{
}
src/main/java/com/bgy/sms/service/impl/DmCodeServiceImpl.java
0 → 100644
View file @
3589f5f1
package
com
.
bgy
.
sms
.
service
.
impl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.bgy.sms.repository.domain.DmBatchInfo
;
import
com.bgy.sms.repository.domain.DmCodeInfo
;
import
com.bgy.sms.repository.mapper.DmBatchMapper
;
import
com.bgy.sms.repository.mapper.DmCodeMapper
;
import
com.bgy.sms.service.DmBatchService
;
import
com.bgy.sms.service.DmCodeService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
DmCodeServiceImpl
extends
ServiceImpl
<
DmCodeMapper
,
DmCodeInfo
>
implements
DmCodeService
{
}
src/main/java/com/bgy/sms/service/impl/MessageServiceImpl.java
View file @
3589f5f1
...
...
@@ -9,9 +9,11 @@ import com.bgy.sms.channel.bgy.service.BgySmsService;
import
com.bgy.sms.channel.dto.*
;
import
com.bgy.sms.config.ResponseCode
;
import
com.bgy.sms.repository.domain.DmBatchInfo
;
import
com.bgy.sms.repository.domain.DmCodeInfo
;
import
com.bgy.sms.repository.domain.SmsTemplateInfo
;
import
com.bgy.sms.repository.domain.SysBatchInfo
;
import
com.bgy.sms.service.DmBatchService
;
import
com.bgy.sms.service.DmCodeService
;
import
com.bgy.sms.service.MessageService
;
import
com.bgy.sms.service.SmsTemplateService
;
import
com.bgy.sms.service.bean.TemplateChangeBean
;
...
...
@@ -42,6 +44,8 @@ public class MessageServiceImpl implements MessageService {
private
BgySmsService
bgySmsService
;
@Autowired
private
DmBatchService
dmBatchService
;
@Autowired
private
DmCodeService
dmCodeService
;
/**
* 短信模板创建
...
...
@@ -265,6 +269,13 @@ public class MessageServiceImpl implements MessageService {
CLBizResponse
response
=
new
CLBizResponse
();
String
content
=
"您的验证码是:"
+
code
;
try
{
DmCodeInfo
codeInfo
=
new
DmCodeInfo
();
codeInfo
.
setId
(
IdHandler
.
nextId
());
codeInfo
.
setAreaId
(
BgySMSConfig
.
areaId
);
codeInfo
.
setCode
(
code
);
codeInfo
.
setMobile
(
mobile
);
codeInfo
.
setDateCreated
(
new
Date
());
dmCodeService
.
insert
(
codeInfo
);
response
=
bgySmsService
.
sendSms
(
mobile
,
content
,
BgySMSConfig
.
areaId
);
String
retCode
=
response
.
getCode
();
if
(
retCode
.
equals
(
ResponseCode
.
SUCCESS
.
getCode
()))
{
...
...
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