You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
619 B
29 lines
619 B
2 months ago
|
package msg
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
"wss-pool/config"
|
||
|
"wss-pool/internal/data"
|
||
|
red "wss-pool/internal/redis"
|
||
|
)
|
||
|
|
||
|
func TestCreateRandCode(t *testing.T) {
|
||
|
fmt.Println("生成短信编号:", CreateRandCode())
|
||
|
}
|
||
|
|
||
|
func TestCreateRandCodeTest(t *testing.T) {
|
||
|
fmt.Println("生成发送者编号:", CreateRandCodeTest())
|
||
|
}
|
||
|
|
||
|
func TestRun(t *testing.T) {
|
||
|
red.RedisClient = red.RedisInit(config.Config.Redis.DbTen)
|
||
|
data.InitMysql(config.Config.Bourse)
|
||
|
code, err := RunSendSms("6001155042087")
|
||
|
if err != nil {
|
||
|
fmt.Println("发送短信失败:", err)
|
||
|
return
|
||
|
}
|
||
|
fmt.Println("发送短信成功......", code)
|
||
|
}
|