浏览代码

Merge branch 'fixbug/691-huaguo-wordscount' into debug

jimmyyem 2 天之前
父节点
当前提交
2125b7d0c0
共有 1 个文件被更改,包括 13 次插入5 次删除
  1. 13 5
      internal/logic/agent_base/create_agent_base_logic.go

+ 13 - 5
internal/logic/agent_base/create_agent_base_logic.go

@@ -43,11 +43,19 @@ func (l *CreateAgentBaseLogic) CreateAgentBase(req *types.CreateDataInfoReq) (*t
 	}
 
 	if resp.Code == 200 {
-		return &types.BaseDataInfo{
-			Code: 0,
-			Msg:  errormsg.Success,
-			Data: fmt.Sprintf("Insert %d rows", resp.Data.InsertLen),
-		}, nil
+		if resp.Data.InsertLen > 0 {
+			return &types.BaseDataInfo{
+				Code: 0,
+				Msg:  errormsg.Success,
+				Data: fmt.Sprintf("Insert %d rows", resp.Data.InsertLen),
+			}, nil
+		} else {
+			return &types.BaseDataInfo{
+				Code: 0,
+				Msg:  "插入失败,请修改后重试",
+				Data: fmt.Sprintf("Insert %d rows", resp.Data.InsertLen),
+			}, nil
+		}
 	}
 
 	return nil, errorx.NewInvalidArgumentError(resp.StatusText)