Ver código fonte

Merge branch 'feature/531-bowen-wecom' into debug

lichangdong 3 dias atrás
pai
commit
a4f95c709e

+ 3 - 3
internal/logic/label_relationship/get_label_relationship_list_logic.go

@@ -80,10 +80,10 @@ func (l *GetLabelRelationshipListLogic) GetLabelRelationshipList(req *types.Labe
 		conPreds = append(conPreds, contact.Ctype(1)) // 默认 Ctype = 1
 	}
 
-	if req.WxWxid != nil && *req.WxWxid != "" {
+	if req.WxWxid != nil {
 		conPreds = append(conPreds, contact.WxWxidContains(*req.WxWxid))
 	}
-	if req.Wxid != nil && *req.Wxid != "" {
+	if req.Wxid != nil {
 		conPreds = append(conPreds, contact.WxidContains(*req.Wxid))
 	}
 
@@ -93,7 +93,7 @@ func (l *GetLabelRelationshipListLogic) GetLabelRelationshipList(req *types.Labe
 		conPreds = append(conPreds, contact.Or(contact.TypeEQ(1), contact.TypeEQ(2), contact.TypeEQ(4)))
 	}
 
-	if req.Nickname != nil && *req.Nickname != "" {
+	if req.Nickname != nil {
 		conPreds = append(conPreds, contact.NicknameContains(*req.Nickname))
 	}
 

+ 6 - 0
internal/pkg/util/strings.go

@@ -0,0 +1,6 @@
+package util
+
+// IsNonEmptyString 判断字符串指针不为 nil 且不为空
+func IsNonEmptyString(s *string) bool {
+	return s != nil && *s != ""
+}