feat: add api of get server time

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
This commit is contained in:
Gordon
2023-08-17 12:41:52 +08:00
parent 33f9e28865
commit 2639ecb7ce
5 changed files with 10 additions and 4 deletions
+3
View File
@@ -363,3 +363,6 @@ func (m *MessageApi) GetActiveGroup(c *gin.Context) {
func (m *MessageApi) SearchMsg(c *gin.Context) {
a2r.Call(msg.MsgClient.SearchMessage, m.Client, c)
}
func (m *MessageApi) GetServerTime(c *gin.Context) {
a2r.Call(msg.MsgClient.GetServerTime, m.Client, c)
}
+1
View File
@@ -187,6 +187,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
msgGroup.POST("/batch_send_msg", m.BatchSendMsg)
msgGroup.POST("/check_msg_is_send_success", m.CheckMsgIsSendSuccess)
msgGroup.POST("/get_server_time", m.GetServerTime)
}
// Conversation
conversationGroup := r.Group("/conversation", ParseToken)
+3 -1
View File
@@ -16,7 +16,6 @@ package msg
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
@@ -188,3 +187,6 @@ func (m *msgServer) SearchMessage(ctx context.Context, req *msg.SearchMessageReq
resp.ChatLogsNum = total
return resp, nil
}
func (m *msgServer) GetServerTime(ctx context.Context, _ *msg.GetServerTimeReq) (*msg.GetServerTimeResp, error) {
return &msg.GetServerTimeResp{ServerTime: utils.GetCurrentTimestampByMill()}, nil
}