Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
a33a21befa
2 changed files with 14 additions and 16 deletions
  1. +13
    -13
      modules/aisafety/resty.go
  2. +1
    -3
      routers/repo/aisafety.go

+ 13
- 13
modules/aisafety/resty.go View File

@@ -32,6 +32,18 @@ type TaskReq struct {
BDName string //原数据集名称
}

type ReturnMsg struct {
Code string `json:"code"`
Msg string `json:"msg"`
Data ReturnData `json:"data"`
Times int64 `json:"times"`
}
type ReturnData struct {
No string `json:"no"`
Code int `json:"code"`
Status int `json:"status"`
}

const (
APPID = "1"
LogPageSize = 500
@@ -206,18 +218,6 @@ func GetAlgorithmList() (map[string]interface{}, error) {

}

type ReturnMsg struct {
code string
msg string
data ReturnData
times int64
}
type ReturnData struct {
no string
code int
status int
}

func GetTaskStatus(jobID string) (*ReturnMsg, error) {
checkSetting()
client := getRestyClient()
@@ -243,7 +243,7 @@ func GetTaskStatus(jobID string) (*ReturnMsg, error) {
} else {
var reMap *ReturnMsg
err = json.Unmarshal(res.Body(), reMap)
if err == nil && reMap.code == "0" {
if err == nil {
return reMap, nil
} else {
return nil, fmt.Errorf("get error,code not 0")


+ 1
- 3
routers/repo/aisafety.go View File

@@ -210,10 +210,8 @@ func queryTaskStatusFromCloudbrain(job *models.Cloudbrain) {
func queryTaskStatusFromModelSafetyTestServer(job *models.Cloudbrain) {
result, err := aisafety.GetTaskStatus(job.PreVersionName)
if err == nil {
if result["code"] != nil {
if result["code"].(string) == "0" {
if result.Code == "0" {

}
}
}
}


Loading…
Cancel
Save