parent
69423e86c0
commit
79c22600d8
@ -1,12 +0,0 @@
|
||||
package handle
|
||||
|
||||
import "github.com/jinzhu/gorm"
|
||||
|
||||
type WechatLog struct {
|
||||
gorm.Model
|
||||
ToUsername string `xml:"ToUserName"`
|
||||
FromUsername string `xml:"FromUserName"`
|
||||
CreateTime uint32 `xml:"CreateTime"`
|
||||
MsgType string `xml:"MsgType"`
|
||||
Content string `xml:"Content"`
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
/**
|
||||
@author: sre
|
||||
@date: 2022/8/10 0010
|
||||
@desc: md5sum a string
|
||||
**/
|
||||
//Md5String that md5sum a string
|
||||
func Md5String(s string) string {
|
||||
h := md5.New()
|
||||
h.Write([]byte(s))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
/*
|
||||
*
|
||||
@author: sre
|
||||
@date: 2022/8/10 0010
|
||||
@desc: test md5String
|
||||
*
|
||||
*/
|
||||
func TestMd5String(t *testing.T) {
|
||||
s := Md5String("hello")
|
||||
fmt.Println(s)
|
||||
}
|
||||
Loading…
Reference in new issue