Commit c6573c1c by 李洪

添加time

parent 704a084f
package helper
import (
"context"
"errors"
"im-microservice/db"
"log"
"time"
"gopkg.in/go-playground/validator.v9"
)
......@@ -19,3 +22,18 @@ func Valiator(in interface{}) error {
}
return nil
}
func GetNowTime() string {
return time.Now().Format("2006-01-02 15:04:05")
}
var ctx = context.Background()
func GetCode(mobile string) (string, error) {
val, err := db.RedisClient.Get(ctx, mobile).Result()
if err != nil {
return "", err
}
return val, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment