|
|
@ -17,7 +17,7 @@ require 'digest'
|
|
|
|
class EcloudController < ApplicationController
|
|
|
|
class EcloudController < ApplicationController
|
|
|
|
skip_before_filter :verify_authenticity_token
|
|
|
|
skip_before_filter :verify_authenticity_token
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
# before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
before_filter :save_para
|
|
|
|
before_filter :save_para
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :user_setup
|
|
|
|
before_filter :user_setup
|
|
|
@ -105,6 +105,8 @@ class EcloudController < ApplicationController
|
|
|
|
des_services = params['services'].select{|s| s['opttype'] == 1}
|
|
|
|
des_services = params['services'].select{|s| s['opttype'] == 1}
|
|
|
|
if des_services.present?
|
|
|
|
if des_services.present?
|
|
|
|
des_services.each do |ds|
|
|
|
|
des_services.each do |ds|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("666666#{ecloud.try(:id)}, 55555555#{ds['code']}")
|
|
|
|
esd = EcloudService.where(ecloud_id: ecloud.try(:id), code: ds['code']).first
|
|
|
|
esd = EcloudService.where(ecloud_id: ecloud.try(:id), code: ds['code']).first
|
|
|
|
esd.update_attributes!(opttype: ds['opttype'], begintime: ds['begintime'], endtime: ds['endtime'])
|
|
|
|
esd.update_attributes!(opttype: ds['opttype'], begintime: ds['begintime'], endtime: ds['endtime'])
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -144,10 +146,10 @@ class EcloudController < ApplicationController
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
|
|
render :json => {result: true, errmsg: ""}
|
|
|
|
render :json => {result: true, errmsg: ""}
|
|
|
|
rescue Exception => e
|
|
|
|
# rescue Exception => e
|
|
|
|
logger.error(e.message)
|
|
|
|
# logger.error(e.message)
|
|
|
|
render :json => {code: 500, msg: "#{e.message}"}
|
|
|
|
# render :json => {code: 500, msg: "#{e.message}"}
|
|
|
|
raise ActiveRecord::Rollback
|
|
|
|
# raise ActiveRecord::Rollback
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|