Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
6cfcd93b
Commit
6cfcd93b
authored
Nov 21, 2024
by
honghy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整Sendchamp客户端
parent
ccd51cb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
20241120hhy.sql
sql/v2.3/20241120hhy.sql
+1
-1
SendchampSmsClient.java
...rk/sms/core/client/impl/sendchamp/SendchampSmsClient.java
+7
-2
SendchampSmsCodeMapping.java
...s/core/client/impl/sendchamp/SendchampSmsCodeMapping.java
+3
-0
SmsCallbackController.java
...le/system/controller/admin/sms/SmsCallbackController.java
+2
-2
No files found.
sql/v2.3/20241120hhy.sql
View file @
6cfcd93b
...
...
@@ -8,7 +8,7 @@ INSERT INTO `jiedao`.`system_dict_data`(`sort`, `label`, `value`, `dict_type`, `
-- 新增渠道
INSERT
INTO
`jiedao`
.
`system_sms_channel`
(
`id`
,
`signature`
,
`code`
,
`status`
,
`remark`
,
`api_key`
,
`api_secret`
,
`callback_url`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`signature_en`
)
VALUES
(
7
,
'sendchamp'
,
'SENDCHAMP'
,
0
,
''
,
'ecit@ewchina.net'
,
'sendchamp_live_$2a$10$vQPdaDjl96Ybc5tzFmZYg.nqGirXuJBGDqJArthZnFR8P9mM5Z/JO'
,
''
,
'2741'
,
'2024-10-26 17:06:44'
,
'2741'
,
'2024-10-28 15:16:39'
,
b
'0'
,
'sendchamp'
);
INSERT
INTO
`jiedao`
.
`system_sms_channel`
(
`id`
,
`signature`
,
`code`
,
`status`
,
`remark`
,
`api_key`
,
`api_secret`
,
`callback_url`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`signature_en`
)
VALUES
(
8
,
'ycloud'
,
'YCLOUD'
,
0
,
NULL
,
'ecit@ewchina.net'
,
'
gAAAAABl5ZDpoKnKVaK0scmWo7GQeKDA1sn3OZBeMXUz211vZv5QqSEtr7_LD5ISTqSD0PnWLRWavYmJ3nQJiutT-sgp0dyHR2HIL6FYEhD3t2CNuoHJoSIOia5ffo_rjfxW_pk8co0i7UMTYANNGxsRNJLQTu_Alw==
'
,
NULL
,
'2741'
,
'2024-10-26 17:12:50'
,
'2741'
,
'2024-10-28 15:16:18'
,
b
'0'
,
'ycloud'
);
INSERT
INTO
`jiedao`
.
`system_sms_channel`
(
`id`
,
`signature`
,
`code`
,
`status`
,
`remark`
,
`api_key`
,
`api_secret`
,
`callback_url`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`signature_en`
)
VALUES
(
8
,
'ycloud'
,
'YCLOUD'
,
0
,
NULL
,
'ecit@ewchina.net'
,
'
9dbd912f56c101e53b23cb7b758ffda8
'
,
NULL
,
'2741'
,
'2024-10-26 17:12:50'
,
'2741'
,
'2024-10-28 15:16:18'
,
b
'0'
,
'ycloud'
);
-- 短信日志新增字段
alter
table
system_sms_log
add
node_id
bigint
comment
'节点id'
,
add
node_template_sn
int
default
1
comment
'节点模板序列号'
,
add
message_type
tinyint
comment
'发送类型'
;
...
...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/sendchamp/SendchampSmsClient.java
View file @
6cfcd93b
...
...
@@ -94,8 +94,12 @@ public class SendchampSmsClient extends AbstractSmsClient {
Map
<?,
?>
responseObj
=
JsonUtils
.
parseObject
(
result
,
Map
.
class
);
Map
<
String
,
Object
>
data
=
(
Map
<
String
,
Object
>)
responseObj
.
get
(
"data"
);
// 构建发送结果
smsCommonResult
=
SmsCommonResult
.
build
(
String
.
valueOf
(
responseObj
.
get
(
"status"
)),
String
.
valueOf
(
responseObj
.
get
(
"message"
)),
String
.
valueOf
(
data
.
get
(
"business_id"
)),
null
,
codeMapping
);
smsCommonResult
.
setData
(
new
SmsSendRespDTO
().
setSerialNo
(
String
.
valueOf
(
data
.
get
(
"business_id"
))));
String
id
=
String
.
valueOf
(
data
.
get
(
"business_id"
));
if
(
"null"
.
equals
(
id
))
{
id
=
String
.
valueOf
(
data
.
get
(
"id"
));
}
smsCommonResult
=
SmsCommonResult
.
build
(
String
.
valueOf
(
responseObj
.
get
(
"message"
)),
String
.
valueOf
(
responseObj
.
get
(
"message"
)),
id
,
null
,
codeMapping
);
smsCommonResult
.
setData
(
new
SmsSendRespDTO
().
setSerialNo
(
id
));
}
}
catch
(
Exception
e
)
{
// 记录发送短信时发生的错误
...
...
@@ -174,6 +178,7 @@ public class SendchampSmsClient extends AbstractSmsClient {
/**
* 短信接收状态
* <p>
*
* @author 捷道源码
*/
@Data
...
...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/sendchamp/SendchampSmsCodeMapping.java
View file @
6cfcd93b
...
...
@@ -13,6 +13,9 @@ public class SendchampSmsCodeMapping implements SmsCodeMapping {
public
ErrorCode
apply
(
String
apiCode
)
{
switch
(
apiCode
)
{
case
"accepted"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"processing"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"send"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"delivered"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
}
return
SmsFrameworkErrorCodeConstants
.
SMS_UNKNOWN
;
}
...
...
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java
View file @
6cfcd93b
...
...
@@ -54,9 +54,9 @@ public class SmsCallbackController {
}
@PostMapping
(
"/sendchamp"
)
@ApiOperation
(
value
=
"sendchamp短信的回调"
,
notes
=
"参见 https://help.aliyun.com/document_detail/120998.html 文档"
)
@ApiOperation
(
value
=
"sendchamp短信的回调"
)
@OperateLog
(
enable
=
false
)
public
CommonResult
<
Boolean
>
receiveSendchampSmsStatus
(
HttpServletRequest
request
)
throws
Throwable
{
public
CommonResult
<
Boolean
>
receiveSendchampSmsStatus
(
HttpServletRequest
request
)
{
String
text
=
ServletUtil
.
getBody
(
request
);
SendchampSmsClient
.
SmsReceiveStatus
smsReceiveStatus
=
JsonUtils
.
parseObject
(
text
,
SendchampSmsClient
.
SmsReceiveStatus
.
class
);
smsLogService
.
updateSendchampReceive
(
smsReceiveStatus
);
...
...
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