对接阿里云短信OK
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package sms
|
||||
|
||||
import "context"
|
||||
|
||||
type UnavailableProvider struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func NewUnavailableProvider(err error) *UnavailableProvider {
|
||||
return &UnavailableProvider{err: err}
|
||||
}
|
||||
|
||||
func (p *UnavailableProvider) SendLoginCode(ctx context.Context, phone string, code string) error {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
if p.err != nil {
|
||||
return p.err
|
||||
}
|
||||
return ErrProviderConfigInvalid
|
||||
}
|
||||
Reference in New Issue
Block a user