You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
742 B
Go

package models
import (
"autogo/global"
"encoding/json"
"fmt"
)
type MonkeyAnomaly struct {
global.MODEL
TaskId int `json:"task_id"`
Udid string `json:"udid"`
AnomalyInfos string `json:"-" gorm:"anomaly_infos"`
Anomalies []string `json:"anomalies" gorm:"-"`
CoverdPages string `json:"coverd_pages"`
Logs string `json:"logs"`
BugId string `json:"bug_id"`
}
func (m *MonkeyAnomaly) TableName() string {
return "monkey_anomalies"
}
func (m *MonkeyAnomaly) JsonReady() {
var strs []string
if len(m.AnomalyInfos) > 3 {
err := json.Unmarshal([]byte(m.AnomalyInfos), &strs)
if err != nil {
fmt.Println("[JsonReady]", "序列化失败")
return
}
m.Anomalies = strs
}
}