Commit c6573c1c by 李洪

添加time

parent 704a084f
package helper package helper
import ( import (
"context"
"errors" "errors"
"im-microservice/db"
"log" "log"
"time"
"gopkg.in/go-playground/validator.v9" "gopkg.in/go-playground/validator.v9"
) )
...@@ -19,3 +22,18 @@ func Valiator(in interface{}) error { ...@@ -19,3 +22,18 @@ func Valiator(in interface{}) error {
} }
return nil 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