mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 17:15:58 +08:00
add management interface
This commit is contained in:
@@ -8,6 +8,7 @@ package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -53,3 +54,11 @@ func JsonStringToStruct(s string, args interface{}) error {
|
||||
err := json.Unmarshal([]byte(s), args)
|
||||
return err
|
||||
}
|
||||
|
||||
func GetMsgID(sendID string) string {
|
||||
t := int64ToString(GetCurrentTimestampByNano())
|
||||
return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano())))
|
||||
}
|
||||
func int64ToString(i int64) string {
|
||||
return strconv.FormatInt(i, 10)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user