diff --git a/app/controllers/course_modules_controller.rb b/app/controllers/course_modules_controller.rb index 0bef519fd..bea248b52 100644 --- a/app/controllers/course_modules_controller.rb +++ b/app/controllers/course_modules_controller.rb @@ -2,9 +2,13 @@ class CourseModulesController < ApplicationController before_action :require_login, :check_auth before_action :set_module, except: [:unhidden_modules] before_action :find_course, only: [:unhidden_modules] - before_action :teacher_or_admin_allowed, except: [:add_second_category] + before_action :teacher_or_admin_allowed, except: [:show, :add_second_category] before_action :teacher_allowed, only: [:add_second_category] + def show + + end + # 模块置顶 def sticky_module # position为1则不做处理,否则该模块的position置为1,position小于当前模块的position加1 diff --git a/app/views/course_modules/show.json.jbuilder b/app/views/course_modules/show.json.jbuilder new file mode 100644 index 000000000..9d70797b8 --- /dev/null +++ b/app/views/course_modules/show.json.jbuilder @@ -0,0 +1,8 @@ +json.course_module do + json.id @course_module.id + json.module_name @course_module.module_name + json.module_type @course_module.module_type + json.course_second_categories do + json.array! @course_module.course_second_categories, :id, :name + end +end \ No newline at end of file