package course

import (
	"courseSign/server/api/v1"
	"courseSign/server/middleware"
	"github.com/gin-gonic/gin"
)

type CourseListRouter struct {
}

// InitCourseListRouter 初始化 CourseList 路由信息
func (s *CourseListRouter) InitCourseListRouter(Router *gin.RouterGroup) {
	courseListRouter := Router.Group("courseList").Use(middleware.OperationRecord())
	courseListRouterWithoutRecord := Router.Group("courseList")
	var courseListApi = v1.ApiGroupApp.CourseApiGroup.CourseListApi
	{
		courseListRouter.POST("createCourseList", courseListApi.CreateCourseList)   // 新建CourseList
		courseListRouter.DELETE("deleteCourseList", courseListApi.DeleteCourseList) // 删除CourseList
		courseListRouter.DELETE("deleteCourseListByIds", courseListApi.DeleteCourseListByIds) // 批量删除CourseList
		courseListRouter.PUT("updateCourseList", courseListApi.UpdateCourseList)    // 更新CourseList
	}
	{
		courseListRouterWithoutRecord.GET("findCourseList", courseListApi.FindCourseList)        // 根据ID获取CourseList
		courseListRouterWithoutRecord.GET("getCourseListList", courseListApi.GetCourseListList)  // 获取CourseList列表
	}
}

// InitCourseListMetaMaskRouter 初始化 CourseList 路由信息
func (s *CourseListRouter) InitCourseListMetaMaskRouter(Router *gin.RouterGroup) {
	courseListRouterWithoutRecord := Router.Group("courseList")
	var courseListApi = v1.ApiGroupApp.CourseApiGroup.CourseListApi
	{
		courseListRouterWithoutRecord.GET("getCourseInfo", courseListApi.GetCourseInfoWeb)  // web端展示课程列表
	}
}

// InitCourseListPubRouter 初始化 CourseList 路由信息
func (s *CourseListRouter) InitCourseListPubRouter(Router *gin.RouterGroup) {
	courseListRouterWithoutRecord := Router.Group("courseList")
	var courseListApi = v1.ApiGroupApp.CourseApiGroup.CourseListApi
	{
		courseListRouterWithoutRecord.GET("getCourses", courseListApi.GetCourseListListWeb)  // web端展示课程列表
	}
}