业务开通接口

dev_SaaS
jingquan huang 6 years ago
parent d58ddee8d3
commit 528996f57d

@ -21,6 +21,13 @@ class EcloudController < ApplicationController
redirect_to "https://gitee.com/oauth/authorize?client_id=#{CLIENT_ID}&redirect_uri=#{ROOT_URl}/oschina/login_cb&response_type=code" redirect_to "https://gitee.com/oauth/authorize?client_id=#{CLIENT_ID}&redirect_uri=#{ROOT_URl}/oschina/login_cb&response_type=code"
end end
def open_bs
Eclouduser.create(ecloudeuser_params)
end
def destroy_bs
end
def ecloud_login_callback def ecloud_login_callback
#获取code #获取code
@ -42,7 +49,7 @@ class EcloudController < ApplicationController
#获取此用户信息 #获取此用户信息
res = get("https://gitee.com/api/v5/user?access_token=#{body["access_token"]}") # res = get("https://gitee.com/api/v5/user?access_token=#{body["access_token"]}")
res = get("https://221.176.54.92:9081/restful/services/user/info?access_token=#{body["access_token"]}&userid=%7bUSERID%7d") res = get("https://221.176.54.92:9081/restful/services/user/info?access_token=#{body["access_token"]}&userid=%7bUSERID%7d")
logger.debug res logger.debug res

@ -0,0 +1,7 @@
class Eclouduser < ActiveRecord::Base
attr_accessible :applyno, :begintime, :bossorderid, :code, :custcod, :custid, :custname, :custtype, :ecordercoder, :email,
:endtime, :key, :moblile, :opttype, :productcode, :registersource, :trial,
:useralias, :userid, :username, :productparas, :services
serialize :productparas, Hash
serialize :services, Hash
end

@ -0,0 +1,30 @@
class CreateEcloudusers < ActiveRecord::Migration
def change
create_table :ecloudusers do |t|
t.string :applyno
t.string :ecordercoder
t.string :string
t.int :opttype
t.boolean :trial
t.string :bossorderid
t.int :custid
t.string :custcod
t.string :string
t.int :custtype
t.int :registersource
t.string :custname
t.int :userid
t.string :username
t.string :useralias
t.string :moblile
t.string :email
t.string :productcode
t.long :begintime
t.long :endtime
t.string :productparas
t.string :services
t.timestamps
end
end
end

@ -0,0 +1,28 @@
FactoryGirl.define do
factory :eclouduser do
applyno "MyString"
ecordercoder "MyString"
string "MyString"
opttype ""
trial false
bossorderid "MyString"
custid ""
custcod "MyString"
string "MyString"
custtype ""
registersource ""
custname "MyString"
userid ""
username "MyString"
useralias "MyString"
moblile "MyString"
email "MyString"
productcode "MyString"
begintime ""
endtime ""
key "MyString"
value "MyString"
opttype ""
code "MyString"
end
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Eclouduser, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save