diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index 1fb209970..4334b3a69 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 80371b181..3eb02c95d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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