提交 f9149c02 编写于 作者: 雨爱无痕

Merge branch 'main' of https://github.com/easysoft/zentaoatf

......@@ -270,10 +270,10 @@ func LoadBugs(Product int, config commDomain.WorkspaceConf) (bugs []commDomain.Z
for _, item := range items {
bug, _ := item.(map[string]interface{})
id, _ := bug["id"].(json.Number).Int64()
caseId, _ := bug["case"].(json.Number).Int64()
severity, _ := bug["severity"].(json.Number).Int64()
pri, _ := bug["pri"].(json.Number).Int64()
id, _ := strconv.ParseInt(fmt.Sprintf("%v", bug["id"]), 10, 64)
caseId, _ := strconv.ParseInt(fmt.Sprintf("%v", bug["case"]), 10, 64)
severity, _ := strconv.ParseInt(fmt.Sprintf("%v", bug["severity"]), 10, 64)
pri, _ := strconv.ParseInt(fmt.Sprintf("%v", bug["pri"]), 10, 64)
title, _ := bug["title"].(string)
openedBy, _ := bug["openedBy"].(map[string]interface{})
bugs = append(bugs, commDomain.ZentaoBug{
......
......@@ -3,11 +3,12 @@ package zentaoHelper
import (
"encoding/json"
"fmt"
"github.com/fatih/color"
"sort"
"strconv"
"strings"
"github.com/fatih/color"
"github.com/bitly/go-simplejson"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
......@@ -334,7 +335,7 @@ func GetCaseIdsInZentaoModule(productId, moduleId uint, config commDomain.Worksp
caseIdMap = map[int]string{}
for _, item := range items {
mp, _ := item.(map[string]interface{})
id, _ := mp["id"].(json.Number).Int64()
id, _ := strconv.ParseInt(fmt.Sprintf("%v", mp["id"]), 10, 64)
caseIdMap[int(id)] = ""
}
......@@ -373,7 +374,7 @@ func GetCaseIdsInZentaoSuite(productId uint, suiteId int, config commDomain.Work
caseIdMap = map[int]string{}
for _, item := range items {
mp, _ := item.(map[string]interface{})
id, _ := mp["id"].(json.Number).Int64()
id, _ := strconv.ParseInt(fmt.Sprintf("%v", mp["id"]), 10, 64)
caseIdMap[int(id)] = ""
}
......@@ -412,7 +413,7 @@ func GetCaseIdsInZentaoTask(productId uint, taskId int, config commDomain.Worksp
caseIdMap = map[int]string{}
for _, item := range items {
mp, _ := item.(map[string]interface{})
id, _ := mp["case"].(json.Number).Int64()
id, _ := strconv.ParseInt(fmt.Sprintf("%v", mp["case"]), 10, 64)
caseIdMap[int(id)] = ""
}
......
......@@ -4,6 +4,9 @@ import (
"encoding/json"
"errors"
"fmt"
"path"
"strconv"
"github.com/bitly/go-simplejson"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
......@@ -13,7 +16,6 @@ import (
"github.com/easysoft/zentaoatf/pkg/domain"
httpUtils "github.com/easysoft/zentaoatf/pkg/lib/http"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
"path"
)
func LoadSiteProduct(currSite serverDomain.ZentaoSite, currProductId int) (
......@@ -90,7 +92,7 @@ func loadProduct(config commDomain.WorkspaceConf) (products []serverDomain.Zenta
for _, item := range items {
productMap, _ := item.(map[string]interface{})
id, _ := productMap["id"].(json.Number).Int64()
id, _ := strconv.ParseInt(fmt.Sprintf("%v", productMap["id"]), 10, 64)
name, _ := productMap["name"].(string)
products = append(products, serverDomain.ZentaoProduct{Id: int(id), Name: name})
......@@ -254,7 +256,7 @@ func LoadTask(productId uint, config commDomain.WorkspaceConf) (tasks []domain.N
func GenPlatItems(arr []interface{}) (ret []domain.NestedItem, err error) {
for _, iterf := range arr {
temp := iterf.(map[string]interface{})
id64, _ := temp["id"].(json.Number).Int64()
id64, _ := strconv.ParseInt(fmt.Sprintf("%v", temp["id"]), 10, 64)
item := domain.NestedItem{Id: int(id64), Name: temp["name"].(string)}
ret = append(ret, item)
......
......@@ -270,7 +270,7 @@ func (c *TestScriptCtrl) SyncToZentao(ctx iris.Context) {
for _, set := range sets {
totalNum += len(set.Cases)
count, _ := zentaoHelper.CheckIn(set.Cases, config, true, false)
count, _ := zentaoHelper.CheckIn(set.Cases, config, true, true)
successNum += count
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册