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
daf1bf26
Commit
daf1bf26
authored
Apr 26, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结构变化,回执基本流程
parent
f1a19ceb
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
355 additions
and
56 deletions
+355
-56
pom.xml
pom.xml
+4
-0
ChuangLanApi.java
src/main/java/com/jz/sms/channel/api/ChuangLanApi.java
+5
-5
DmHubApi.java
src/main/java/com/jz/sms/channel/api/DmHubApi.java
+2
-2
ChuangLanSMSConfig.java
...m/jz/sms/channel/chuanglan/config/ChuangLanSMSConfig.java
+1
-1
CLBizResponse.java
.../java/com/jz/sms/channel/chuanglan/dto/CLBizResponse.java
+2
-1
CLNotifyRequest.java
...ava/com/jz/sms/channel/chuanglan/dto/CLNotifyRequest.java
+1
-1
CLSendFixedRequest.java
.../com/jz/sms/channel/chuanglan/dto/CLSendFixedRequest.java
+1
-1
CLSendSMSResponse.java
...a/com/jz/sms/channel/chuanglan/dto/CLSendSMSResponse.java
+1
-1
CLSendVariableRequest.java
...m/jz/sms/channel/chuanglan/dto/CLSendVariableRequest.java
+1
-1
CLSendVariableResponse.java
.../jz/sms/channel/chuanglan/dto/CLSendVariableResponse.java
+1
-1
CLTemplateRequest.java
...a/com/jz/sms/channel/chuanglan/dto/CLTemplateRequest.java
+4
-0
ReportDto.java
...main/java/com/jz/sms/channel/chuanglan/dto/ReportDto.java
+1
-1
ChuangLanSmsService.java
...jz/sms/channel/chuanglan/service/ChuangLanSmsService.java
+4
-5
ChuangLanSmsServiceImpl.java
...annel/chuanglan/service/impl/ChuangLanSmsServiceImpl.java
+11
-9
ChuangLanSmsUtil.java
.../com/jz/sms/channel/chuanglan/utils/ChuangLanSmsUtil.java
+1
-1
DmHubConfig.java
...ain/java/com/jz/sms/channel/dmHub/config/DmHubConfig.java
+10
-1
DmHubService.java
...n/java/com/jz/sms/channel/dmHub/service/DmHubService.java
+5
-3
DmHubServiceImpl.java
...m/jz/sms/channel/dmHub/service/impl/DmHubServiceImpl.java
+85
-0
DmHubBatchSendRequest.java
...in/java/com/jz/sms/channel/dto/DmHubBatchSendRequest.java
+1
-1
DmHubSendRequest.java
src/main/java/com/jz/sms/channel/dto/DmHubSendRequest.java
+1
-3
DmHubSendResponse.java
src/main/java/com/jz/sms/channel/dto/DmHubSendResponse.java
+1
-1
DmHubTemplateRequest.java
...ain/java/com/jz/sms/channel/dto/DmHubTemplateRequest.java
+1
-1
DmHubTemplateResponse.java
...in/java/com/jz/sms/channel/dto/DmHubTemplateResponse.java
+1
-1
DmhubReport.java
src/main/java/com/jz/sms/channel/dto/DmhubReport.java
+27
-0
ReportDetail.java
src/main/java/com/jz/sms/channel/dto/ReportDetail.java
+111
-0
RedisConfig.java
src/main/java/com/jz/sms/config/RedisConfig.java
+34
-0
MessageService.java
src/main/java/com/jz/sms/service/MessageService.java
+1
-1
MessageServiceImpl.java
...main/java/com/jz/sms/service/impl/MessageServiceImpl.java
+7
-7
XfaceCreateTempLateWrapper.java
...z/sms/wrapper/maintenance/XfaceCreateTempLateWrapper.java
+2
-2
XfaceCreateTempLateWrapperImpl.java
...s/wrapper/maintenance/XfaceCreateTempLateWrapperImpl.java
+2
-2
application-prod.yml
src/main/resources/application-prod.yml
+13
-2
application-test.yml
src/main/resources/application-test.yml
+13
-1
No files found.
pom.xml
View file @
daf1bf26
...
...
@@ -95,6 +95,10 @@
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
dmhub-plugin
</finalName>
...
...
src/main/java/com/jz/sms/api/ChuangLanApi.java
→
src/main/java/com/jz/sms/
channel/
api/ChuangLanApi.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
api
;
package
com
.
jz
.
sms
.
channel
.
api
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.sms.chuanglan.dto.CLBizResponse
;
import
com.jz.sms.chuanglan.dto.CLNotifyRequest
;
import
com.jz.sms.chuanglan.dto.ReportDto
;
import
com.jz.sms.chuanglan.service.ChuangLanSmsService
;
import
com.jz.sms.ch
annel.ch
uanglan.dto.CLBizResponse
;
import
com.jz.sms.ch
annel.ch
uanglan.dto.CLNotifyRequest
;
import
com.jz.sms.ch
annel.ch
uanglan.dto.ReportDto
;
import
com.jz.sms.ch
annel.ch
uanglan.service.ChuangLanSmsService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
src/main/java/com/jz/sms/api/DmHubApi.java
→
src/main/java/com/jz/sms/
channel/
api/DmHubApi.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
api
;
package
com
.
jz
.
sms
.
channel
.
api
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.sms.dto.*
;
import
com.jz.sms.
channel.
dto.*
;
import
com.jz.sms.service.MessageService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
src/main/java/com/jz/sms/chuanglan/config/ChuangLanSMSConfig.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/config/ChuangLanSMSConfig.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
config
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLBizResponse.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLBizResponse.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.sms.config.ResponseCode
;
...
...
@@ -7,6 +7,7 @@ import java.io.Serializable;
public
class
CLBizResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8100192126279967648L
;
private
String
code
;
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLNotifyRequest.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLNotifyRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLNotifyRequest
{
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLSendFixedRequest.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLSendFixedRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLSendFixedRequest
{
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLSendSMSResponse.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLSendSMSResponse.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLSendSMSResponse
{
/**
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLSendVariableRequest.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLSendVariableRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLSendVariableRequest
{
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLSendVariableResponse.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLSendVariableResponse.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLSendVariableResponse
{
/**
...
...
src/main/java/com/jz/sms/chuanglan/dto/CLTemplateRequest.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/CLTemplateRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
CLTemplateRequest
{
}
src/main/java/com/jz/sms/chuanglan/dto/ReportDto.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/dto/ReportDto.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
dto
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
dto
;
public
class
ReportDto
{
...
...
src/main/java/com/jz/sms/chuanglan/service/ChuangLanSmsService.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/service/ChuangLanSmsService.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
service
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
service
;
import
com.jz.sms.chuanglan.dto.CLNotifyRequest
;
import
com.jz.sms.chuanglan.dto.CLSendSMSResponse
;
import
com.jz.sms.chuanglan.dto.CLBizResponse
;
import
com.jz.sms.chuanglan.dto.ReportDto
;
import
com.jz.sms.channel.chuanglan.dto.CLNotifyRequest
;
import
com.jz.sms.channel.chuanglan.dto.CLBizResponse
;
import
com.jz.sms.channel.chuanglan.dto.ReportDto
;
public
interface
ChuangLanSmsService
{
...
...
src/main/java/com/jz/sms/chuanglan/service/impl/ChuangLanSmsServiceImpl.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/service/impl/ChuangLanSmsServiceImpl.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
service
.
impl
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.jz.sms.api.DmHubApi
;
import
com.jz.sms.chuanglan.dto.*
;
import
com.jz.sms.chuanglan.service.ChuangLanSmsService
;
import
com.jz.sms.chuanglan.utils.ChuangLanSmsUtil
;
import
com.jz.sms.chuanglan.config.ChuangLanSMSConfig
;
import
com.jz.sms.
channel.
api.DmHubApi
;
import
com.jz.sms.ch
annel.ch
uanglan.dto.*
;
import
com.jz.sms.ch
annel.ch
uanglan.service.ChuangLanSmsService
;
import
com.jz.sms.ch
annel.ch
uanglan.utils.ChuangLanSmsUtil
;
import
com.jz.sms.ch
annel.ch
uanglan.config.ChuangLanSMSConfig
;
import
com.jz.sms.config.ResponseCode
;
import
com.jz.sms.channel.dmHub.service.DmHubService
;
import
com.jz.sms.repository.domain.SmsTemplateInfo
;
import
com.jz.sms.service.SmsTemplateService
;
import
com.jz.sms.util.HttpUtil
;
...
...
@@ -38,6 +39,8 @@ public class ChuangLanSmsServiceImpl implements ChuangLanSmsService {
@Autowired
private
SmsTemplateService
templateService
;
@Autowired
private
DmHubService
dmHubService
;
@Override
public
CLBizResponse
createTemplate
(
String
content
,
String
type
)
throws
Exception
{
...
...
@@ -189,9 +192,8 @@ public class ChuangLanSmsServiceImpl implements ChuangLanSmsService {
public
CLBizResponse
report
(
ReportDto
report
)
{
// TODO 状态报告要特殊处理,一个个接受,批量发送
String
uid
=
report
.
getUid
();
return
null
;
Map
<
String
,
Object
>
ret
=
dmHubService
.
smsReport
(
report
);
return
new
CLBizResponse
(
ResponseCode
.
SUCCESS
);
}
...
...
src/main/java/com/jz/sms/chuanglan/utils/ChuangLanSmsUtil.java
→
src/main/java/com/jz/sms/ch
annel/ch
uanglan/utils/ChuangLanSmsUtil.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
chuanglan
.
utils
;
package
com
.
jz
.
sms
.
ch
annel
.
ch
uanglan
.
utils
;
import
java.io.BufferedReader
;
import
java.io.InputStreamReader
;
...
...
src/main/java/com/jz/sms/dmHub/config/DmHubConfig.java
→
src/main/java/com/jz/sms/
channel/
dmHub/config/DmHubConfig.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dmHub
.
config
;
package
com
.
jz
.
sms
.
channel
.
dmHub
.
config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -12,6 +12,7 @@ public class DmHubConfig {
// 应用key
public
static
String
applicationKey
;
public
static
String
tokenUrl
;
public
static
String
report
;
@Value
(
"${system.config.dmHub.applicationId}"
)
...
...
@@ -29,4 +30,12 @@ public class DmHubConfig {
public
void
setTokenUrl
(
String
tokenUrl
)
{
DmHubConfig
.
tokenUrl
=
tokenUrl
;
}
@Value
(
"{system.config.dmHub.report}"
)
public
void
setReport
(
String
report
)
{
DmHubConfig
.
report
=
report
;
}
}
src/main/java/com/jz/sms/dmHub/service/DmHubService.java
→
src/main/java/com/jz/sms/
channel/
dmHub/service/DmHubService.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dmHub
.
service
;
package
com
.
jz
.
sms
.
channel
.
dmHub
.
service
;
import
com.jz.sms.channel.chuanglan.dto.ReportDto
;
import
java.util.Map
;
...
...
@@ -15,8 +17,8 @@ public interface DmHubService {
/**
* 回执报告给DM hub
*
* @param
reportInf
o
* @param
dt
o
* @return
*/
Map
<
String
,
Object
>
smsReport
(
Map
<
String
,
Object
>
reportInf
o
);
Map
<
String
,
Object
>
smsReport
(
ReportDto
dt
o
);
}
src/main/java/com/jz/sms/dmHub/service/impl/DmHubServiceImpl.java
→
src/main/java/com/jz/sms/
channel/
dmHub/service/impl/DmHubServiceImpl.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dmHub
.
service
.
impl
;
package
com
.
jz
.
sms
.
channel
.
dmHub
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.sms.dmHub.config.DmHubConfig
;
import
com.jz.sms.dmHub.service.DmHubService
;
import
com.jz.sms.channel.api.DmHubApi
;
import
com.jz.sms.channel.chuanglan.dto.ReportDto
;
import
com.jz.sms.channel.dmHub.config.DmHubConfig
;
import
com.jz.sms.channel.dmHub.service.DmHubService
;
import
com.jz.sms.channel.dto.DmhubReport
;
import
com.jz.sms.channel.dto.ReportDetail
;
import
com.jz.sms.util.HttpUtil
;
import
com.jz.sms.util.OkHttpUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* Dm hub系统交互业务层
...
...
@@ -15,6 +25,11 @@ import java.util.Map;
@Service
public
class
DmHubServiceImpl
implements
DmHubService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
DmHubServiceImpl
.
class
);
@Autowired
RedisTemplate
redisTemplate
;
@Override
public
String
getToken
()
{
...
...
@@ -33,17 +48,38 @@ public class DmHubServiceImpl implements DmHubService {
if
(
"0"
.
equals
(
errorCode
))
{
String
accessToken
=
retJson
.
getString
(
"access_token"
);
String
expires
=
retJson
.
getString
(
"expires_in"
);
// TODO 存redis,过期时间=expires-600(秒)
redisTemplate
.
opsForValue
().
set
(
"DM_HUB_TOKEN"
,
accessToken
,
Long
.
parseLong
(
expires
)
-
600L
,
TimeUnit
.
SECONDS
);
return
accessToken
;
}
else
{
return
null
;
}
// TODO 存redis,过期时间=expires-600(秒)
}
@Override
public
Map
<
String
,
Object
>
smsReport
(
Map
<
String
,
Object
>
accInfo
)
{
public
Map
<
String
,
Object
>
smsReport
(
ReportDto
dto
)
{
DmhubReport
report
=
new
DmhubReport
();
report
.
setType
(
"sms"
);
ReportDetail
detail
=
new
ReportDetail
();
detail
.
setAudienceId
(
dto
.
getMobile
());
detail
.
setBatchId
(
dto
.
getUid
());
detail
.
setReportDate
(
dto
.
getReportTime
());
detail
.
setMobile
(
dto
.
getMobile
());
detail
.
setChargeNum
(
Integer
.
valueOf
(
dto
.
getLength
()));
detail
.
setSendDate
(
dto
.
getReportTime
());
if
(
"DELIVRD"
.
equals
(
dto
.
getStatus
()))
{
detail
.
setIsReceive
(
true
);
}
else
{
detail
.
setIsReceive
(
false
);
}
detail
.
setErrMessage
(
dto
.
getStatusDesc
());
report
.
setReports
(
detail
);
log
.
info
(
"短信状态回执参数:{}"
,
JSONObject
.
toJSONString
(
report
));
String
retStr
=
HttpUtil
.
sendPost
(
DmHubConfig
.
report
,
JSONObject
.
toJSONString
(
report
));
log
.
info
(
"短信状态回执响应:{}"
,
retStr
);
return
null
;
}
}
src/main/java/com/jz/sms/dto/DmHubBatchSendRequest.java
→
src/main/java/com/jz/sms/
channel/
dto/DmHubBatchSendRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dto
;
package
com
.
jz
.
sms
.
channel
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
...
...
src/main/java/com/jz/sms/dto/DmHubSendRequest.java
→
src/main/java/com/jz/sms/
channel/
dto/DmHubSendRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dto
;
package
com
.
jz
.
sms
.
channel
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.List
;
public
class
DmHubSendRequest
{
...
...
src/main/java/com/jz/sms/dto/DmHubSendResponse.java
→
src/main/java/com/jz/sms/
channel/
dto/DmHubSendResponse.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dto
;
package
com
.
jz
.
sms
.
channel
.
dto
;
import
com.jz.sms.config.ResponseCode
;
...
...
src/main/java/com/jz/sms/dto/DmHubTemplateRequest.java
→
src/main/java/com/jz/sms/
channel/
dto/DmHubTemplateRequest.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dto
;
package
com
.
jz
.
sms
.
channel
.
dto
;
public
class
DmHubTemplateRequest
{
...
...
src/main/java/com/jz/sms/dto/DmHubTemplateResponse.java
→
src/main/java/com/jz/sms/
channel/
dto/DmHubTemplateResponse.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
dto
;
package
com
.
jz
.
sms
.
channel
.
dto
;
public
class
DmHubTemplateResponse
{
private
String
code
;
...
...
src/main/java/com/jz/sms/channel/dto/DmhubReport.java
0 → 100644
View file @
daf1bf26
package
com
.
jz
.
sms
.
channel
.
dto
;
import
java.io.Serializable
;
public
class
DmhubReport
implements
Serializable
{
private
static
final
long
serialVersionUID
=
810019212627996764L
;
private
String
type
;
private
ReportDetail
reports
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
ReportDetail
getReports
()
{
return
reports
;
}
public
void
setReports
(
ReportDetail
reports
)
{
this
.
reports
=
reports
;
}
}
src/main/java/com/jz/sms/channel/dto/ReportDetail.java
0 → 100644
View file @
daf1bf26
package
com
.
jz
.
sms
.
channel
.
dto
;
import
java.io.Serializable
;
public
class
ReportDetail
implements
Serializable
{
private
static
final
long
serialVersionUID
=
810019212627996764L
;
private
String
audienceId
;
private
String
batchId
;
private
String
reportDate
;
private
Boolean
isReceive
;
private
String
mobile
;
private
Integer
chargeNum
;
private
String
sendDate
;
private
String
errMessage
;
private
String
content
;
private
String
msgCode
;
private
String
campaign
;
public
String
getAudienceId
()
{
return
audienceId
;
}
public
void
setAudienceId
(
String
audienceId
)
{
this
.
audienceId
=
audienceId
;
}
public
String
getBatchId
()
{
return
batchId
;
}
public
void
setBatchId
(
String
batchId
)
{
this
.
batchId
=
batchId
;
}
public
String
getReportDate
()
{
return
reportDate
;
}
public
void
setReportDate
(
String
reportDate
)
{
this
.
reportDate
=
reportDate
;
}
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getSendDate
()
{
return
sendDate
;
}
public
void
setSendDate
(
String
sendDate
)
{
this
.
sendDate
=
sendDate
;
}
public
String
getErrMessage
()
{
return
errMessage
;
}
public
void
setErrMessage
(
String
errMessage
)
{
this
.
errMessage
=
errMessage
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
String
getMsgCode
()
{
return
msgCode
;
}
public
void
setMsgCode
(
String
msgCode
)
{
this
.
msgCode
=
msgCode
;
}
public
String
getCampaign
()
{
return
campaign
;
}
public
void
setCampaign
(
String
campaign
)
{
this
.
campaign
=
campaign
;
}
public
Boolean
getIsReceive
()
{
return
isReceive
;
}
public
void
setIsReceive
(
Boolean
receive
)
{
isReceive
=
receive
;
}
public
Integer
getChargeNum
()
{
return
chargeNum
;
}
public
void
setChargeNum
(
Integer
chargeNum
)
{
this
.
chargeNum
=
chargeNum
;
}
}
src/main/java/com/jz/sms/config/RedisConfig.java
0 → 100644
View file @
daf1bf26
package
com
.
jz
.
sms
.
config
;
import
com.alibaba.fastjson.parser.ParserConfig
;
import
com.alibaba.fastjson.support.spring.FastJsonRedisSerializer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
@Configuration
public
class
RedisConfig
<
K
,
V
>
{
@Bean
public
RedisTemplate
<
K
,
V
>
getRedisTemplate
(
RedisConnectionFactory
redisConnectionFactory
)
{
RedisTemplate
<
K
,
V
>
redisTemplate
=
new
RedisTemplate
<>();
redisTemplate
.
setConnectionFactory
(
redisConnectionFactory
);
//全局开启
ParserConfig
.
getGlobalInstance
().
setAutoTypeSupport
(
true
);
//key序列化
redisTemplate
.
setKeySerializer
(
new
StringRedisSerializer
());
redisTemplate
.
setHashKeySerializer
(
new
StringRedisSerializer
());
//value序列化
redisTemplate
.
setValueSerializer
(
new
FastJsonRedisSerializer
<>(
Object
.
class
));
redisTemplate
.
setHashValueSerializer
(
new
FastJsonRedisSerializer
<>(
Object
.
class
));
redisTemplate
.
afterPropertiesSet
();
return
redisTemplate
;
}
}
src/main/java/com/jz/sms/service/MessageService.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
service
;
import
com.jz.sms.dto.*
;
import
com.jz.sms.
channel.
dto.*
;
public
interface
MessageService
{
...
...
src/main/java/com/jz/sms/service/impl/MessageServiceImpl.java
View file @
daf1bf26
...
...
@@ -3,10 +3,10 @@ package com.jz.sms.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.jz.sms.chuanglan.dto.CLBizResponse
;
import
com.jz.sms.chuanglan.service.ChuangLanSmsService
;
import
com.jz.sms.ch
annel.ch
uanglan.dto.CLBizResponse
;
import
com.jz.sms.ch
annel.ch
uanglan.service.ChuangLanSmsService
;
import
com.jz.sms.config.ResponseCode
;
import
com.jz.sms.dto.*
;
import
com.jz.sms.
channel.
dto.*
;
import
com.jz.sms.repository.domain.DmBatchInfo
;
import
com.jz.sms.repository.domain.SmsTemplateInfo
;
import
com.jz.sms.repository.domain.SysBatchInfo
;
...
...
@@ -196,7 +196,7 @@ public class MessageServiceImpl implements MessageService {
Object
value
=
data
.
get
(
key
);
if
(
value
instanceof
JSONObject
||
value
instanceof
Map
)
{
StringBuilder
keyBuffer
=
new
StringBuilder
(
key
);
value
=
test
(
value
,
keyBuffer
);
value
=
getKeyValue
(
value
,
keyBuffer
);
newKey
=
keyBuffer
.
toString
();
}
if
(
s
.
contains
(
newKey
))
{
...
...
@@ -287,7 +287,7 @@ public class MessageServiceImpl implements MessageService {
Object
value
=
json
.
get
(
key
);
if
(
value
instanceof
JSONObject
||
value
instanceof
Map
)
{
StringBuilder
keyBuffer
=
new
StringBuilder
(
key
);
value
=
test
(
value
,
keyBuffer
);
value
=
getKeyValue
(
value
,
keyBuffer
);
newKey
=
keyBuffer
.
toString
();
}
if
(
s
.
contains
(
newKey
))
{
...
...
@@ -361,7 +361,7 @@ public class MessageServiceImpl implements MessageService {
}
}
public
String
test
(
Object
value
,
StringBuilder
keyBuffer
)
{
public
String
getKeyValue
(
Object
value
,
StringBuilder
keyBuffer
)
{
String
s
=
JSONObject
.
toJSONString
(
value
);
JSONObject
valueJson
=
JSONObject
.
parseObject
(
s
);
Set
<
String
>
set
=
valueJson
.
keySet
();
...
...
@@ -372,7 +372,7 @@ public class MessageServiceImpl implements MessageService {
keyBuffer
.
append
(
"."
).
append
(
str
);
Object
info
=
valueJson
.
get
(
str
);
if
(
info
instanceof
JSONObject
||
info
instanceof
Map
)
{
String
test
=
test
(
info
,
keyBuffer
);
String
test
=
getKeyValue
(
info
,
keyBuffer
);
return
test
;
}
else
{
return
info
.
toString
();
...
...
src/main/java/com/jz/sms/wrapper/maintenance/XfaceCreateTempLateWrapper.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
wrapper
.
maintenance
;
import
com.jz.sms.dto.DmHubTemplateRequest
;
import
com.jz.sms.dto.DmHubTemplateResponse
;
import
com.jz.sms.
channel.
dto.DmHubTemplateRequest
;
import
com.jz.sms.
channel.
dto.DmHubTemplateResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
src/main/java/com/jz/sms/wrapper/maintenance/XfaceCreateTempLateWrapperImpl.java
View file @
daf1bf26
package
com
.
jz
.
sms
.
wrapper
.
maintenance
;
import
com.jz.sms.dto.DmHubTemplateRequest
;
import
com.jz.sms.dto.DmHubTemplateResponse
;
import
com.jz.sms.
channel.
dto.DmHubTemplateRequest
;
import
com.jz.sms.
channel.
dto.DmHubTemplateResponse
;
import
com.jz.sms.service.impl.MessageServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
src/main/resources/application-prod.yml
View file @
daf1bf26
server
:
tomcat
:
max-threads
:
50
port
:
9010
#contextPath: /resource
spring
:
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
url
:
jdbc:mysql://127.0.0.1:3306/plugin?characterEncoding=utf8&useSSL=false
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.
cj.
jdbc.Driver
username
:
root
password
:
root
hikari
:
...
...
@@ -14,6 +17,13 @@ spring:
maximumPoolSize
:
20
connectionTimeout
:
30000
idleTimeout
:
600000
pool-name
:
dmhub-plug-pool
redis
:
database
:
0
host
:
127.0.0.1
port
:
6379
timeout
:
5000
system
:
config
:
...
...
@@ -33,3 +43,4 @@ system:
applicationId
:
cl0300171a6012c21
applicationKey
:
4017078e9dfd593b2d9a0ede58eff589644fbe50
tokenUrl
:
https://api.convertlab.com/security/accesstoken
report
:
https://api.convertlab.com/v1/sms/report
\ No newline at end of file
src/main/resources/application-test.yml
View file @
daf1bf26
# 测试环境配置
server
:
tomcat
:
max-threads
:
50
port
:
19010
#contextPath: /resource
spring
:
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
url
:
jdbc:mysql://119.23.32.151:3306/dmhub_plugin?characterEncoding=utf8&useSSL=false
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.
cj.
jdbc.Driver
username
:
dmp
password
:
Ioubuy@2019@!
hikari
:
...
...
@@ -15,7 +19,14 @@ spring:
maximumPoolSize
:
20
connectionTimeout
:
30000
idleTimeout
:
600000
pool-name
:
dmhub-plug-pool
redis
:
database
:
0
host
:
127.0.0.1
port
:
6379
timeout
:
5000
system
:
config
:
chuanglan
:
...
...
@@ -34,4 +45,5 @@ system:
applicationId
:
cl0300171a6012c21
applicationKey
:
4017078e9dfd593b2d9a0ede58eff589644fbe50
tokenUrl
:
https://api.convertlab.com/security/accesstoken
report
:
https://api.convertlab.com/v1/sms/report
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