parent
e57b047eec
commit
8047b17ee1
@ -0,0 +1,13 @@
|
||||
# 删除课堂时将相应的课堂消息置为删除状态,并给老师发送删除消息
|
||||
class DeleteCourseNotifyJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(course_id, user_id)
|
||||
course = Course.find_by(id: course_id)
|
||||
return if course.blank?
|
||||
|
||||
Tiding.where(belong_container: course).update_all(is_delete: 1)
|
||||
Tiding.create!(user_id: user_id, trigger_user_id: user_id, container_id: course.id,
|
||||
container_type: 'DeleteCourse', tiding_type: 'System', belong_container: course, extra: course.name)
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DeleteCourseNotifyJob, type: :job do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue