|
|
|
@ -2,7 +2,7 @@ class LiveLinksController < ApplicationController
|
|
|
|
|
before_action :require_login
|
|
|
|
|
before_action :find_course, only: [:index, :create]
|
|
|
|
|
before_action :user_course_identity, :teacher_allowed, only: [:create]
|
|
|
|
|
before_action :edit_auth, only: [:edit, :update]
|
|
|
|
|
before_action :edit_auth, only: [:edit, :update, :destroy]
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
lives = @course.live_links
|
|
|
|
@ -34,8 +34,6 @@ class LiveLinksController < ApplicationController
|
|
|
|
|
# 开启时发送消息,关闭直播时删除对应的消息
|
|
|
|
|
if params[:on_status].to_i == 1
|
|
|
|
|
LivePublishJob.perform_later(current_live.id)
|
|
|
|
|
else
|
|
|
|
|
current_live.tidings.destroy_all
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
@ -44,6 +42,11 @@ class LiveLinksController < ApplicationController
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|
current_live.destroy!
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def create_params
|
|
|
|
|