remove unused paramaters.

This commit is contained in:
Monet Lee 2025-03-14 16:00:33 +08:00
parent cae28764e9
commit 8145f678af
2 changed files with 108 additions and 230 deletions

View File

@ -18,7 +18,6 @@ func (c *conversationServer) webhookBeforeCreateSingleChatConversations(ctx cont
ConversationID: req.ConversationID,
ConversationType: req.ConversationType,
UserID: req.UserID,
GroupID: req.GroupID,
RecvMsgOpt: req.RecvMsgOpt,
IsPinned: req.IsPinned,
IsPrivateChat: req.IsPrivateChat,
@ -26,12 +25,6 @@ func (c *conversationServer) webhookBeforeCreateSingleChatConversations(ctx cont
GroupAtType: req.GroupAtType,
AttachedInfo: req.AttachedInfo,
Ex: req.Ex,
MaxSeq: req.MaxSeq,
MinSeq: req.MinSeq,
CreateTime: req.CreateTime,
IsMsgDestruct: req.IsMsgDestruct,
MsgDestructTime: req.MsgDestructTime,
LatestMsgDestructTime: req.LatestMsgDestructTime,
}
resp := &callbackstruct.CallbackBeforeCreateSingleChatConversationsResp{}
@ -40,11 +33,6 @@ func (c *conversationServer) webhookBeforeCreateSingleChatConversations(ctx cont
return err
}
datautil.NotNilReplace(&req.OwnerUserID, resp.OwnerUserID)
datautil.NotNilReplace(&req.ConversationID, resp.ConversationID)
datautil.NotNilReplace(&req.ConversationType, resp.ConversationType)
datautil.NotNilReplace(&req.UserID, resp.UserID)
datautil.NotNilReplace(&req.GroupID, resp.GroupID)
datautil.NotNilReplace(&req.RecvMsgOpt, resp.RecvMsgOpt)
datautil.NotNilReplace(&req.IsPinned, resp.IsPinned)
datautil.NotNilReplace(&req.IsPrivateChat, resp.IsPrivateChat)
@ -52,13 +40,6 @@ func (c *conversationServer) webhookBeforeCreateSingleChatConversations(ctx cont
datautil.NotNilReplace(&req.GroupAtType, resp.GroupAtType)
datautil.NotNilReplace(&req.AttachedInfo, resp.AttachedInfo)
datautil.NotNilReplace(&req.Ex, resp.Ex)
datautil.NotNilReplace(&req.MaxSeq, resp.MaxSeq)
datautil.NotNilReplace(&req.MinSeq, resp.MinSeq)
datautil.NotNilReplace(&req.CreateTime, resp.CreateTime)
datautil.NotNilReplace(&req.IsMsgDestruct, resp.IsMsgDestruct)
datautil.NotNilReplace(&req.MsgDestructTime, resp.MsgDestructTime)
datautil.NotNilReplace(&req.LatestMsgDestructTime, resp.LatestMsgDestructTime)
return nil
})
}
@ -70,7 +51,6 @@ func (c *conversationServer) webhookAfterCreateSingleChatConversations(ctx conte
ConversationID: req.ConversationID,
ConversationType: req.ConversationType,
UserID: req.UserID,
GroupID: req.GroupID,
RecvMsgOpt: req.RecvMsgOpt,
IsPinned: req.IsPinned,
IsPrivateChat: req.IsPrivateChat,
@ -78,12 +58,6 @@ func (c *conversationServer) webhookAfterCreateSingleChatConversations(ctx conte
GroupAtType: req.GroupAtType,
AttachedInfo: req.AttachedInfo,
Ex: req.Ex,
MaxSeq: req.MaxSeq,
MinSeq: req.MinSeq,
CreateTime: req.CreateTime,
IsMsgDestruct: req.IsMsgDestruct,
MsgDestructTime: req.MsgDestructTime,
LatestMsgDestructTime: req.LatestMsgDestructTime,
}
c.webhookClient.AsyncPost(ctx, cbReq.GetCallbackCommand(), cbReq, &callbackstruct.CallbackAfterCreateSingleChatConversationsResp{}, after)
@ -104,12 +78,6 @@ func (c *conversationServer) webhookBeforeCreateGroupChatConversations(ctx conte
GroupAtType: req.GroupAtType,
AttachedInfo: req.AttachedInfo,
Ex: req.Ex,
MaxSeq: req.MaxSeq,
MinSeq: req.MinSeq,
CreateTime: req.CreateTime,
IsMsgDestruct: req.IsMsgDestruct,
MsgDestructTime: req.MsgDestructTime,
LatestMsgDestructTime: req.LatestMsgDestructTime,
}
resp := &callbackstruct.CallbackBeforeCreateGroupChatConversationsResp{}
@ -118,9 +86,6 @@ func (c *conversationServer) webhookBeforeCreateGroupChatConversations(ctx conte
return err
}
datautil.NotNilReplace(&req.ConversationID, resp.ConversationID)
datautil.NotNilReplace(&req.ConversationType, resp.ConversationType)
datautil.NotNilReplace(&req.GroupID, resp.GroupID)
datautil.NotNilReplace(&req.RecvMsgOpt, resp.RecvMsgOpt)
datautil.NotNilReplace(&req.IsPinned, resp.IsPinned)
datautil.NotNilReplace(&req.IsPrivateChat, resp.IsPrivateChat)
@ -128,12 +93,6 @@ func (c *conversationServer) webhookBeforeCreateGroupChatConversations(ctx conte
datautil.NotNilReplace(&req.GroupAtType, resp.GroupAtType)
datautil.NotNilReplace(&req.AttachedInfo, resp.AttachedInfo)
datautil.NotNilReplace(&req.Ex, resp.Ex)
datautil.NotNilReplace(&req.MaxSeq, resp.MaxSeq)
datautil.NotNilReplace(&req.MinSeq, resp.MinSeq)
datautil.NotNilReplace(&req.CreateTime, resp.CreateTime)
datautil.NotNilReplace(&req.IsMsgDestruct, resp.IsMsgDestruct)
datautil.NotNilReplace(&req.MsgDestructTime, resp.MsgDestructTime)
datautil.NotNilReplace(&req.LatestMsgDestructTime, resp.LatestMsgDestructTime)
return nil
})
}
@ -151,12 +110,6 @@ func (c *conversationServer) webhookAfterCreateGroupChatConversations(ctx contex
GroupAtType: req.GroupAtType,
AttachedInfo: req.AttachedInfo,
Ex: req.Ex,
MaxSeq: req.MaxSeq,
MinSeq: req.MinSeq,
CreateTime: req.CreateTime,
IsMsgDestruct: req.IsMsgDestruct,
MsgDestructTime: req.MsgDestructTime,
LatestMsgDestructTime: req.LatestMsgDestructTime,
}
c.webhookClient.AsyncPost(ctx, cbReq.GetCallbackCommand(), cbReq, &callbackstruct.CallbackAfterCreateGroupChatConversationsResp{}, after)

