mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 06:19:20 +08:00
Organization
This commit is contained in:
committed by
Xinwei Xiong(cubxxw-openim)
parent
066fae0b74
commit
2d57f742e2
@@ -23,8 +23,9 @@ func UserRegister(c *gin.Context) {
|
||||
}
|
||||
|
||||
if params.Secret != config.Config.Secret {
|
||||
log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"})
|
||||
errMsg := " params.Secret != config.Config.Secret "
|
||||
log.NewError(params.OperationID, errMsg, params.Secret, config.Config.Secret)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg})
|
||||
return
|
||||
}
|
||||
req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}}
|
||||
@@ -36,7 +37,7 @@ func UserRegister(c *gin.Context) {
|
||||
client := rpc.NewAuthClient(etcdConn)
|
||||
reply, err := client.UserRegister(context.Background(), req)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "call rpc err ", err)
|
||||
log.NewError(req.OperationID, "call rpc err ", err.Error())
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -56,10 +56,14 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin
|
||||
}
|
||||
}
|
||||
if tag {
|
||||
log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg))
|
||||
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
||||
log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String())
|
||||
return
|
||||
if config.Config.ChatPersistenceMysql == true {
|
||||
log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg))
|
||||
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
||||
log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String())
|
||||
return
|
||||
}
|
||||
} else {
|
||||
log.Debug(msgFromMQ.OperationID, "don't insert to db", string(msg))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user