diff --git a/pool/publicApi.go b/pool/publicApi.go index 28ff94cad4fcad14a771a7f361a35c49ce3801f8..5a1c51f8f83c5f547e41d2d90abb2f7545335ada 100755 --- a/pool/publicApi.go +++ b/pool/publicApi.go @@ -491,9 +491,8 @@ func GetAllList(key string) map[string]string { } func AppendConversationRecord(msg *SetMsgReq) { - msg.Sender = StrCut(msg.Sender) - msg.Receiver = StrCut(msg.Receiver) - Redis.HSetNX("msg:"+strconv.Itoa(msg.ConversationId), msg.Sender+":"+msg.Receiver+":"+msg.SendTime, string(SerializeJson(msg))) + Redis.HSetNX("msg:"+strconv.Itoa(msg.ConversationId), StrCut(msg.Sender)+":"+StrCut(msg.Receiver)+":"+msg.SendTime, string(SerializeJson(msg))) + //Redis.Set("msg:"+strconv.Itoa(msg.ConversationId),msg.SendTime,0) return } @@ -516,6 +515,17 @@ func DelClient(clientId, clientUser string) { return } +func SetDelConversation() { + res := Redis.HKeys("msg*") + data := res.Val() + + //fmt.Println(err) + fmt.Println(data) + //for _,v := range data { + // DelConversation() + //} +} + func SetEnd() { //conversationList := GetAllList(convKey) //for _, vClients := range conversationList {