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
2f5047d5
Commit
2f5047d5
authored
Apr 22, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试请求
parent
ee15d7ea
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
39 deletions
+56
-39
BizController.java
src/main/java/com/jz/sms/api/BizController.java
+21
-17
SysBatchMapper.java
src/main/java/com/jz/sms/repository/SysBatchMapper.java
+3
-0
TemplateMapper.java
src/main/java/com/jz/sms/repository/TemplateMapper.java
+3
-0
MessageServiceImpl.java
...main/java/com/jz/sms/service/impl/MessageServiceImpl.java
+17
-17
XfaceCreateTempLateWrapper.java
...z/sms/wrapper/maintenance/XfaceCreateTempLateWrapper.java
+1
-1
MessageMapper.xml
src/main/resources/mapper/MessageMapper.xml
+4
-4
SysBatchMapper.xml
src/main/resources/mapper/SysBatchMapper.xml
+7
-0
No files found.
src/main/java/com/jz/sms/api/BizController.java
View file @
2f5047d5
...
...
@@ -3,22 +3,22 @@ package com.jz.sms.api;
import
com.jz.sms.chuanlan.service.ChuanLanSmsService
;
import
com.jz.sms.dto.XfaceDmHubTemplateRequestDTO
;
import
com.jz.sms.dto.XfaceDmHubTemplateResponseDTO
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"test"
)
@RequestMapping
(
"
/
test"
)
public
class
BizController
{
@Autowired
private
ChuanLanSmsService
service
;
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BizController
.
class
);
@RequestMapping
(
"index"
)
public
String
index
()
{
return
"success"
;
}
@Autowired
private
ChuanLanSmsService
service
;
/**
...
...
@@ -26,33 +26,37 @@ public class BizController {
*
* @return
*/
@
Reque
stMapping
(
"/sms/template"
)
public
XfaceDmHubTemplateResponseDTO
template
(
XfaceDmHubTemplateRequestDTO
requestDTO
)
{
XfaceDmHubTemplateResponseDTO
responseDTO
=
service
.
createTemplate
(
requestDTO
);
return
responseDTO
;
@
Po
stMapping
(
"/sms/template"
)
public
String
template
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
log
.
info
(
"**********创建模板入参*******:{}"
,
params
);
return
"ok"
;
}
/**
* 批量发送(通知或营销类)
*
* @return
*/
@
Reque
stMapping
(
"/sms/batch"
)
public
String
batch
()
{
@
Po
stMapping
(
"/sms/batch"
)
public
String
batch
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
log
.
info
(
"**********批量发送入参*******:{}"
,
params
);
return
"success"
;
}
/**
* 发送单条(通知或营销类)
*
* @return
*/
@RequestMapping
(
"/sms/send"
)
public
String
send
()
{
public
String
send
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
log
.
info
(
"**********单条发送入参*******:{}"
,
params
);
return
"success"
;
}
}
src/main/java/com/jz/sms/repository/SysBatchMapper.java
View file @
2f5047d5
...
...
@@ -3,7 +3,10 @@ package com.jz.sms.repository;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.jz.sms.repository.domain.SmsTemplateInfo
;
import
com.jz.sms.repository.domain.SysBatchInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
SysBatchMapper
extends
BaseMapper
<
SysBatchInfo
>
{
...
...
src/main/java/com/jz/sms/repository/TemplateMapper.java
View file @
2f5047d5
...
...
@@ -3,7 +3,10 @@ package com.jz.sms.repository;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.jz.sms.repository.domain.SmsTemplateInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
TemplateMapper
extends
BaseMapper
<
SmsTemplateInfo
>
{
...
...
src/main/java/com/jz/sms/service/impl/MessageServiceImpl.java
View file @
2f5047d5
...
...
@@ -16,11 +16,11 @@ import org.springframework.stereotype.Service;
public
class
MessageServiceImpl
implements
MessageService
{
@Autowired
private
SysBatchMapper
sysBatchMapper
;
@Autowired
private
TemplateMapper
templateMapper
;
//
@Autowired
//
private SysBatchMapper sysBatchMapper;
//
//
@Autowired
//
private TemplateMapper templateMapper;
@Autowired
private
ChuanLanSmsService
chuanLanSmsService
;
...
...
@@ -56,18 +56,18 @@ public class MessageServiceImpl implements MessageService {
String
audienceIdType
=
requestDTO
.
getAudienceIdType
();
JSONObject
data
=
requestDTO
.
getData
();
// 获取模板信息
SmsTemplateInfo
templateInfo
=
templateMapper
.
selectOne
(
new
SmsTemplateInfo
(
templateId
));
if
(
null
==
templateInfo
)
{
return
null
;
}
String
content
=
templateInfo
.
getContent
();
String
smsType
=
templateInfo
.
getType
();
// 系统记录批次,不管是单发还是批量发送都当是批量发送处理
SysBatchInfo
info
=
new
SysBatchInfo
();
info
.
setBatchId
(
IdHandler
.
nextId
());
Integer
insert
=
sysBatchMapper
.
insert
(
info
);
//
SmsTemplateInfo templateInfo = templateMapper.selectOne(new SmsTemplateInfo(templateId));
//
if (null == templateInfo) {
//
return null;
//
}
//
//
String content = templateInfo.getContent();
//
String smsType = templateInfo.getType();
//
//
// 系统记录批次,不管是单发还是批量发送都当是批量发送处理
//
SysBatchInfo info = new SysBatchInfo();
//
info.setBatchId(IdHandler.nextId());
//
Integer insert = sysBatchMapper.insert(info);
// chuanLanSmsService.sendByFixed(content);
...
...
src/main/java/com/jz/sms/wrapper/maintenance/XfaceCreateTempLateWrapper.java
View file @
2f5047d5
...
...
@@ -18,7 +18,7 @@ public class XfaceCreateTempLateWrapper {
XfaceCreateTempLateWrapperImpl
xfaceCreateTempLateWrapperImpl
;
// @ApiOperation(value = "SMS0001 短信模板创建", httpMethod = "POST")
@PostMapping
(
value
=
"/sms/template
/create
"
)
@PostMapping
(
value
=
"/sms/template"
)
@ResponseBody
public
XfaceDmHubTemplateResponseDTO
processRequest
(
@Valid
@RequestBody
XfaceDmHubTemplateRequestDTO
requestDTO
)
{
...
...
src/main/resources/mapper/MessageMapper.xml
View file @
2f5047d5
<
!--<?xml version="1.0" encoding="UTF-8"?>--
>
<!
--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">--
>
<
!--<mapper namespace="com.qianlian.cloud.tms.repository.BaApplicationConfigMapper">--
>
<
?xml version="1.0" encoding="UTF-8"?
>
<!
DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"
>
<
mapper
namespace=
"com.jz.sms.repository.MessageMapper"
>
<!--</mapper>-->
\ No newline at end of file
</mapper>
\ No newline at end of file
src/main/resources/mapper/SysBatchMapper.xml
0 → 100644
View file @
2f5047d5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.sms.repository.SysBatchMapper"
>
</mapper>
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