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
9452b7e6
Commit
9452b7e6
authored
Nov 21, 2024
by
Smile
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/jd_dev' into jd_dev
parents
94868831
6cfcd93b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
9 deletions
+17
-9
20241120hhy.sql
sql/v2.3/20241120hhy.sql
+1
-1
YudaoMQAutoConfiguration.java
...r/yudao/framework/mq/config/YudaoMQAutoConfiguration.java
+2
-0
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
SmsSendConsumerV2.java
...udao/module/system/mq/consumer/sms/SmsSendConsumerV2.java
+1
-2
SmsSendMessageV2.java
.../yudao/module/system/mq/message/sms/SmsSendMessageV2.java
+1
-2
No files found.
sql/v2.3/20241120hhy.sql
View file @
9452b7e6
...
@@ -8,7 +8,7 @@ INSERT INTO `jiedao`.`system_dict_data`(`sort`, `label`, `value`, `dict_type`, `
...
@@ -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
(
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
'发送类型'
;
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/mq/config/YudaoMQAutoConfiguration.java
View file @
9452b7e6
...
@@ -111,6 +111,8 @@ public class YudaoMQAutoConfiguration {
...
@@ -111,6 +111,8 @@ public class YudaoMQAutoConfiguration {
.
autoAcknowledge
(
false
)
// 不自动 ack
.
autoAcknowledge
(
false
)
// 不自动 ack
.
cancelOnError
(
throwable
->
false
);
// 默认配置,发生异常就取消消费,显然不符合预期;因此,我们设置为 false
.
cancelOnError
(
throwable
->
false
);
// 默认配置,发生异常就取消消费,显然不符合预期;因此,我们设置为 false
container
.
register
(
builder
.
build
(),
listener
);
container
.
register
(
builder
.
build
(),
listener
);
log
.
info
(
"[redisMessageListenerContainer][注册 streamKey({}) 对应的监听器({})]"
,
listener
.
getStreamKey
(),
listener
.
getClass
().
getName
());
});
});
return
container
;
return
container
;
}
}
...
...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/sendchamp/SendchampSmsClient.java
View file @
9452b7e6
...
@@ -94,8 +94,12 @@ public class SendchampSmsClient extends AbstractSmsClient {
...
@@ -94,8 +94,12 @@ public class SendchampSmsClient extends AbstractSmsClient {
Map
<?,
?>
responseObj
=
JsonUtils
.
parseObject
(
result
,
Map
.
class
);
Map
<?,
?>
responseObj
=
JsonUtils
.
parseObject
(
result
,
Map
.
class
);
Map
<
String
,
Object
>
data
=
(
Map
<
String
,
Object
>)
responseObj
.
get
(
"data"
);
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
);
String
id
=
String
.
valueOf
(
data
.
get
(
"business_id"
));
smsCommonResult
.
setData
(
new
SmsSendRespDTO
().
setSerialNo
(
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
)
{
}
catch
(
Exception
e
)
{
// 记录发送短信时发生的错误
// 记录发送短信时发生的错误
...
@@ -174,6 +178,7 @@ public class SendchampSmsClient extends AbstractSmsClient {
...
@@ -174,6 +178,7 @@ public class SendchampSmsClient extends AbstractSmsClient {
/**
/**
* 短信接收状态
* 短信接收状态
* <p>
* <p>
*
* @author 捷道源码
* @author 捷道源码
*/
*/
@Data
@Data
...
...
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/sendchamp/SendchampSmsCodeMapping.java
View file @
9452b7e6
...
@@ -13,6 +13,9 @@ public class SendchampSmsCodeMapping implements SmsCodeMapping {
...
@@ -13,6 +13,9 @@ public class SendchampSmsCodeMapping implements SmsCodeMapping {
public
ErrorCode
apply
(
String
apiCode
)
{
public
ErrorCode
apply
(
String
apiCode
)
{
switch
(
apiCode
)
{
switch
(
apiCode
)
{
case
"accepted"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"accepted"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"processing"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"send"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
case
"delivered"
:
return
GlobalErrorCodeConstants
.
SUCCESS
;
}
}
return
SmsFrameworkErrorCodeConstants
.
SMS_UNKNOWN
;
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 @
9452b7e6
...
@@ -54,9 +54,9 @@ public class SmsCallbackController {
...
@@ -54,9 +54,9 @@ public class SmsCallbackController {
}
}
@PostMapping
(
"/sendchamp"
)
@PostMapping
(
"/sendchamp"
)
@ApiOperation
(
value
=
"sendchamp短信的回调"
,
notes
=
"参见 https://help.aliyun.com/document_detail/120998.html 文档"
)
@ApiOperation
(
value
=
"sendchamp短信的回调"
)
@OperateLog
(
enable
=
false
)
@OperateLog
(
enable
=
false
)
public
CommonResult
<
Boolean
>
receiveSendchampSmsStatus
(
HttpServletRequest
request
)
throws
Throwable
{
public
CommonResult
<
Boolean
>
receiveSendchampSmsStatus
(
HttpServletRequest
request
)
{
String
text
=
ServletUtil
.
getBody
(
request
);
String
text
=
ServletUtil
.
getBody
(
request
);
SendchampSmsClient
.
SmsReceiveStatus
smsReceiveStatus
=
JsonUtils
.
parseObject
(
text
,
SendchampSmsClient
.
SmsReceiveStatus
.
class
);
SendchampSmsClient
.
SmsReceiveStatus
smsReceiveStatus
=
JsonUtils
.
parseObject
(
text
,
SendchampSmsClient
.
SmsReceiveStatus
.
class
);
smsLogService
.
updateSendchampReceive
(
smsReceiveStatus
);
smsLogService
.
updateSendchampReceive
(
smsReceiveStatus
);
...
...
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/sms/SmsSendConsumerV2.java
View file @
9452b7e6
package
cn
.
iocoder
.
yudao
.
module
.
system
.
mq
.
consumer
.
sms
;
package
cn
.
iocoder
.
yudao
.
module
.
system
.
mq
.
consumer
.
sms
;
import
cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener
;
import
cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener
;
import
cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage
;
import
cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessageV2
;
import
cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessageV2
;
import
cn.iocoder.yudao.module.system.service.sms.SmsSendService
;
import
cn.iocoder.yudao.module.system.service.sms.SmsSendService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -10,7 +9,7 @@ import org.springframework.stereotype.Component;
...
@@ -10,7 +9,7 @@ import org.springframework.stereotype.Component;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
/**
/**
* 针对 {@link SmsSend
Message
} 的消费者
* 针对 {@link SmsSend
ConsumerV2
} 的消费者
*
*
* @author zzf
* @author zzf
*/
*/
...
...
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/mq/message/sms/SmsSendMessageV2.java
View file @
9452b7e6
...
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.mq.message.sms;
...
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.mq.message.sms;
import
cn.iocoder.yudao.framework.common.util.json.core.KeyValue
;
import
cn.iocoder.yudao.framework.common.util.json.core.KeyValue
;
import
cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessage
;
import
cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessage
;
import
cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateDTO
;
import
cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateDTO
;
import
cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -44,7 +43,7 @@ public class SmsSendMessageV2 extends AbstractStreamMessage {
...
@@ -44,7 +43,7 @@ public class SmsSendMessageV2 extends AbstractStreamMessage {
@Override
@Override
public
String
getStreamKey
()
{
public
String
getStreamKey
()
{
return
"system.sms.send"
;
return
"system.sms.send
.v2
"
;
}
}
}
}
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