完善多个通道
This commit is contained in:
@@ -0,0 +1,250 @@
|
||||
package aliyun
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.yun.ink/pkg/mailx/interfaces"
|
||||
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
|
||||
dm20151123 "github.com/alibabacloud-go/dm-20151123/v2/client"
|
||||
util "github.com/alibabacloud-go/tea-utils/v2/service"
|
||||
"github.com/alibabacloud-go/tea/tea"
|
||||
"github.com/yuninks/loggerx"
|
||||
)
|
||||
|
||||
type Aliyun struct {
|
||||
interfaces.DefaultEmail
|
||||
client *dm20151123.Client
|
||||
params *interfaces.EmialConfigDataAliyun
|
||||
logger loggerx.LoggerInterface
|
||||
}
|
||||
|
||||
func (l *Aliyun) InitEmail(ctx context.Context, params interfaces.EmailConfigData, logger loggerx.LoggerInterface) (interfaces.Email, error) {
|
||||
l.logger.Infof(ctx, "params:%+v", params)
|
||||
if params.Aliyun == nil {
|
||||
return nil, errors.New("not aliyun")
|
||||
}
|
||||
l.logger.Infof(ctx, "params:%+v", params.Aliyun)
|
||||
// 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。
|
||||
// 建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378661.html。
|
||||
config := &openapi.Config{
|
||||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
|
||||
AccessKeyId: tea.String(params.Aliyun.AccessId),
|
||||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
|
||||
AccessKeySecret: tea.String(params.Aliyun.AccessKey),
|
||||
}
|
||||
if params.Aliyun.Endpoint == "" {
|
||||
params.Aliyun.Endpoint = "dm.aliyuncs.com"
|
||||
}
|
||||
|
||||
// Endpoint 请参考 https://api.aliyun.com/product/Dm
|
||||
config.Endpoint = tea.String(params.Aliyun.Endpoint)
|
||||
|
||||
result, err := dm20151123.NewClient(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Aliyun{
|
||||
client: result,
|
||||
params: params.Aliyun,
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (l *Aliyun) Send(ctx context.Context, params interfaces.Message) error {
|
||||
if l.client == nil {
|
||||
return errors.New("client no init")
|
||||
}
|
||||
if len(params.To) > 100 {
|
||||
return errors.New("最多 100 个地址")
|
||||
}
|
||||
if l.params.AccountName == "" {
|
||||
return errors.New("AccountName 必填")
|
||||
}
|
||||
|
||||
toAddress := strings.Join(params.To, ",")
|
||||
|
||||
singleSendMailRequest := &dm20151123.SingleSendMailRequest{}
|
||||
|
||||
singleSendMailRequest.AccountName = tea.String(l.params.AccountName)
|
||||
singleSendMailRequest.ToAddress = tea.String(toAddress) // 目标地址,多个 email 地址可以用逗号分隔,最多 100 个地址(支持邮件组)。
|
||||
singleSendMailRequest.Subject = tea.String(params.Subject)
|
||||
singleSendMailRequest.HtmlBody = tea.String(params.Body)
|
||||
singleSendMailRequest.AddressType = tea.Int32(0) // 地址类型。取值:0:为随机账号1:为发信地址
|
||||
|
||||
if params.ReplyTo != "" {
|
||||
singleSendMailRequest.ReplyToAddress = tea.Bool(false)
|
||||
singleSendMailRequest.ReplyAddress = tea.String(params.ReplyTo)
|
||||
} else {
|
||||
singleSendMailRequest.ReplyToAddress = tea.Bool(true)
|
||||
}
|
||||
|
||||
runtime := &util.RuntimeOptions{}
|
||||
tryErr := func() (_e error) {
|
||||
defer func() {
|
||||
if r := tea.Recover(recover()); r != nil {
|
||||
_e = r
|
||||
}
|
||||
}()
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
resp, err := l.client.SingleSendMailWithOptions(singleSendMailRequest, runtime)
|
||||
by, _ := json.Marshal(resp)
|
||||
fmt.Printf("resp:%+v err:%+v", string(by), err)
|
||||
l.logger.Infof(ctx, "resp:%+v err:%+v", resp, err)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
if tryErr != nil {
|
||||
l.logger.Errorf(ctx, "err:%+v", tryErr)
|
||||
return tryErr
|
||||
|
||||
// var error = &tea.SDKError{}
|
||||
// if _t, ok := tryErr.(*tea.SDKError); ok {
|
||||
// error = _t
|
||||
// } else {
|
||||
// error.Message = tea.String(tryErr.Error())
|
||||
// }
|
||||
// // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// // 错误 message
|
||||
// fmt.Println(tea.StringValue(error.Message))
|
||||
// // 诊断地址
|
||||
// var data interface{}
|
||||
// d := json.NewDecoder(strings.NewReader(tea.StringValue(error.Data)))
|
||||
// d.Decode(&data)
|
||||
// if m, ok := data.(map[string]interface{}); ok {
|
||||
// recommend, _ := m["Recommend"]
|
||||
// fmt.Println("recommend", recommend)
|
||||
// }
|
||||
// _, _err := util.AssertAsString(error.Message)
|
||||
// if _err != nil {
|
||||
// return _err
|
||||
// }
|
||||
}
|
||||
|
||||
return nil // 实现具体的 Aliyun 发送方法
|
||||
// 如:return aliyunSDK.SendMail(params)
|
||||
}
|
||||
|
||||
// 同步状态
|
||||
func (l *Aliyun) SyncStatus(ctx context.Context) (resp []interfaces.EmailSendRecord, err error) {
|
||||
|
||||
start := ""
|
||||
|
||||
// 一次同步一天的数据
|
||||
for {
|
||||
list, next, err := l.getSendStatus(ctx, start)
|
||||
l.logger.Infof(ctx, "list:%+v next:%+v err:%+v", list, next, err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, val := range list {
|
||||
|
||||
t, _ := time.ParseInLocation("2006-01-02T15:04Z", tea.StringValue(val.LastUpdateTime), time.Local)
|
||||
|
||||
// 0:成功 2:无效地址 3:垃圾邮件 4:失败
|
||||
record := interfaces.EmailSendRecord{
|
||||
AccountName: tea.StringValue(val.AccountName),
|
||||
UpdateTime: t.UnixMilli(),
|
||||
ToUser: tea.StringValue(val.ToAddress),
|
||||
Subject: tea.StringValue(val.Subject),
|
||||
ErrorMessage: tea.StringValue(val.Message),
|
||||
}
|
||||
|
||||
switch tea.Int32Value(val.Status) {
|
||||
case 0:
|
||||
record.Status = interfaces.EmailSendStatusSuccess
|
||||
case 2:
|
||||
record.Status = interfaces.EmailSendStatusInvalidAddress
|
||||
case 3:
|
||||
record.Status = interfaces.EmailSendStatusSpam
|
||||
case 4:
|
||||
record.Status = interfaces.EmailSendStatusFailed
|
||||
default:
|
||||
record.Status = interfaces.EmailSendStatusUnknown
|
||||
}
|
||||
|
||||
resp = append(resp, record)
|
||||
}
|
||||
if next == nil || len(*next) == 0 {
|
||||
break
|
||||
}
|
||||
start = *next
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
||||
}
|
||||
|
||||
func (l *Aliyun) getSendStatus(ctx context.Context, start string) (list []*dm20151123.SenderStatisticsDetailByParamResponseBodyDataMailDetail, nextStart *string, err error) {
|
||||
now := time.Now().Local()
|
||||
senderStatisticsDetailByParamRequest := &dm20151123.SenderStatisticsDetailByParamRequest{
|
||||
StartTime: tea.String(now.AddDate(0, 0, -1).Format("2006-01-02 15:04")),
|
||||
EndTime: tea.String(now.Format("2006-01-02 15:04")),
|
||||
Length: tea.Int32(100),
|
||||
}
|
||||
if start != "" {
|
||||
senderStatisticsDetailByParamRequest.NextStart = tea.String(start)
|
||||
}
|
||||
runtime := &util.RuntimeOptions{}
|
||||
tryErr := func() (_e error) {
|
||||
defer func() {
|
||||
if r := tea.Recover(recover()); r != nil {
|
||||
_e = r
|
||||
}
|
||||
}()
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
resp, _err := l.client.SenderStatisticsDetailByParamWithOptions(senderStatisticsDetailByParamRequest, runtime)
|
||||
if _err != nil {
|
||||
l.logger.Errorf(ctx, "resp:%+v err:%+v", resp, _err)
|
||||
return _err
|
||||
}
|
||||
|
||||
if resp == nil || resp.Body == nil || resp.Body.Data == nil {
|
||||
return errors.New("resp.Body.Data is nil")
|
||||
}
|
||||
|
||||
list = resp.Body.Data.MailDetail
|
||||
nextStart = resp.Body.NextStart
|
||||
|
||||
return nil
|
||||
}()
|
||||
|
||||
if tryErr != nil {
|
||||
l.logger.Errorf(ctx, "err:%+v", tryErr)
|
||||
return nil, nil, tryErr
|
||||
|
||||
// var error = &tea.SDKError{}
|
||||
// if _t, ok := tryErr.(*tea.SDKError); ok {
|
||||
// error = _t
|
||||
// } else {
|
||||
// error.Message = tea.String(tryErr.Error())
|
||||
// }
|
||||
// // 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// // 错误 message
|
||||
// fmt.Println(tea.StringValue(error.Message))
|
||||
// // 诊断地址
|
||||
// var data interface{}
|
||||
// d := json.NewDecoder(strings.NewReader(tea.StringValue(error.Data)))
|
||||
// d.Decode(&data)
|
||||
// if m, ok := data.(map[string]interface{}); ok {
|
||||
// recommend, _ := m["Recommend"]
|
||||
// fmt.Println("recommend:", recommend)
|
||||
// }
|
||||
// _, _err := util.AssertAsString(error.Message)
|
||||
// if _err != nil {
|
||||
// l.logger.Errorf(ctx, "resp:%+v err:%+v", error.Message, _err)
|
||||
// return nil, nil, _err
|
||||
// }
|
||||
}
|
||||
return list, nextStart, nil
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package aliyun_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"code.yun.ink/pkg/mailx/aliyun"
|
||||
"code.yun.ink/pkg/mailx/interfaces"
|
||||
"github.com/yuninks/loggerx"
|
||||
)
|
||||
|
||||
func TestSend(t *testing.T) {
|
||||
aliyun := &aliyun.Aliyun{}
|
||||
ctx := context.Background()
|
||||
|
||||
logger := loggerx.NewLogger(ctx)
|
||||
|
||||
ali, err := aliyun.InitEmail(ctx, interfaces.EmailConfigData{
|
||||
Aliyun: &interfaces.EmialConfigDataAliyun{
|
||||
AccessId: "LTAI5tEQ8L8fmDir8udD3CFr",
|
||||
AccessKey: "llg9M1U56s2SW5PuerlKPvTB1xYhn0",
|
||||
Endpoint: "dm.aliyuncs.com",
|
||||
AccountName: "test@email.aisz.org", //"test@email.aisz.org",
|
||||
ReplyAddress: "287852692@qq.com",
|
||||
},
|
||||
}, logger)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
by, err := os.ReadFile("../../../static/email/msg/zh_Hant.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Println(string(by))
|
||||
|
||||
err = ali.Send(ctx, interfaces.Message{
|
||||
To: []string{"huangxinyun@dreaminglife.cn"},
|
||||
Subject: "测试主题",
|
||||
Body: string(by),
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal("resp err", err)
|
||||
}
|
||||
|
||||
t.Log("send success")
|
||||
}
|
||||
|
||||
// func TestSyncStatus(t *testing.T) {
|
||||
// aliyun := &aliyun.Aliyun{}
|
||||
// ctx := context.Background()
|
||||
|
||||
// global.Logger = loggerx.NewLogger(ctx)
|
||||
|
||||
// ali, err := aliyun.InitEmail(ctx, interfaces.EmailConfigData{
|
||||
// Aliyun: &interfaces.EmialConfigDataAliyun{
|
||||
// AccessId: "LTAI5tEQ8L8fmDir8udD3CFr",
|
||||
// AccessKey: "llg9M1U56s2SW5PuerlKPvTB1xYhn0",
|
||||
// Endpoint: "dm.aliyuncs.com",
|
||||
// AccountName: "test@email.aisz.org",
|
||||
// ReplyAddress: "287852692@qq.com",
|
||||
// },
|
||||
// })
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
|
||||
// list, err := ali.SyncStatus(ctx)
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
|
||||
// _ = list
|
||||
|
||||
// // global.Logger.Infof(ctx, "status: %v", list)
|
||||
|
||||
// t.Log("status:", list)
|
||||
|
||||
// }
|
||||
@@ -0,0 +1,160 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
<!-- <link rel="stylesheet" href="./assets/css/index.css" /> -->
|
||||
<style>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#app {
|
||||
width: 480px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
background-color: #1b1b22;
|
||||
}
|
||||
|
||||
.header .logo {
|
||||
width: 95px;
|
||||
}
|
||||
|
||||
.code-main {
|
||||
padding: 22px 24px;
|
||||
}
|
||||
|
||||
.code-tips {
|
||||
color: #5b5b65;
|
||||
font-size: 12px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.code-content {
|
||||
color: #1b1b22;
|
||||
font-weight: bold;
|
||||
font-size: 28px;
|
||||
margin-bottom: 61px;
|
||||
}
|
||||
|
||||
.team-tips {
|
||||
font-size: 11px;
|
||||
color: #5b5b65;
|
||||
margin-bottom: 59px;
|
||||
}
|
||||
|
||||
/* .team-tips::marker {
|
||||
margin-right: 2px !important;
|
||||
} */
|
||||
|
||||
.contact-us {
|
||||
color: #d1d1d1;
|
||||
padding-top: 24px;
|
||||
border-top: solid 0.5px #d1d1d1;
|
||||
}
|
||||
|
||||
.contact-us-info {
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
color: #838384;
|
||||
padding: 0 40px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.contact-tel {
|
||||
color: #838384;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.contact-tel-number {
|
||||
color: #1b1b22;
|
||||
}
|
||||
|
||||
.contact-created-version {
|
||||
color: #838384;
|
||||
text-align: center;
|
||||
margin-top: 7px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
width: 64px;
|
||||
margin: 9px auto 15px;
|
||||
}
|
||||
|
||||
/* 异常邮件 */
|
||||
|
||||
.exception-title {
|
||||
color: #1b1b22;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.exception-content {
|
||||
line-height: 24px;
|
||||
color: #5b5b65;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.exception-ignore {
|
||||
margin-top: 45px;
|
||||
color: #5b5b65;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.exception-team-tips {
|
||||
margin-top: 85px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<header class="header flex-center">
|
||||
<img src="https://abpay-pub.s3.ap-northeast-1.amazonaws.com/1077_1727166836625.png" alt="" class="logo" />
|
||||
</header>
|
||||
|
||||
<main class="code-main">
|
||||
<div class="code-tips">
|
||||
以下是你的 ABPAY 验证码。请注意,该验证码将在 {{.shijian}} 分钟后过期, 请尽快完成验证。
|
||||
</div>
|
||||
|
||||
<div class="code-content">{{.verify_code}}</div>
|
||||
|
||||
<li class="team-tips">ABpay开发者团队服务</li>
|
||||
|
||||
<section class="contact-us">
|
||||
<div class="contact-us-info">
|
||||
本邮件由系统自动发出请勿回复,如需要了解更多服务,欢迎访问ABpay官方网
|
||||
</div>
|
||||
<div class="contact-us-info">还可以通以下方式联系我们</div>
|
||||
|
||||
<img src="https://abpay-pub.s3.ap-northeast-1.amazonaws.com/1077_1727166836625.png" alt="" class="qr-code" />
|
||||
<div class="contact-tel">
|
||||
客服电话:<span class="contact-tel-number">400-278-2890</span>
|
||||
</div>
|
||||
<div class="contact-created-version">2024 ABpay.com.cn . All rightes reserved</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
[info]{"time":"2024-09-25 14:15:35.045218","file":"/aliyun.go:94","func":"func1","gid":"57","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 06:15:34 GMT\",\n \"etag\": \"8f9dfw6sRErJKrt+hoTBWhQ1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"DC2492CF-2A5B-56CB-A605-AEEB8A39E3B4\",\n \"x-acs-trace-id\": \"e616ffedeb4d2a0be8ef74bf36aa7d03\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109262317450\",\n \"RequestId\": \"DC2492CF-2A5B-56CB-A605-AEEB8A39E3B4\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 14:16:59.676574","file":"/aliyun.go:94","func":"func1","gid":"53","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 06:16:59 GMT\",\n \"etag\": \"8XWguuFK0kv64XgUSTRDjQQ1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"396FAEEA-EF53-50D9-86F6-4229E0081279\",\n \"x-acs-trace-id\": \"a70ec22bb9fd7218476ef4363242e166\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109175592530\",\n \"RequestId\": \"396FAEEA-EF53-50D9-86F6-4229E0081279\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 14:17:35.907625","file":"/aliyun.go:94","func":"func1","gid":"52","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 06:17:35 GMT\",\n \"etag\": \"8eICx6U2H3qOv6K8RGRRP7A1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"DC8695D8-D326-52A3-B73B-F916F386B2CF\",\n \"x-acs-trace-id\": \"c826dc3f513763620ba59f048d9d8e71\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109435113590\",\n \"RequestId\": \"DC8695D8-D326-52A3-B73B-F916F386B2CF\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 14:22:38.398287","file":"/aliyun.go:94","func":"func1","gid":"50","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 06:22:38 GMT\",\n \"etag\": \"89EbQ3zPb8RIEJbK53hyAgQ1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"801C56E0-1498-5B09-AF52-DE958E9DB834\",\n \"x-acs-trace-id\": \"1a3d50fec251c83edb55bf48dc431eff\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109262322078\",\n \"RequestId\": \"801C56E0-1498-5B09-AF52-DE958E9DB834\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:20:19.656969","file":"/aliyun.go:94","func":"func1","gid":"53","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:20:19 GMT\",\n \"etag\": \"8+qybIN7HNz96KPKbfNwipw1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"A23D5487-3B08-5F91-8890-C98EDD8A0902\",\n \"x-acs-trace-id\": \"1c20039869fc8fc0a71da2c288a059d5\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109348886893\",\n \"RequestId\": \"A23D5487-3B08-5F91-8890-C98EDD8A0902\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:20:54.628471","file":"/aliyun.go:94","func":"func1","gid":"50","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:20:54 GMT\",\n \"etag\": \"8QixS/p2+Z7xHHIZ/VpSwtQ1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"61555477-0B6F-5E19-B3C1-CAB53CC31AFE\",\n \"x-acs-trace-id\": \"eabe03d20719d8258e78779c4bd37c88\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109175763220\",\n \"RequestId\": \"61555477-0B6F-5E19-B3C1-CAB53CC31AFE\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:21:22.460201","file":"/aliyun.go:94","func":"func1","gid":"16","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:21:22 GMT\",\n \"etag\": \"87/gA8cEkLTFvPqJfgP9K1A1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"76FDF640-FBB0-5B0C-827E-70B92FF62C82\",\n \"x-acs-trace-id\": \"4ad06f6435167d8ccb7e36072cd6acb9\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109320087021\",\n \"RequestId\": \"76FDF640-FBB0-5B0C-827E-70B92FF62C82\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:21:47.550484","file":"/aliyun.go:94","func":"func1","gid":"9","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:21:47 GMT\",\n \"etag\": \"8biiNi4vpUJzYstObqFPfxQ1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"0097D9F9-5143-5B06-B211-50C6F0299471\",\n \"x-acs-trace-id\": \"e1d69216717b0323e90275f6c460c320\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109377685846\",\n \"RequestId\": \"0097D9F9-5143-5B06-B211-50C6F0299471\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:22:23.999040","file":"/aliyun.go:94","func":"func1","gid":"11","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:22:23 GMT\",\n \"etag\": \"8nQth23LiOl8DONamRuHNvg1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"51D36408-D2DB-5D49-AB15-C515C1483B2C\",\n \"x-acs-trace-id\": \"8c3710e125841396fd31b65c69fdd265\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109377686445\",\n \"RequestId\": \"51D36408-D2DB-5D49-AB15-C515C1483B2C\"\n }\n} err:\u003cnil\u003e"]}
|
||||
[info]{"time":"2024-09-25 17:22:45.785559","file":"/aliyun.go:94","func":"func1","gid":"50","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Wed, 25 Sep 2024 09:22:45 GMT\",\n \"etag\": \"8ntJrjXOJMSTVmROovNQlSw1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"AB250371-0BF3-5627-92FB-4924E7127958\",\n \"x-acs-trace-id\": \"a8f4491d14db90fa47134b7f428bcb7e\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109262490484\",\n \"RequestId\": \"AB250371-0BF3-5627-92FB-4924E7127958\"\n }\n} err:\u003cnil\u003e"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
|
||||
[info]{"time":"2024-09-30 11:31:02.535008","file":"/aliyun.go:26","func":"InitEmail","gid":"53","content":["params:{Smtp:\u003cnil\u003e Aws:\u003cnil\u003e Aliyun:0xc0000a3310 Mailgun:\u003cnil\u003e}"]}
|
||||
[info]{"time":"2024-09-30 11:31:02.541008","file":"/aliyun.go:30","func":"InitEmail","gid":"53","content":["params:\u0026{AccessId:LTAI5tEQ8L8fmDir8udD3CFr AccessKey:llg9M1U56s2SW5PuerlKPvTB1xYhn0 Endpoint:dm.aliyuncs.com AccountName:test@email.aisz.org ReplyAddress:287852692@qq.com}"]}
|
||||
[info]{"time":"2024-09-30 11:31:03.017155","file":"/aliyun.go:96","func":"func1","gid":"53","content":["resp:{\n \"headers\": {\n \"access-control-allow-origin\": \"*\",\n \"access-control-expose-headers\": \"*\",\n \"connection\": \"keep-alive\",\n \"content-length\": \"81\",\n \"content-type\": \"application/json;charset=utf-8\",\n \"date\": \"Mon, 30 Sep 2024 03:31:02 GMT\",\n \"etag\": \"8f4BKIO+S82BtzQYSJDv3Sg1\",\n \"keep-alive\": \"timeout=25\",\n \"x-acs-request-id\": \"48DE3F8A-AB82-5A9A-9B73-FD422B247391\",\n \"x-acs-trace-id\": \"80bfb0b978c2b82ac64dd59459485ab2\"\n },\n \"statusCode\": 200,\n \"body\": {\n \"EnvId\": \"600000109324064279\",\n \"RequestId\": \"48DE3F8A-AB82-5A9A-9B73-FD422B247391\"\n }\n} err:\u003cnil\u003e"]}
|
||||
Reference in New Issue
Block a user