feat: opt exec log

This commit is contained in:
engigu
2026-01-01 14:56:48 +08:00
parent 756ba1e0ea
commit 433c586f2a
2 changed files with 15 additions and 9 deletions
+14 -8
View File
@@ -17,14 +17,16 @@ func NewLogController() *LogController {
}
type TaskLogResponse struct {
ID uint `json:"id"`
TaskID uint `json:"task_id"`
TaskName string `json:"task_name"`
TaskType string `json:"task_type"`
Command string `json:"command"`
Status string `json:"status"`
Duration int64 `json:"duration"`
CreatedAt models.LocalTime `json:"created_at"`
ID uint `json:"id"`
TaskID uint `json:"task_id"`
TaskName string `json:"task_name"`
TaskType string `json:"task_type"`
Command string `json:"command"`
Status string `json:"status"`
Duration int64 `json:"duration"`
StartTime *models.LocalTime `json:"start_time"`
EndTime *models.LocalTime `json:"end_time"`
CreatedAt models.LocalTime `json:"created_at"`
}
func (lc *LogController) GetLogs(c *gin.Context) {
@@ -82,6 +84,8 @@ func (lc *LogController) GetLogs(c *gin.Context) {
Command: log.Command,
Status: log.Status,
Duration: log.Duration,
StartTime: log.StartTime,
EndTime: log.EndTime,
CreatedAt: log.CreatedAt,
}
}
@@ -109,6 +113,8 @@ func (lc *LogController) GetLogDetail(c *gin.Context) {
"output": log.Output,
"status": log.Status,
"duration": log.Duration,
"start_time": log.StartTime,
"end_time": log.EndTime,
"created_at": log.CreatedAt,
})
}