File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,17 @@ func sync(c *gin.Context) {
156156 // 从请求中获取groupid和last_msgid
157157 groupID := c .GetInt64 ("groupid" )
158158 lastMsgIDStr := c .Query ("msgid" )
159+ startSync := c .Query ("sync" ) != "false"
160+ usePrev := c .Query ("prev" ) == "true"
161+ msgLimitStr := c .Query ("limit" )
162+ if msgLimitStr == "" {
163+ msgLimitStr = "128"
164+ }
165+ msgLimit64 , err := strconv .Atoi (msgLimitStr )
166+ if err != nil || msgLimit64 <= 0 {
167+ msgLimit64 = 128
168+ }
169+ msgLimit := int32 (msgLimit64 )
159170
160171 if groupID == 0 {
161172 jsonData , _ := json .Marshal (gin.H {
@@ -200,6 +211,9 @@ func sync(c *gin.Context) {
200211 req := & pb.SyncMessageRequest {
201212 Groupid : groupID ,
202213 LastMsgid : msgid ,
214+ Prev : usePrev ,
215+ Sync : startSync ,
216+ Limit : msgLimit ,
203217 }
204218
205219 // 调用gRPC服务端流方法
You can’t perform that action at this time.
0 commit comments