diff --git a/tests/client-bench/main.go b/tests/client-bench/main.go index 5cebca8..8c77987 100644 --- a/tests/client-bench/main.go +++ b/tests/client-bench/main.go @@ -55,8 +55,8 @@ func runClient(uid string) { func messageToRandomClient(uid string) error { msg := messagev1.SendMessageReq{ - FromUser: uid, - ToUser: randomUID(), + From: uid, + To: randomUID(), ContentType: messagev1.MessageContentType_Text, Content: randomMsg(20), } diff --git a/tests/client-gui/client.go b/tests/client-gui/client.go index 13cff11..f3a71ff 100644 --- a/tests/client-gui/client.go +++ b/tests/client-gui/client.go @@ -13,10 +13,11 @@ import ( "strings" "time" - friendpb "github.com/go-goim/api/user/friend/v1" "github.com/gorilla/websocket" "github.com/jroimartin/gocui" + friendpb "github.com/go-goim/api/user/friend/v1" + userv1 "github.com/go-goim/api/user/v1" messagev1 "github.com/go-goim/api/message/v1" @@ -291,7 +292,7 @@ func handleConn(conn *websocket.Conn, g *gocui.Gui, dataChan chan []byte) { case <-ticker.C: conn.WriteControl(websocket.PingMessage, []byte("ping"), time.Now().Add(time.Second)) case data := <-dataChan: - msg := new(messagev1.BriefMessage) + msg := new(messagev1.Message) if err := json.Unmarshal(data, msg); err != nil { logger.Println("unmarshal err:", err) msg.Content = string(data) @@ -305,7 +306,7 @@ func handleConn(conn *websocket.Conn, g *gocui.Gui, dataChan chan []byte) { return err1 } fmt.Fprintln(v, "------") - fmt.Fprintf(v, "Receive|From:%s|Tp:%v|Content:%s|Seq:%s\n", msg.GetFromUser(), msg.GetContentType(), msg.GetContent(), msg.GetMsgSeq()) + fmt.Fprintf(v, "Receive|From:%s|Tp:%v|Content:%s|Seq:%d\n", msg.GetFrom(), msg.GetContentType(), msg.GetContent(), msg.GetMsgId()) return nil }) diff --git a/tests/client-gui/layout.go b/tests/client-gui/layout.go index 82c5ec8..a6622a5 100644 --- a/tests/client-gui/layout.go +++ b/tests/client-gui/layout.go @@ -170,8 +170,8 @@ func resetInput(g *gocui.Gui, v *gocui.View) error { io.Copy(buf, v) // todo need load friend list then send msg m := &messagev1.SendMessageReq{ - FromUser: curUser.Uid, - ToUser: toUid, + From: curUser.Uid, + To: toUid, ContentType: 1, Content: strings.TrimSuffix(buf.String(), "\n"), } @@ -209,7 +209,7 @@ func resetInput(g *gocui.Gui, v *gocui.View) error { return err1 } fmt.Fprintln(v, "------") - fmt.Fprintf(v, "Send|From:%v|Tp:%v|Content:%v\n", m.FromUser, m.ContentType, m.Content) + fmt.Fprintf(v, "Send|From:%v|Tp:%v|Content:%v\n", m.From, m.ContentType, m.Content) return nil }) return nil