fix eventtime

pull/1499/head
AndrewZuo01 2 years ago
parent 69fff628b3
commit 44f1578d8e

@ -16,12 +16,10 @@ package friend
import (
"context"
"github.com/OpenIMSDK/tools/utils"
"time"
"github.com/OpenIMSDK/protocol/constant"
pbfriend "github.com/OpenIMSDK/protocol/friend"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/utils"
cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/http"
@ -36,7 +34,6 @@ func CallbackBeforeAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriend
FromUserID: req.FromUserID,
ToUserID: req.ToUserID,
ReqMsg: req.ReqMsg,
EventTime: time.Now().Unix(),
}
resp := &cbapi.CallbackBeforeAddFriendResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeAddFriend); err != nil {
@ -55,7 +52,6 @@ func CallbackBeforeAddBlack(ctx context.Context, req *pbfriend.AddBlackReq) erro
CallbackCommand: cbapi.CallbackBeforeAddBlackCommand,
OwnerUserID: req.OwnerUserID,
BlackUserID: req.BlackUserID,
EventTime: time.Now().Unix(),
}
resp := &cbapi.CallbackBeforeAddBlackResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeAddBlack); err != nil {
@ -76,7 +72,6 @@ func CallbackAfterAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendR
FromUserID: req.FromUserID,
ToUserID: req.ToUserID,
ReqMsg: req.ReqMsg,
EventTime: time.Now().Unix(),
}
resp := &cbapi.CallbackAfterAddFriendResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackAfterAddFriend); err != nil {
@ -98,7 +93,6 @@ func CallbackBeforeAddFriendAgree(ctx context.Context, req *pbfriend.RespondFrie
ToUserID: req.ToUserID,
HandleMsg: req.HandleMsg,
HandleResult: req.HandleResult,
EventTime: time.Now().Unix(),
}
resp := &cbapi.CallbackBeforeAddFriendAgreeResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeAddFriendAgree); err != nil {
@ -118,7 +112,6 @@ func CallbackAfterDeleteFriend(ctx context.Context, req *pbfriend.DeleteFriendRe
CallbackCommand: cbapi.CallbackAfterDeleteFriendCommand,
OwnerUserID: req.OwnerUserID,
FriendUserID: req.FriendUserID,
EventTime: time.Now().UnixMilli(),
}
resp := &cbapi.CallbackAfterDeleteFriendResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackAfterDeleteFriend); err != nil {
@ -138,7 +131,6 @@ func CallbackBeforeImportFriends(ctx context.Context, req *pbfriend.ImportFriend
CallbackCommand: cbapi.CallbackBeforeImportFriendsCommand,
OwnerUserID: req.OwnerUserID,
FriendUserIDs: req.FriendUserIDs,
EventTime: time.Now().UnixMilli(),
}
resp := &cbapi.CallbackBeforeImportFriendsResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeImportFriends); err != nil {
@ -158,7 +150,6 @@ func CallbackAfterImportFriends(ctx context.Context, req *pbfriend.ImportFriendR
CallbackCommand: cbapi.CallbackAfterImportFriendsCommand,
OwnerUserID: req.OwnerUserID,
FriendUserIDs: req.FriendUserIDs,
EventTime: time.Now().UnixMilli(),
}
resp := &cbapi.CallbackAfterImportFriendsResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackAfterImportFriends); err != nil {
@ -179,7 +170,6 @@ func CallbackAfterRemoveBlack(ctx context.Context, req *pbfriend.RemoveBlackReq)
CallbackCommand: cbapi.CallbackAfterRemoveBlackCommand,
OwnerUserID: req.OwnerUserID,
BlackUserID: req.BlackUserID,
EventTime: time.Now().UnixMilli(),
}
resp := &cbapi.CallbackAfterRemoveBlackResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackAfterRemoveBlack); err != nil {

@ -183,7 +183,6 @@ func CallbackBeforeInviteUserToGroup(ctx context.Context, req *group.InviteUserT
GroupID: req.GroupID,
Reason: req.Reason,
InvitedUserIDs: req.InvitedUserIDs,
EventTime: time.Now().Unix(),
}
resp := &callbackstruct.CallbackBeforeInviteUserToGroupResp{}
@ -219,7 +218,6 @@ func CallbackAfterJoinGroup(ctx context.Context, req *group.JoinGroupReq) error
ReqMessage: req.ReqMessage,
JoinSource: req.JoinSource,
InviterUserID: req.InviterUserID,
EventTime: time.Now().Unix(),
}
resp := &callbackstruct.CallbackAfterJoinGroupResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, callbackReq, resp, config.Config.Callback.CallbackAfterJoinGroup); err != nil {
@ -242,7 +240,6 @@ func CallbackBeforeSetGroupInfo(ctx context.Context, req *group.SetGroupInfoReq)
Introduction: req.GroupInfoForSet.Introduction,
FaceURL: req.GroupInfoForSet.FaceURL,
GroupName: req.GroupInfoForSet.GroupName,
EventTime: time.Now().Unix(),
}
if req.GroupInfoForSet.Ex != nil {
@ -293,7 +290,6 @@ func CallbackAfterSetGroupInfo(ctx context.Context, req *group.SetGroupInfoReq)
Introduction: req.GroupInfoForSet.Introduction,
FaceURL: req.GroupInfoForSet.FaceURL,
GroupName: req.GroupInfoForSet.GroupName,
EventTime: time.Now().Unix(),
}
if req.GroupInfoForSet.Ex != nil {
callbackReq.Ex = &req.GroupInfoForSet.Ex.Value

@ -16,16 +16,14 @@ package msg
import (
"context"
"github.com/OpenIMSDK/protocol/sdkws"
"google.golang.org/protobuf/proto"
"time"
"github.com/OpenIMSDK/protocol/constant"
pbchat "github.com/OpenIMSDK/protocol/msg"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/mcontext"
"github.com/OpenIMSDK/tools/utils"
"google.golang.org/protobuf/proto"
cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct"
@ -188,7 +186,6 @@ func CallbackAfterRevokeMsg(ctx context.Context, req *pbchat.RevokeMsgReq) error
ConversationID: req.ConversationID,
Seq: req.Seq,
UserID: req.UserID,
EventTime: time.Now().Unix(),
}
resp := &cbapi.CallbackAfterSendGroupMsgResp{}
if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, callbackReq, resp, config.Config.Callback.CallbackAfterSetGroupInfo); err != nil {

@ -19,7 +19,6 @@ type CallbackBeforeAddFriendReq struct {
FromUserID string `json:"fromUserID" `
ToUserID string `json:"toUserID"`
ReqMsg string `json:"reqMsg"`
EventTime int64 `json:"eventTime"`
}
type CallbackBeforeAddFriendResp struct {
@ -30,7 +29,6 @@ type CallbackAfterAddFriendReq struct {
FromUserID string `json:"fromUserID" `
ToUserID string `json:"toUserID"`
ReqMsg string `json:"reqMsg"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterAddFriendResp struct {
@ -40,7 +38,6 @@ type CallbackBeforeAddBlackReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"ownerUserID" `
BlackUserID string `json:"blackUserID"`
EventTime int64 `json:"eventTime"`
}
type CallbackBeforeAddBlackResp struct {
@ -51,9 +48,8 @@ type CallbackBeforeAddFriendAgreeReq struct {
CallbackCommand `json:"callbackCommand"`
FromUserID string `json:"fromUserID" `
ToUserID string `json:"blackUserID"`
HandleResult int32 `json:"HandleResult"'`
HandleMsg string `json:"HandleMsg"'`
EventTime int64 `json:"eventTime"`
HandleResult int32 `json:"HandleResult"`
HandleMsg string `json:"HandleMsg"`
}
type CallbackBeforeAddFriendAgreeResp struct {
@ -64,7 +60,6 @@ type CallbackAfterDeleteFriendReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"ownerUserID" `
FriendUserID string `json:"friendUserID"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterDeleteFriendResp struct {
CommonCallbackResp
@ -74,7 +69,6 @@ type CallbackBeforeImportFriendsReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"ownerUserID" `
FriendUserIDs []string `json:"friendUserIDs"`
EventTime int64 `json:"eventTime"`
}
type CallbackBeforeImportFriendsResp struct {
CommonCallbackResp
@ -83,7 +77,6 @@ type CallbackAfterImportFriendsReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"ownerUserID" `
FriendUserIDs []string `json:"friendUserIDs"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterImportFriendsResp struct {
CommonCallbackResp
@ -92,8 +85,7 @@ type CallbackAfterImportFriendsResp struct {
type CallbackAfterRemoveBlackReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"ownerUserID"`
BlackUserID string `json:"blackUserID""`
EventTime int64 `json:"eventTime"`
BlackUserID string `json:"blackUserID"`
}
type CallbackAfterRemoveBlackResp struct {
CommonCallbackResp

@ -93,7 +93,6 @@ type CallbackBeforeInviteUserToGroupReq struct {
GroupID string `json:"groupID"`
Reason string `json:"reason"`
InvitedUserIDs []string `json:"invitedUserIDs"`
EventTime int64 `json:"eventTime"`
}
type CallbackBeforeInviteUserToGroupResp struct {
CommonCallbackResp
@ -107,7 +106,6 @@ type CallbackAfterJoinGroupReq struct {
ReqMessage string `json:"reqMessage"`
JoinSource int32 `json:"joinSource"`
InviterUserID string `json:"inviterUserID"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterJoinGroupResp struct {
CommonCallbackResp
@ -125,7 +123,6 @@ type CallbackBeforeSetGroupInfoReq struct {
NeedVerification int32 `json:"needVerification"`
LookMemberInfo int32 `json:"lookMemberInfo"`
ApplyMemberFriend int32 `json:"applyMemberFriend"`
EventTime int64 `json:"eventTime"`
}
type CallbackBeforeSetGroupInfoResp struct {
@ -153,7 +150,6 @@ type CallbackAfterSetGroupInfoReq struct {
NeedVerification *int32 `json:"needVerification"`
LookMemberInfo *int32 `json:"lookMemberInfo"`
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterSetGroupInfoResp struct {

@ -5,7 +5,6 @@ type CallbackAfterRevokeMsgReq struct {
ConversationID string `json:"conversationID"`
Seq int64 `json:"seq"`
UserID string `json:"userID"`
EventTime int64 `json:"eventTime"`
}
type CallbackAfterRevokeMsgResp struct {
CommonCallbackResp

Loading…
Cancel
Save