|
|
@ -1,4 +1,16 @@
|
|
|
|
#encoding=utf-8
|
|
|
|
#encoding=utf-8
|
|
|
|
|
|
|
|
# 云启训练场(EduCoder)个人版 产品编码(appId) 9200108
|
|
|
|
|
|
|
|
# 产品名称 计费类型 套餐编码
|
|
|
|
|
|
|
|
# 云启训练场(EduCoder)个人版 固定包月 9200108001
|
|
|
|
|
|
|
|
# 固定包月 9200108002
|
|
|
|
|
|
|
|
# 固定包月 9200108003
|
|
|
|
|
|
|
|
# ---------------------------------------------------
|
|
|
|
|
|
|
|
# 产品名称 计费类型 套餐编码
|
|
|
|
|
|
|
|
# 云启训练场(EduCoder))院校版 包月+按license 9200109001
|
|
|
|
|
|
|
|
# 包月+按license 9200109002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 云启训练场(EduCoder))院校版 产品编码(appId) 9200109
|
|
|
|
|
|
|
|
|
|
|
|
require 'net/http'
|
|
|
|
require 'net/http'
|
|
|
|
require 'digest'
|
|
|
|
require 'digest'
|
|
|
|
|
|
|
|
|
|
|
@ -45,9 +57,32 @@ class EcloudController < ApplicationController
|
|
|
|
userid: params['userid'], username: params['username'], useralias: params['useralias'], mobile: params['mobile'],
|
|
|
|
userid: params['userid'], username: params['username'], useralias: params['useralias'], mobile: params['mobile'],
|
|
|
|
email: params['email'], productcode: params['productcode'], begintime: params['begintime'],
|
|
|
|
email: params['email'], productcode: params['productcode'], begintime: params['begintime'],
|
|
|
|
endtime: params['endtime'])
|
|
|
|
endtime: params['endtime'])
|
|
|
|
services = params['services'].first
|
|
|
|
# 业务列表
|
|
|
|
EcloudService.create(opttype: services['opttype'], code: services['code'], begintime: services['begintime'],
|
|
|
|
services = params['services']
|
|
|
|
endtime: services['endtime'], ecloud_id: ecloud.try(:id))
|
|
|
|
if services.present?
|
|
|
|
|
|
|
|
services.each do |service|
|
|
|
|
|
|
|
|
es = EcloudService.create(opttype: service['opttype'], code: service['code'], begintime: service['begintime'],
|
|
|
|
|
|
|
|
endtime: service['endtime'], ecloud_id: ecloud.try(:id))
|
|
|
|
|
|
|
|
if service['serviceparas'].present?
|
|
|
|
|
|
|
|
service['serviceparas'].each do |servicepara|
|
|
|
|
|
|
|
|
EcloudServieceServicepara.create!(ecloud_service_id: es.id, key: servicepara['key'], value: servicepara['value'])
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 应用开通参数
|
|
|
|
|
|
|
|
productparas = params['productparas']
|
|
|
|
|
|
|
|
if productparas.present?
|
|
|
|
|
|
|
|
productparas.each do |productpara|
|
|
|
|
|
|
|
|
EcloudProductpara.create!(key: productpara['key'], value: productpara['value'], ecloud_id: ecloud.try(:id))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 为管理员单独创建一条账号,企业账号
|
|
|
|
|
|
|
|
EcloudUser.create!(ecloud_id: ecloud.try(:id), opttype: params['opttype'], userid: params['userid'],
|
|
|
|
|
|
|
|
username: params['username'], useralias: params['useralias'],
|
|
|
|
|
|
|
|
mobile: params['mobile'], email: params['email'])
|
|
|
|
|
|
|
|
|
|
|
|
render :json => {result: true, errmsg: ""}
|
|
|
|
render :json => {result: true, errmsg: ""}
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
@ -79,6 +114,7 @@ class EcloudController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 用户业务开通与变更接口
|
|
|
|
# 用户业务开通与变更接口
|
|
|
|
|
|
|
|
# 授权statu为1,取消授权status为0
|
|
|
|
def ps_new
|
|
|
|
def ps_new
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
user_params = params['users']
|
|
|
|
user_params = params['users']
|
|
|
|