From dcf1a30d0a5a8fe9fa87c80721c393a5aecccc2a Mon Sep 17 00:00:00 2001 From: 3y Date: Mon, 10 Jan 2022 20:28:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=20sql=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=202.=20h?= =?UTF-8?q?ttp=E6=8E=A5=E5=8F=A3=E5=8A=A0=E5=85=A5=E6=A0=B7=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/java3y/austin/utils/AccountUtils.java | 4 ++-- .../com/java3y/austin/controller/SendController.java | 2 +- sql/austin.sql | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/austin-support/src/main/java/com/java3y/austin/utils/AccountUtils.java b/austin-support/src/main/java/com/java3y/austin/utils/AccountUtils.java index 7f7afa2..3ca5c9f 100644 --- a/austin-support/src/main/java/com/java3y/austin/utils/AccountUtils.java +++ b/austin-support/src/main/java/com/java3y/austin/utils/AccountUtils.java @@ -21,8 +21,8 @@ public class AccountUtils { private Config config; /** - * 短信参数示例:[{"sms_10":{"url":"sms.tencentcloudapi.com","region":"ap-guangzhou","secretId":"AKIDhDUUDfffffMEqBF1WljQq","secretKey":"B4h39yWnfffff7D2btue7JErDJ8gxyi","smsSdkAppId":"140025","templateId":"11897","signName":"Java3y公众号","supplierId":10,"supplierName":"腾讯云"}}] - * 邮件参数示例:[{"email_10":{"host":"smtp.qq.com","port":465,"user":"403686131@qq.com","pass":"","from":"403686131@qq.com"}}] + * (key:smsAccount)短信参数示例:[{"sms_10":{"url":"sms.tencentcloudapi.com","region":"ap-guangzhou","secretId":"AKIDhDUUDfffffMEqBF1WljQq","secretKey":"B4h39yWnfffff7D2btue7JErDJ8gxyi","smsSdkAppId":"140025","templateId":"11897","signName":"Java3y公众号","supplierId":10,"supplierName":"腾讯云"}}] + * (key:emailAccount)邮件参数示例:[{"email_10":{"host":"smtp.qq.com","port":465,"user":"403686131@qq.com","pass":"","from":"403686131@qq.com"}}] */ public T getAccount(Integer sendAccount, String apolloKey, String prefix, T t) { String accountValues = config.getProperty(apolloKey, AustinConstant.APOLLO_DEFAULT_VALUE_JSON_ARRAY); diff --git a/austin-web/src/main/java/com/java3y/austin/controller/SendController.java b/austin-web/src/main/java/com/java3y/austin/controller/SendController.java index a40c72f..a4478a2 100644 --- a/austin-web/src/main/java/com/java3y/austin/controller/SendController.java +++ b/austin-web/src/main/java/com/java3y/austin/controller/SendController.java @@ -21,7 +21,7 @@ public class SendController { /** * 发送消息接口 - * + * 示例:curl -XPOST "127.0.0.1:8080/send" -H 'Content-Type: application/json' -d '{"code":"send","messageParam":{"receiver":"13788888888","variables":{"title":"yyyyyy","contentValue":"6666164180"}},"messageTemplateId":1}' * @return */ @PostMapping("/send") diff --git a/sql/austin.sql b/sql/austin.sql index 9a56e1e..f3c729e 100644 --- a/sql/austin.sql +++ b/sql/austin.sql @@ -1,3 +1,5 @@ +create database austin; + CREATE TABLE `message_template` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, @@ -52,3 +54,13 @@ CREATE TABLE `sms_record` AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='短信记录信息' + + +/*测试短信*/ +INSERT INTO austin.message_template (id, name, audit_status, flow_id, msg_status, id_type, send_channel, template_type, msg_type, expect_push_time, msg_content, send_account, creator, updator, auditor, team, proposer, is_deleted, created, updated, deduplication_time, is_night_shield) VALUES (1, 'test短信', 10, 'yyyy', 10, 30, 30, 10, 10, '0', '{"content":"{$contentValue}"}', 10, 'yyyyc', 'yyyyu', 'yyyyyyz', 'yyyt', 'yyyy22', 0, 1636978066, 1636978066, 1, 0); + +/*测试短信+url链接追踪*/ +INSERT INTO austin.message_template (id, name, audit_status, flow_id, msg_status, id_type, send_channel, template_type, msg_type, expect_push_time, msg_content, send_account, creator, updator, auditor, team, proposer, is_deleted, created, updated, deduplication_time, is_night_shield) VALUES (2, 'test短信', 10, 'yyyy', 10, 30, 30, 10, 20, '0', '{"content":"{$contentValue}","url":"https://gitee.com/zhongfucheng/austin"}', 10, 'yyyyc', 'yyyyu', 'yyyyyyz', 'yyyt', 'yyyy22', 0, 1637411536, 1637411536, 1, 0); + +/*测试邮件发送*/ +INSERT INTO austin.message_template (id, name, audit_status, flow_id, msg_status, id_type, send_channel, template_type, msg_type, expect_push_time, msg_content, send_account, creator, updator, auditor, team, proposer, is_deleted, created, updated, deduplication_time, is_night_shield) VALUES (3, 'test邮件', 10, 'yyyy', 10, 50, 40, 20, 10, '0', '{"content":"{$contentValue}","title":"{$title}"}', 10, 'yyyyc', 'yyyyu', 'yyyyyyz', 'yyyt', 'yyyy22', 0, 1641546914, 1641546914, 1, 0); \ No newline at end of file