mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-08 21:47:17 +08:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
af23599100
@ -103,12 +103,12 @@ v := make([]string, 0, 4)
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
// bad
|
// bad
|
||||||
var_s string = F()
|
var s string = F()
|
||||||
|
|
||||||
func F() string { return "A" }
|
func F() string { return "A" }
|
||||||
|
|
||||||
// good
|
// good
|
||||||
var_s = F()
|
var s = F()
|
||||||
// Since F already explicitly returns a string type, we don't need to explicitly specify the type of _s
|
// Since F already explicitly returns a string type, we don't need to explicitly specify the type of _s
|
||||||
// still of that type
|
// still of that type
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ const (
|
|||||||
// ErrUnknown - 0: An unknown error occurred.
|
// ErrUnknown - 0: An unknown error occurred.
|
||||||
ErrUnknown Code = iota
|
ErrUnknown Code = iota
|
||||||
// ErrFatal - 1: An fatal error occurred.
|
// ErrFatal - 1: An fatal error occurred.
|
||||||
Err Fatal
|
ErrFatal
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ package superman
|
|||||||
### 3.1 Package Notes
|
### 3.1 Package Notes
|
||||||
|
|
||||||
- Each package has one and only one package-level annotation.
|
- Each package has one and only one package-level annotation.
|
||||||
- Package comments are uniformly commented with // in the format of `// Package package name package description`, for example:
|
- Package comments are uniformly commented with // in the format of `// Package <package name> package description`, for example:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Package genericclioptions contains flags which can be added to you command, bound, completed, and produce
|
// Package genericclioptions contains flags which can be added to you command, bound, completed, and produce
|
||||||
@ -757,7 +757,7 @@ defer fd. Close()
|
|||||||
- If only the first item (key) is needed, discard the second.
|
- If only the first item (key) is needed, discard the second.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
for key := range keys {
|
for keyIndex := range keys {
|
||||||
// normal code
|
// normal code
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@ -15,14 +15,12 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
@ -56,7 +54,6 @@ func (MessageApi) SetOptions(options map[string]bool, value bool) {
|
|||||||
|
|
||||||
func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) *msg.SendMsgReq {
|
func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg) *msg.SendMsgReq {
|
||||||
var newContent string
|
var newContent string
|
||||||
var err error
|
|
||||||
options := make(map[string]bool, 5)
|
options := make(map[string]bool, 5)
|
||||||
switch params.ContentType {
|
switch params.ContentType {
|
||||||
case constant.Text:
|
case constant.Text:
|
||||||
@ -106,14 +103,14 @@ func (m MessageApi) newUserSendMsgReq(c *gin.Context, params *apistruct.SendMsg)
|
|||||||
OfflinePushInfo: params.OfflinePushInfo,
|
OfflinePushInfo: params.OfflinePushInfo,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if params.ContentType == constant.OANotification {
|
//if params.ContentType == constant.OANotification {
|
||||||
var tips sdkws.TipsComm
|
// var tips sdkws.TipsComm
|
||||||
tips.JsonDetail = utils.StructToJsonString(params.Content)
|
// tips.JsonDetail = utils.StructToJsonString(params.Content)
|
||||||
pbData.MsgData.Content, err = proto.Marshal(&tips)
|
// pbData.MsgData.Content, err = proto.Marshal(&tips)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
log.ZError(c, "Marshal failed ", err, "tips", tips.String())
|
// log.ZError(c, "Marshal failed ", err, "tips", tips.String())
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
return &pbData
|
return &pbData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,6 @@ func (c *Client) readMessage() {
|
|||||||
}
|
}
|
||||||
switch messageType {
|
switch messageType {
|
||||||
case MessageBinary:
|
case MessageBinary:
|
||||||
_ = c.conn.SetReadDeadline(pongWait)
|
|
||||||
parseDataErr := c.handleMessage(message)
|
parseDataErr := c.handleMessage(message)
|
||||||
if parseDataErr != nil {
|
if parseDataErr != nil {
|
||||||
c.closedErr = parseDataErr
|
c.closedErr = parseDataErr
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user