mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
feat: update openim server code
This commit is contained in:
parent
c1781ce5b0
commit
a7313be794
2
Makefile
2
Makefile
@ -184,7 +184,7 @@ test-e2e:
|
|||||||
imports:
|
imports:
|
||||||
@$(MAKE) go.imports
|
@$(MAKE) go.imports
|
||||||
|
|
||||||
## clean: Remove all files that are created by building. ✨
|
## clean: Delete all files created by the build, as well as all log files. ✨
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@$(MAKE) go.clean
|
@$(MAKE) go.clean
|
||||||
|
|||||||
@ -308,7 +308,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var recvIDs []string
|
var recvIDs []string
|
||||||
var err error
|
|
||||||
if req.IsSendAll {
|
if req.IsSendAll {
|
||||||
pageNumber := 1
|
pageNumber := 1
|
||||||
showNumber := 500
|
showNumber := 500
|
||||||
|
|||||||
@ -47,12 +47,12 @@ func NewAuthDatabase(cache cache.MsgModel, accessSecret string, accessExpire int
|
|||||||
return &authDatabase{cache: cache, accessSecret: accessSecret, accessExpire: accessExpire}
|
return &authDatabase{cache: cache, accessSecret: accessSecret, accessExpire: accessExpire}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the result is empty
|
// If the result is empty.
|
||||||
func (a *authDatabase) GetTokensWithoutError(ctx context.Context, userID string, platformID int) (map[string]int, error) {
|
func (a *authDatabase) GetTokensWithoutError(ctx context.Context, userID string, platformID int) (map[string]int, error) {
|
||||||
return a.cache.GetTokensWithoutError(ctx, userID, platformID)
|
return a.cache.GetTokensWithoutError(ctx, userID, platformID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Token
|
// Create Token.
|
||||||
func (a *authDatabase) CreateToken(ctx context.Context, userID string, platformID int) (string, error) {
|
func (a *authDatabase) CreateToken(ctx context.Context, userID string, platformID int) (string, error) {
|
||||||
tokens, err := a.cache.GetTokensWithoutError(ctx, userID, platformID)
|
tokens, err := a.cache.GetTokensWithoutError(ctx, userID, platformID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -113,7 +113,7 @@ func (f *friendDatabase) CheckIn(ctx context.Context, userID1, userID2 string) (
|
|||||||
return inUser1Friends, inUser2Friends, nil
|
return inUser1Friends, inUser2Friends, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddFriendRequest adds or updates a friend request
|
// AddFriendRequest adds or updates a friend request.
|
||||||
func (f *friendDatabase) AddFriendRequest(ctx context.Context, fromUserID, toUserID string, reqMsg string, ex string) (err error) {
|
func (f *friendDatabase) AddFriendRequest(ctx context.Context, fromUserID, toUserID string, reqMsg string, ex string) (err error) {
|
||||||
return f.tx.Transaction(ctx, func(ctx context.Context) error {
|
return f.tx.Transaction(ctx, func(ctx context.Context) error {
|
||||||
_, err := f.friendRequest.Take(ctx, fromUserID, toUserID)
|
_, err := f.friendRequest.Take(ctx, fromUserID, toUserID)
|
||||||
@ -197,7 +197,7 @@ func (f *friendDatabase) RefuseFriendRequest(ctx context.Context, friendRequest
|
|||||||
|
|
||||||
// Log the action of refusing the friend request for debugging and auditing purposes.
|
// Log the action of refusing the friend request for debugging and auditing purposes.
|
||||||
log.ZDebug(ctx, "Refusing friend request", map[string]interface{}{
|
log.ZDebug(ctx, "Refusing friend request", map[string]interface{}{
|
||||||
"DB_FriendRequest": fr,
|
"DB_FriendRequest": fr,
|
||||||
"Arg_FriendRequest": friendRequest,
|
"Arg_FriendRequest": friendRequest,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient)
|
|||||||
return &ConversationNotificationSender{rpcclient.NewNotificationSender(rpcclient.WithRpcClient(msgRpcClient))}
|
return &ConversationNotificationSender{rpcclient.NewNotificationSender(rpcclient.WithRpcClient(msgRpcClient))}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPrivate invote
|
// SetPrivate invote.
|
||||||
func (c *ConversationNotificationSender) ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string,
|
func (c *ConversationNotificationSender) ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string,
|
||||||
isPrivateChat bool, conversationID string,
|
isPrivateChat bool, conversationID string,
|
||||||
) error {
|
) error {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
GO := go
|
GO := go
|
||||||
GO_SUPPORTED_VERSIONS ?= 1.19|1.20|1.21|1.22
|
GO_SUPPORTED_VERSIONS ?= 1.19|1.20|1.21|1.22|1.23
|
||||||
|
|
||||||
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
||||||
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
||||||
|
|||||||
1
test/codescan/main.go
Normal file
1
test/codescan/main.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package main
|
||||||
Loading…
x
Reference in New Issue
Block a user