mirror of
https://github.com/silenceper/wechat.git
synced 2026-11-16 05:12:03 +08:00
improve code for message
This commit is contained in:
1 parent
3d9cb16709
commit
1090563e0b
2 files changed
+18
-28
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user