package router

import (
	"fonchain-fiee/pkg/middleware"
	"fonchain-fiee/pkg/service"
	"fonchain-fiee/pkg/service/taskbench"

	"github.com/gin-gonic/gin"
)

// TaskBenchRouter 任务台路由
func TaskBenchRouter(r *gin.RouterGroup) {
	// 创建任务台路由组
	taskBenchRoute := r.Group("task-bench")
	// 使用Web登录中间件进行权限验证
	taskBenchRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
	// 任务台管理
	{
		// 待指派任务布局
		taskBenchRoute.POST("pending-task-layout", taskbench.GetPendingTaskLayout)
		taskBenchRoute.POST("set-pending-task-layout", taskbench.SetPendingTaskLayout)

		// 指派
		taskBenchRoute.POST("assign-task", taskbench.AssignTask)

		// 批量指派
		taskBenchRoute.POST("batch-assign-task", taskbench.BatchAssignTask)

		// 中止指派
		taskBenchRoute.POST("terminate-task-by-uuid", taskbench.TerminateTaskByUUID)

		// 批量中止指派
		taskBenchRoute.POST("batch-terminate-task", taskbench.BatchTerminateTask)

		// 查询最近被指派记录
		taskBenchRoute.POST("recent-assign-records", taskbench.GetRecentAssignRecords)

		// 多条件查询操作记录表
		taskBenchRoute.POST("task-assign-records-list", taskbench.GetTaskAssignRecordsList)

		// 多条件查询操作记录表导出Excel
		taskBenchRoute.POST("task-assign-records-list-download", taskbench.GetTaskAssignRecordsListDownload)

		// 员工完成图片作品任务（带任务UUID）
		taskBenchRoute.POST("update-work-image-with-task-uuid", taskbench.UpdateWorkImageWithTaskUUID)

		// 员工完成视频作品任务（带任务UUID）
		taskBenchRoute.POST("update-work-video-with-task-uuid", taskbench.UpdateWorkVideoWithUUID)

		// 员工完成视频脚本（带任务UUID）
		taskBenchRoute.POST("update-script-with-task-uuid", taskbench.UpdateVideoScriptWithUUID)

		taskBenchRoute.POST("create-analysis-with-task-uuid", taskbench.CreateWorkAnalysisWithTaskUUID)
		taskBenchRoute.POST("create-report-with-task-uuid", taskbench.CreateCompetitiveReportWithTaskUUID)

		// 根据登录人信息查询被指派给该员工的任务
		taskBenchRoute.POST("assigned-tasks", taskbench.GetEmployeeAssignedTasks)

		// 员工手动点击完成任务
		taskBenchRoute.POST("complete-manually", taskbench.CompleteTaskManually)

		// 查询艺人待上传列表
		taskBenchRoute.POST("pending-upload-list", taskbench.GetArtistUploadStatsList)

		// 查询艺人待上传列表并导出Excel
		taskBenchRoute.POST("pending-upload-list-download", taskbench.GetArtistUploadStatsListDownload)

		// 添加隐藏任务指派人
		taskBenchRoute.POST("hide", taskbench.AddHiddenTaskAssignee)

		// 查询待指派数据
		taskBenchRoute.POST("pending-data-list", taskbench.GetPendingAssign)

		// 查询指派任务中已完成任务
		taskBenchRoute.POST("completed-list", taskbench.GetTaskWorkLogListItems)
	}

}
