From 2af882069719487eb39d513385fd136bc344375e Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 17 Dec 2021 17:25:14 +0800 Subject: [PATCH] update --- control/service.go | 3 --- task/profile.go | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/control/service.go b/control/service.go index e774435..b050ac3 100644 --- a/control/service.go +++ b/control/service.go @@ -62,8 +62,5 @@ func (srv Service) Load() error { ctlAPI.GET("tasks", auth.ACAdmin(), func(c *gin.Context) { server.OK(c, task.GetProfile()) }) - ctlAPI.GET("task", auth.ACAdmin(), func(c *gin.Context) { - server.OK(c, task.GetTasks()) - }) return nil } diff --git a/task/profile.go b/task/profile.go index 2768b5e..a4ff4ad 100644 --- a/task/profile.go +++ b/task/profile.go @@ -31,13 +31,13 @@ type Report struct { } type Profile struct { - Name string `json:"name"` + Tasks map[string]*Task Scheduled []*Report `json:"scheduled"` } func GetProfile() *Profile { p := &Profile{ - Name: "task", + Tasks: GetTasks(), } entries := c.Entries() for i := 0; i < len(entries); i++ {