task_router.go
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package routers
import (
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/web/beego/filters"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
func init() {
//绩效管理模块
taskAdminNS := web.NewNamespace("/v1/admin/task",
web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
web.NSCtrlPost("/info", (*controllers.TaskController).GetTaskInfo),
web.NSCtrlPut("/", (*controllers.TaskController).UpdateTask),
web.NSCtrlPut("/delete", (*controllers.TaskController).DeleteTask),
web.NSCtrlPost("/run", (*controllers.TaskController).RunTask),
web.NSCtrlPost("/stop", (*controllers.TaskController).StopTask),
web.NSCtrlPost("/list", (*controllers.TaskController).ListTask),
web.NSCtrlGet("/level/list", (*controllers.TaskController).LevelList),
web.NSCtrlPost("/level", (*controllers.TaskController).SaveTaskLevel),
)
web.AddNamespace(taskAdminNS)
// 员工绩效模块
taskFontNS := web.NewNamespace("/v1/font/task",
web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
web.NSCtrlPost("/attention/cancel", (*controllers.TaskController).CancelAttention),
web.NSCtrlPost("/list", (*controllers.TaskController).ListTask2),
web.NSCtrlPost("/list/select", (*controllers.TaskController).SelectCondition),
web.NSCtrlPost("/task_record/list", (*controllers.TaskController).ListTaskRecord),
web.NSCtrlPost("/info", (*controllers.TaskController).GetTaskInfo),
web.NSCtrlPost("/ignore/list", (*controllers.TaskController).ListTaskIgnore),
web.NSCtrlPost("/ignore/cancel", (*controllers.TaskController).CancelIgnore),
)
web.AddNamespace(taskFontNS)
t := web.NewNamespace("/test/task",
web.NSCtrlPost("/", (*controllers.TaskController).CreateTask),
)
web.AddNamespace(t)
}