task_router.go 3.0 KB
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.NSCtrlPost("/", (*controllers.TaskController).CreateTask),
		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.NSCtrlPost("/mark_anomaly", (*controllers.TaskController).TaskAnomalyMarkByTask),
	)
	web.AddNamespace(taskFontNS)
	taskAnomalyNS := web.NewNamespace("/v1/font/task_anomaly",
		web.NSBefore(filters.AllowCors(), middlewares.CheckFontToken()),
		web.NSCtrlPost("/my_task", (*controllers.TaskController).TaskAnomalyList1),           //我负责的任务
		web.NSCtrlPost("/my_relation", (*controllers.TaskController).TaskAnomalyList3),       //和我有关的任务
		web.NSCtrlPost("/my_relation_1", (*controllers.TaskController).TaskAnomalyList3Tree), //和我有关的任务
		web.NSCtrlPost("/my_sub", (*controllers.TaskController).TaskAnomalyList2),            //我的下级负责的任务
		web.NSCtrlPost("/my_sub_1", (*controllers.TaskController).TaskAnomalyList2Tree),      //我的下级负责的任务
		web.NSCtrlPost("/select/user", (*controllers.TaskController).UserSelect),             //人员下拉选择列表
		web.NSCtrlPost("/mark", (*controllers.TaskController).TaskAnomalyMark),               //
		web.NSCtrlPost("/info", (*controllers.TaskController).TaskAnomalyInfo),               //异常记录详情
		web.NSCtrlPost("/search_1", (*controllers.TaskController).SearchTaskAnomaly),         //搜索异常列表
	)
	web.AddNamespace(taskAnomalyNS)
}