Add internal/sms/mock.go
This commit is contained in:
13
internal/sms/mock.go
Normal file
13
internal/sms/mock.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package sms
|
||||
|
||||
import "log"
|
||||
|
||||
// MockSender 模拟短信发送器,用于开发模式
|
||||
// 不真实发送短信,仅通过日志打印验证码,便于本地调试
|
||||
type MockSender struct{}
|
||||
|
||||
// Send 模拟发送验证码,打印到日志并返回 nil
|
||||
func (m *MockSender) Send(phone string, code string) error {
|
||||
log.Printf("[MockSMS] 手机号: %s, 验证码: %s", phone, code)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user