View File

@ -1,37 +1,11 @@
package callbackstruct
import (
"time"
)
type Conversation struct {
OwnerUserID string `json:"owner_user_id"`
ConversationID string `json:"conversation_id"`
ConversationType int32 `json:"conversation_type"`
UserID string `json:"user_id"`
GroupID string `json:"group_id"`
RecvMsgOpt int32 `json:"recv_msg_opt"`
IsPinned bool `json:"is_pinned"`
IsPrivateChat bool `json:"is_private_chat"`
BurnDuration int32 `json:"burn_duration"`
GroupAtType int32 `json:"group_at_type"`
AttachedInfo string `json:"attached_info"`
Ex string `json:"ex"`
MaxSeq int64 `json:"max_seq"`
MinSeq int64 `json:"min_seq"`
CreateTime time.Time `json:"create_time"`
IsMsgDestruct bool `json:"is_msg_destruct"`
MsgDestructTime int64 `json:"msg_destruct_time"`
LatestMsgDestructTime time.Time `json:"latest_msg_destruct_time"`
}
type CallbackBeforeCreateSingleChatConversationsReq struct {
CallbackCommand `json:"callbackCommand"`
OwnerUserID string `json:"owner_user_id"`
ConversationID string `json:"conversation_id"`
ConversationType int32 `json:"conversation_type"`
UserID string `json:"user_id"`
GroupID string `json:"group_id"`
RecvMsgOpt int32 `json:"recv_msg_opt"`
IsPinned bool `json:"is_pinned"`
IsPrivateChat bool `json:"is_private_chat"`
@ -39,21 +13,10 @@ type CallbackBeforeCreateSingleChatConversationsReq struct {
GroupAtType int32 `json:"group_at_type"`
AttachedInfo string `json:"attached_info"`
Ex string `json:"ex"`
MaxSeq int64 `json:"max_seq"`
MinSeq int64 `json:"min_seq"`
CreateTime time.Time `json:"create_time"`
IsMsgDestruct bool `json:"is_msg_destruct"`
MsgDestructTime int64 `json:"msg_destruct_time"`
LatestMsgDestructTime time.Time `json:"latest_msg_destruct_time"`
}
type CallbackBeforeCreateSingleChatConversationsResp struct {
CommonCallbackResp
OwnerUserID *string `json:"owner_user_id"`
ConversationID *string `json:"conversation_id"`
ConversationType *int32 `json:"conversation_type"`
UserID *string `json:"user_id"`
GroupID *string `json:"group_id"`
RecvMsgOpt *int32 `json:"recv_msg_opt"`
IsPinned *bool `json:"is_pinned"`
IsPrivateChat *bool `json:"is_private_chat"`
@ -61,12 +24,6 @@ type CallbackBeforeCreateSingleChatConversationsResp struct {
GroupAtType *int32 `json:"group_at_type"`
AttachedInfo *string `json:"attached_info"`
Ex *string `json:"ex"`
MaxSeq *int64 `json:"max_seq"`
MinSeq *int64 `json:"min_seq"`
CreateTime *time.Time `json:"create_time"`
IsMsgDestruct *bool `json:"is_msg_destruct"`
MsgDestructTime *int64 `json:"msg_destruct_time"`
LatestMsgDestructTime *time.Time `json:"latest_msg_destruct_time"`
}
type CallbackAfterCreateSingleChatConversationsReq struct {
@ -75,7 +32,6 @@ type CallbackAfterCreateSingleChatConversationsReq struct {
ConversationID string `json:"conversation_id"`
ConversationType int32 `json:"conversation_type"`
UserID string `json:"user_id"`
GroupID string `json:"group_id"`
RecvMsgOpt int32 `json:"recv_msg_opt"`
IsPinned bool `json:"is_pinned"`
IsPrivateChat bool `json:"is_private_chat"`
@ -83,12 +39,6 @@ type CallbackAfterCreateSingleChatConversationsReq struct {
GroupAtType int32 `json:"group_at_type"`
AttachedInfo string `json:"attached_info"`
Ex string `json:"ex"`
MaxSeq int64 `json:"max_seq"`
MinSeq int64 `json:"min_seq"`
CreateTime time.Time `json:"create_time"`
IsMsgDestruct bool `json:"is_msg_destruct"`
MsgDestructTime int64 `json:"msg_destruct_time"`
LatestMsgDestructTime time.Time `json:"latest_msg_destruct_time"`
}
type CallbackAfterCreateSingleChatConversationsResp struct {
@ -100,7 +50,6 @@ type CallbackBeforeCreateGroupChatConversationsReq struct {
OwnerUserID string `json:"owner_user_id"`
ConversationID string `json:"conversation_id"`
ConversationType int32 `json:"conversation_type"`
UserID string `json:"user_id"`
GroupID string `json:"group_id"`
RecvMsgOpt int32 `json:"recv_msg_opt"`
IsPinned bool `json:"is_pinned"`
@ -109,21 +58,10 @@ type CallbackBeforeCreateGroupChatConversationsReq struct {
GroupAtType int32 `json:"group_at_type"`
AttachedInfo string `json:"attached_info"`
Ex string `json:"ex"`
MaxSeq int64 `json:"max_seq"`
MinSeq int64 `json:"min_seq"`
CreateTime time.Time `json:"create_time"`
IsMsgDestruct bool `json:"is_msg_destruct"`
MsgDestructTime int64 `json:"msg_destruct_time"`
LatestMsgDestructTime time.Time `json:"latest_msg_destruct_time"`
}
type CallbackBeforeCreateGroupChatConversationsResp struct {
CommonCallbackResp
OwnerUserID *string `json:"owner_user_id"`
ConversationID *string `json:"conversation_id"`
ConversationType *int32 `json:"conversation_type"`
UserID *string `json:"user_id"`
GroupID *string `json:"group_id"`
RecvMsgOpt *int32 `json:"recv_msg_opt"`
IsPinned *bool `json:"is_pinned"`
IsPrivateChat *bool `json:"is_private_chat"`
@ -131,12 +69,6 @@ type CallbackBeforeCreateGroupChatConversationsResp struct {
GroupAtType *int32 `json:"group_at_type"`
AttachedInfo *string `json:"attached_info"`
Ex *string `json:"ex"`
MaxSeq *int64 `json:"max_seq"`
MinSeq *int64 `json:"min_seq"`
CreateTime *time.Time `json:"create_time"`
IsMsgDestruct *bool `json:"is_msg_destruct"`
MsgDestructTime *int64 `json:"msg_destruct_time"`
LatestMsgDestructTime *time.Time `json:"latest_msg_destruct_time"`
}
type CallbackAfterCreateGroupChatConversationsReq struct {
@ -144,7 +76,6 @@ type CallbackAfterCreateGroupChatConversationsReq struct {
OwnerUserID string `json:"owner_user_id"`
ConversationID string `json:"conversation_id"`
ConversationType int32 `json:"conversation_type"`
UserID string `json:"user_id"`
GroupID string `json:"group_id"`
RecvMsgOpt int32 `json:"recv_msg_opt"`
IsPinned bool `json:"is_pinned"`
@ -153,12 +84,6 @@ type CallbackAfterCreateGroupChatConversationsReq struct {
GroupAtType int32 `json:"group_at_type"`
AttachedInfo string `json:"attached_info"`
Ex string `json:"ex"`
MaxSeq int64 `json:"max_seq"`
MinSeq int64 `json:"min_seq"`
CreateTime time.Time `json:"create_time"`
IsMsgDestruct bool `json:"is_msg_destruct"`
MsgDestructTime int64 `json:"msg_destruct_time"`
LatestMsgDestructTime time.Time `json:"latest_msg_destruct_time"`
}
type CallbackAfterCreateGroupChatConversationsResp struct {