Class: Fadada::Account
- Inherits:
-
Object
- Object
- Fadada::Account
- Defined in:
- lib/fadada/account.rb
Class Method Summary collapse
Class Method Details
.company_register(open_id) ⇒ Object
注册账号
此接口针对接入平台已有账号体系,判断 open_id 是否存在
存在则返回对应账号,否则随机生成账号并返回账号
open_id => 用户在接入方的唯一标识,length <= 64
返回 法大大的账号
30 31 32 33 34 35 36 37 |
# File 'lib/fadada/account.rb', line 30 def self.company_register(open_id) = { account_type: 2, # 账户类型,1 个人;2 企业,默认 1 open_id: open_id } response = Fadada::HttpClient.request(:post, 'account_register.api', ) response['data'] end |
.person_register(open_id) ⇒ Object
注册账号
此接口针对接入平台已有账号体系,判断 open_id 是否存在
存在则返回对应账号,否则随机生成账号并返回账号
open_id => 用户在接入方的唯一标识,length <= 64
返回 法大大的账号
13 14 15 16 17 18 19 20 |
# File 'lib/fadada/account.rb', line 13 def self.person_register(open_id) = { account_type: 1, # 账户类型,1 个人;2 企业,默认 1 open_id: open_id } response = Fadada::HttpClient.request(:post, 'account_register.api', ) response['data'] end |