feat: change history data field

This commit is contained in:
Simon Ding
2024-07-15 10:56:05 +08:00
parent f37a8eeb5f
commit b2c4b69d87
15 changed files with 178 additions and 142 deletions

View File

@@ -11,7 +11,6 @@ import (
type Activity struct {
*ent.History
InBackgroud bool `json:"in_backgroud"`
Progress int `json:"progress"`
}
@@ -26,12 +25,6 @@ func (s *Server) GetAllActivities(c *gin.Context) (interface{}, error) {
if h.ID == id && task.Exists() {
a.Progress = task.Progress()
}
if h.ID == id && task.Processing {
a.InBackgroud = true
}
}
if a.Completed {
a.Progress = 100
}
activities = append(activities, a)
}