You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/libs/sms/aliyun.go

38 lines
860 B
Go

//
// Copyright (C) 2024 veypi <i@veypi.com>
// 2025-03-04 16:08:06
// Distributed under terms of the MIT license.
//
package sms
import (
"fmt"
)
// AliyunProvider 阿里云短信
type AliyunProvider struct {
accessKey string
accessSecret string
signName string
templateCode string
}
// NewAliyunProvider 创建阿里云短信提供商
func NewAliyunProvider(accessKey, accessSecret, signName, templateCode string) (*AliyunProvider, error) {
return &AliyunProvider{
accessKey: accessKey,
accessSecret: accessSecret,
signName: signName,
templateCode: templateCode,
}, nil
}
// Send 发送短信
func (p *AliyunProvider) Send(phone, code string) error {
// TODO: 实现阿里云短信发送逻辑
// 这里简化处理,实际应调用阿里云 SDK
fmt.Printf("[AliyunSMS] Send code %s to %s\n", code, phone)
return nil
}