Module: Model::Auth
- Extended by:
- ActiveSupport::Concern
- Included in:
- Wechat::Auth
- Defined in:
- app/models/wechat/model/auth.rb
Instance Method Summary collapse
- #deal_auth_code ⇒ Object
-
#deal_test_case(agency) ⇒ Object
第三方平台上线测试用例2 测试公众号使用客服消息接口处理用户消息.
Instance Method Details
#deal_auth_code ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/models/wechat/model/auth.rb', line 16 def deal_auth_code r = platform.api.query_auth(auth_code) return unless r agency = platform.agencies.find_or_initialize_by(appid: r['authorizer_appid']) agency.store_access_token(r) deal_test_case(agency) if testcase end |
#deal_test_case(agency) ⇒ Object
第三方平台上线测试用例2 测试公众号使用客服消息接口处理用户消息
26 27 28 29 30 31 32 |
# File 'app/models/wechat/model/auth.rb', line 26 def deal_test_case(agency) text_service = agency.wechat_services.build(type: 'TextService') text_service.open_id = request.open_id text_service.value = "#{auth_code}_from_api" text_service.save text_service.do_send end |