adjust auth apply

dev_ec
p31729568 5 years ago
parent 67a5ef4c55
commit 67ea6d5625

@ -25,10 +25,10 @@ class Users::ApplyAuthenticationService < ApplicationService
user.apply_user_authentication.create!(auth_type: 1, status: 0) user.apply_user_authentication.create!(auth_type: 1, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false' move_image_file! unless params[:upload_image].to_s == 'false'
sms_notify_admin
end end
sms_notify_admin
user user
end end

@ -37,13 +37,9 @@ class Users::ApplyProfessionalAuthService < ApplicationService
user.apply_user_authentication.create!(auth_type: 2, status: 0) user.apply_user_authentication.create!(auth_type: 2, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false' move_image_file! unless params[:upload_image].to_s == 'false'
sms_cache = Rails.cache.read("apply_pro_certification")
if sms_cache.nil?
sms_notify_admin
Rails.cache.write("apply_pro_certification", 1, expires_in: 5.minutes)
end
end end
sms_notify_admin
end end
private private
@ -61,7 +57,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService
end end
def sms_notify_admin def sms_notify_admin
Educoder::Sms.notify_admin(send_type: 'apply_pro_certification') sms_cache = Rails.cache.read('apply_pro_certification')
if sms_cache.nil?
Educoder::Sms.notify_admin(send_type: 'apply_pro_certification')
Rails.cache.write('apply_pro_certification', 1, expires_in: 5.minutes)
end
rescue => ex rescue => ex
Util.logger_error(ex) Util.logger_error(ex)
end end

Loading…
Cancel
Save