1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-23 13:42:25 +08:00

improve code for message

This commit is contained in:
houseme
2023-10-16 15:17:03 +08:00
parent 3d9cb16709
commit 1090563e0b
2 changed files with 18 additions and 28 deletions

View File

@@ -498,14 +498,10 @@ func (s *PushDataSubscribePopup) GetSubscribeMsgPopupEvents() []SubscribeMsgPopu
return s.subscribeMsgPopupEventList
}
if s.SubscribeMsgPopupEvent.List == nil {
if s.SubscribeMsgPopupEvent.List == nil || len(s.SubscribeMsgPopupEvent.List) < 1 {
return nil
}
list := make([]SubscribeMsgPopupEventList, len(s.SubscribeMsgPopupEvent.List))
for i, item := range s.SubscribeMsgPopupEvent.List {
list[i] = item
}
return list
return s.SubscribeMsgPopupEvent.List
}
// PushDataSubscribeMsgChange 用户管理订阅通知事件推送
@@ -537,14 +533,11 @@ func (s *PushDataSubscribeMsgChange) GetSubscribeMsgChangeEvents() []SubscribeMs
return s.subscribeMsgChangeList
}
if s.SubscribeMsgChangeEvent.List == nil {
if s.SubscribeMsgChangeEvent.List == nil || len(s.SubscribeMsgChangeEvent.List) < 1 {
return nil
}
list := make([]SubscribeMsgChangeList, len(s.SubscribeMsgChangeEvent.List))
for i, item := range s.SubscribeMsgChangeEvent.List {
list[i] = item
}
return list
return s.SubscribeMsgChangeEvent.List
}
// PushDataSubscribeMsgSent 用户发送订阅通知事件推送
@@ -578,12 +571,9 @@ func (s *PushDataSubscribeMsgSent) GetSubscribeMsgSentEvents() []SubscribeMsgSen
return s.subscribeMsgSentEventList
}
if s.SubscribeMsgSentEvent.List == nil {
if s.SubscribeMsgSentEvent.List == nil || len(s.SubscribeMsgSentEvent.List) < 1 {
return nil
}
list := make([]SubscribeMsgSentList, len(s.SubscribeMsgSentEvent.List))
for i, item := range s.SubscribeMsgSentEvent.List {
list[i] = item
}
return list
return s.SubscribeMsgSentEvent.List
}