Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
c687561a9b
@ -1 +1 @@
|
||||
json.(@live, :id, :description, :url)
|
||||
json.(@live, :id, :description, :url, :platform, :live_time, :duration, :course_name)
|
||||
|
@ -1,12 +1,13 @@
|
||||
json.lives @lives do |live|
|
||||
json.(live, :id, :description, :on_status)
|
||||
json.(live, :id, :description, :on_status, :duration, :course_name)
|
||||
json.url live.on_status ? live.url : ""
|
||||
json.author_name live.user.show_real_name
|
||||
json.author_login live.user.login
|
||||
json.author_img url_to_avatar(live.user)
|
||||
json.op_auth live.op_auth?
|
||||
json.delete_auth live.delete_auth?
|
||||
json.created_at live.created_at.strftime('%Y-%m-%d')
|
||||
json.live_time live.live_time&.strftime('%Y-%m-%d %H:%M:%S')
|
||||
json.platform live.platform_name
|
||||
end
|
||||
json.my_live_id @my_live_id
|
||||
json.total_count @total_count
|
@ -0,0 +1,8 @@
|
||||
class AddColumnsToLiveLinks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :live_links, :course_name, :string
|
||||
add_column :live_links, :platform, :string
|
||||
add_column :live_links, :live_time, :datetime
|
||||
add_column :live_links, :duration, :integer
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
namespace :live_notice do
|
||||
desc "send a live message to students before 30 minutes"
|
||||
task message: :environment do
|
||||
lives = LiveLink.where(on_status: 0).where("live_time <= '#{Time.now + 30*60}' and live_time > '#{Time.now}'")
|
||||
lives.each do |live|
|
||||
LivePublishJob.perform_later(live.id)
|
||||
end
|
||||
end
|
||||
|
||||
task on_status: :environment do
|
||||
LiveLink.where(on_status: 0).where("live_time <= '#{Time.now}'").update_all(on_status: 1)
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 66 KiB |
Loading…
Reference in new issue