Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_video
daiao 5 years ago
commit 4225c4219b

@ -39,6 +39,13 @@ class Users::VideosController < Users::BaseController
@videos = paginate videos
end
def get_video_data
start_time = params[:start_time].to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ')
end_time = params[:end_time].to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ')
result = AliyunVod::Service.video_data(current_video.uuid, start_time, end_time)
render :json => {data: result}
end
def batch_publish
Videos::BatchPublishService.call(observed_user, batch_publish_params)
render_ok

@ -197,6 +197,9 @@ Rails.application.routes.draw do
post :batch_publish
post :cancel
end
member do
get :get_video_data
end
end
resource :video_auths, only: [:create, :update]
end

@ -28,4 +28,18 @@ namespace :video do
puts video.id
end
end
# 执行示例 bundle exec rake video:sample args=2933,'2019-08-19 00:00:00','2019-11-09 23:59:59'
task :sample => :environment do
if ENV['args']
video_id = ENV['args'].split(",")[0]
start_time = ENV['args'].split(",")[1].to_s.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') # 表示参与人数
end_time = ENV['args'].split(",")[2].to_s.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') # 表示通过人数
video=Video.find video_id
data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)
puts data
end
end
end
Loading…
Cancel
Save