package learning import ( "github.com/flipped-aurora/gin-vue-admin/server/api/v1" "github.com/flipped-aurora/gin-vue-admin/server/middleware" "github.com/gin-gonic/gin" ) type WrongQuestionRouter struct{} // InitWrongQuestionRouter 初始化 错题本 路由信息 func (s *WrongQuestionRouter) InitWrongQuestionRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) { wrongQuestionRouter := Router.Group("wrongQuestion").Use(middleware.OperationRecord()) wrongQuestionRouterWithoutRecord := Router.Group("wrongQuestion") var wrongQuestionApi = v1.ApiGroupApp.LearningApiGroup.WrongQuestionApi { wrongQuestionRouter.POST("createWrongQuestion", wrongQuestionApi.CreateWrongQuestion) // 新建错题记录 wrongQuestionRouter.DELETE("deleteWrongQuestion", wrongQuestionApi.DeleteWrongQuestion) // 删除错题记录 wrongQuestionRouter.DELETE("deleteWrongQuestionByIds", wrongQuestionApi.DeleteWrongQuestionByIds) // 批量删除错题记录 wrongQuestionRouter.PUT("updateWrongQuestion", wrongQuestionApi.UpdateWrongQuestion) // 更新错题记录 wrongQuestionRouter.PUT("markAsMastered", wrongQuestionApi.MarkAsMastered) // 标记为已掌握 } { wrongQuestionRouterWithoutRecord.GET("findWrongQuestion", wrongQuestionApi.FindWrongQuestion) // 根据ID获取错题记录 wrongQuestionRouterWithoutRecord.GET("getWrongQuestionList", wrongQuestionApi.GetWrongQuestionList) // 获取错题记录列表 wrongQuestionRouterWithoutRecord.GET("getUserWrongQuestions", wrongQuestionApi.GetUserWrongQuestions) // 获取用户错题列表 wrongQuestionRouterWithoutRecord.GET("getWrongQuestionStatistics", wrongQuestionApi.GetWrongQuestionStatistics) // 获取错题统计 } }