Browse Source

fix:修改标签列表API

jimmyyem 1 month ago
parent
commit
804a0346d1

+ 3 - 0
desc/wechat/label.api

@@ -59,6 +59,9 @@ type (
 
         // 标签模式:1动态 2静态
         Mode  *int `json:"mode,optional"`
+
+		// 内容类型:1-微信 2-whatsapp
+		Ctype *uint64 `json:"ctype,optional"`
     }
 
     // Label information response | Label信息返回体

+ 5 - 1
internal/logic/label/get_label_select_list_logic.go

@@ -30,7 +30,11 @@ func (l *GetLabelSelectListLogic) GetLabelSelectList(req *types.LabelListReq) (*
 	organizationId := l.ctx.Value("organizationId").(uint64)
 	var predicates []predicate.Label
 	predicates = append(predicates, label.OrganizationIDEQ(organizationId))
-	predicates = append(predicates, label.Ctype(1))
+	var ctype uint64 = 1
+	if req.Ctype != nil && *req.Ctype > 0 {
+		ctype = *req.Ctype
+	}
+	predicates = append(predicates, label.Ctype(ctype))
 	if req.Type != nil {
 		predicates = append(predicates, label.TypeEQ(*req.Type))
 	}

+ 2 - 0
internal/types/types.go

@@ -1157,6 +1157,8 @@ type LabelListReq struct {
 	From *int `json:"from,optional"`
 	// 标签模式:1动态 2静态
 	Mode *int `json:"mode,optional"`
+	// 内容类型:1-微信 2-whatsapp
+	Ctype *uint64 `json:"ctype,optional"`
 }
 
 // Label information response | Label信息返回体