写数据一键测试
This commit is contained in:
parent
e24aabb8f0
commit
1a89850b5f
|
@ -4,7 +4,6 @@ import (
|
|||
"cron_admin/app/models/croncmdmodel"
|
||||
"cron_admin/app/models/crondbmodel"
|
||||
"cron_admin/app/models/cronreportchannelmodel"
|
||||
"cron_admin/app/models/cronusermodel"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -42,7 +41,7 @@ type CmdListResponse struct {
|
|||
UpdateTime string `json:"update_time"`
|
||||
Status int `json:"status"`
|
||||
FailReason string `json:"fail_reason"`
|
||||
Users []*cronusermodel.CronUser `json:"users"`
|
||||
Users string `json:"users"`
|
||||
ReadDb *crondbmodel.CronDb `json:"read_db"`
|
||||
WriteDb *crondbmodel.CronDb `json:"write_db"`
|
||||
ReportChannel *cronreportchannelmodel.CronReportChannel `json:"report_channel"`
|
||||
|
|
|
@ -251,10 +251,12 @@ func ListToRep(list []croncmdmodel.CronCmd) (cmdList []backend.CmdListResponse,
|
|||
|
||||
}
|
||||
if len(in.UserIds) != 0 {
|
||||
var users []string
|
||||
for _, v := range strings.Split(in.UserIds, ",") {
|
||||
intVal, _ := strconv.Atoi(v)
|
||||
d.Users = append(d.Users, userMap[intVal])
|
||||
users = append(users, userMap[intVal].Name)
|
||||
}
|
||||
d.Users = strings.Join(users, ",")
|
||||
}
|
||||
return d
|
||||
}).ToSlice(&cmdList)
|
||||
|
|
Loading…
Reference in New Issue