Class: Weixin::Qiye::NotificationsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/weixin/qiye/notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/weixin/qiye/notifications_controller.rb', line 15

def create
  Rails.logger.info "Weixin Qiye Message: #{@message['InfoType']}"
  case @message['InfoType']
    when 'suite_ticket'
      process_ticket_message
    # when 'authorized'
    # when 'unauthorized'
    # when 'updateauthorized'
    when 'contact_sync'
      process_contact_sync
  end

  render text: 'success'
end

#indexObject



7
8
9
10
11
12
13
# File 'app/controllers/weixin/qiye/notifications_controller.rb', line 7

def index
  if service_verify?
    render plain: @payload
  else
    render nonthing: true, status: :bad_request
  end
end