|
@@ -4,6 +4,7 @@ import (
|
|
|
"context"
|
|
|
"encoding/json"
|
|
|
"entgo.io/ent/dialect/sql"
|
|
|
+ "github.com/zeromicro/go-zero/core/errorx"
|
|
|
"strings"
|
|
|
"time"
|
|
|
"wechat-api/ent"
|
|
@@ -32,6 +33,9 @@ func (l *LabelImportLogic) LabelImport(req *types.LabelImportReq) (resp *types.L
|
|
|
organizationId := l.ctx.Value("organizationId").(uint64)
|
|
|
contentString := req.Content
|
|
|
contentList := splitContent(contentString)
|
|
|
+ if len(contentList) > 200 {
|
|
|
+ return nil, errorx.NewInvalidArgumentError("有效标签数量不能超过200个")
|
|
|
+ }
|
|
|
existingLabels, err := l.svcCtx.DB.Label.Query().
|
|
|
Where(
|
|
|
label.NameIn(contentList...),
|