diff --git a/app/http/entities/backend/cmd.go b/app/http/entities/backend/cmd.go index 08097b6..f6bca20 100644 --- a/app/http/entities/backend/cmd.go +++ b/app/http/entities/backend/cmd.go @@ -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"` diff --git a/app/services/cmd_service/cmd_service.go b/app/services/cmd_service/cmd_service.go index b34e74a..f7f4f6b 100644 --- a/app/services/cmd_service/cmd_service.go +++ b/app/services/cmd_service/cmd_service.go @@ -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)