Can sync update from 2nd DB.

This commit is contained in:
Yang Luo
2021-05-08 22:04:45 +08:00
parent c76a432003
commit de67ee9014
6 changed files with 57 additions and 23 deletions

View File

@ -15,6 +15,8 @@
package util
import (
"crypto/md5"
"encoding/hex"
"errors"
"fmt"
"strings"
@ -38,3 +40,8 @@ func GenerateId() string {
func GetId(name string) string {
return fmt.Sprintf("admin/%s", name)
}
func GetMd5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
}