Browse Source

删除支持批量操作

boweniac 2 months ago
parent
commit
ae8839bb88

+ 1 - 1
desc/wechat/label_tagging.api

@@ -73,7 +73,7 @@ service Wechat {
 
     // Delete label tagging information | 删除LabelTagging信息
     @handler deleteLabelTagging
-    post /label_tagging/delete (IDReq) returns (BaseMsgResp)
+    post /label_tagging/delete (IDsReq) returns (BaseMsgResp)
 
     // Get label tagging list | 获取LabelTagging信息列表
     @handler getLabelTaggingList

+ 2 - 2
internal/logic/label_tagging/delete_label_tagging_logic.go

@@ -25,9 +25,9 @@ func NewDeleteLabelTaggingLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 		svcCtx: svcCtx}
 }
 
-func (l *DeleteLabelTaggingLogic) DeleteLabelTagging(req *types.IDReq) (resp *types.BaseMsgResp, err error) {
+func (l *DeleteLabelTaggingLogic) DeleteLabelTagging(req *types.IDsReq) (resp *types.BaseMsgResp, err error) {
 	organizationId := l.ctx.Value("organizationId").(uint64)
-	_, err = l.svcCtx.DB.LabelTagging.Delete().Where(labeltagging.ID(req.Id), labeltagging.OrganizationID(organizationId)).Exec(l.ctx)
+	_, err = l.svcCtx.DB.LabelTagging.Delete().Where(labeltagging.IDIn(req.Ids...), labeltagging.OrganizationID(organizationId)).Exec(l.ctx)
 
 	if err != nil {
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)