You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
530 B
25 lines
530 B
6 years ago
|
class Videos::DispatchCallbackService < ApplicationService
|
||
|
attr_reader :video, :params
|
||
|
|
||
|
def initialize(params)
|
||
|
@video = Video.find_by(uuid: params[:VideoId])
|
||
|
@params = params
|
||
|
end
|
||
|
|
||
|
def call
|
||
|
return if video.blank?
|
||
|
|
||
|
# TODO:: 拆分事件分发
|
||
|
case params['EventType']
|
||
|
when 'FileUploadComplete' then
|
||
|
video.file_url = params['FileUrl']
|
||
|
video.upload_success
|
||
|
video.save!
|
||
|
|
||
|
GetAliyunVideoInfoJob.perform_later(video.uuid)
|
||
|
end
|
||
|
|
||
|
rescue => ex
|
||
|
Util.logger_error(ex)
|
||
|
end
|
||
|
end
|