package course

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

type CourseSignupRouter struct {
}

// InitCourseSignupRouter 初始化 CourseSignup 路由信息
func (s *CourseSignupRouter) InitCourseSignupRouter(Router *gin.RouterGroup) {
	courseSignupRouter := Router.Group("courseSignup").Use(middleware.OperationRecord())
	courseSignupRouterWithoutRecord := Router.Group("courseSignup")
	var courseSignupApi = v1.ApiGroupApp.CourseApiGroup.CourseSignupApi
	{
		courseSignupRouter.POST("createCourseSignup", courseSignupApi.CreateCourseSignup)   // 新建CourseSignup
		courseSignupRouter.DELETE("deleteCourseSignup", courseSignupApi.DeleteCourseSignup) // 删除CourseSignup
		courseSignupRouter.DELETE("deleteCourseSignupByIds", courseSignupApi.DeleteCourseSignupByIds) // 批量删除CourseSignup
		courseSignupRouter.PUT("updateCourseSignup", courseSignupApi.UpdateCourseSignup)    // 更新CourseSignup
	}
	{
		courseSignupRouterWithoutRecord.GET("findCourseSignup", courseSignupApi.FindCourseSignup)        // 根据ID获取CourseSignup
		courseSignupRouterWithoutRecord.GET("getCourseSignupList", courseSignupApi.GetCourseSignupList)  // 获取CourseSignup列表
	}
}


// InitCourseSignupMetaMaskRouter 初始化 CourseSignup 路由信息
func (s *CourseSignupRouter) InitCourseSignupMetaMaskRouter(Router *gin.RouterGroup) {
	courseSignupRouter := Router.Group("courseSignup").Use(middleware.OperationRecord())
	var courseSignupApi = v1.ApiGroupApp.CourseApiGroup.CourseSignupApi
	{
		courseSignupRouter.POST("sign", courseSignupApi.SignCourse)   // 用户报名课程
		courseSignupRouter.GET("mySign", courseSignupApi.GetMyCourse)  // web端展示课程列表
	}
}