parent
ecff82dc0c
commit
5afb8d00d6
@ -0,0 +1,54 @@
|
||||
# encoding=utf-8
|
||||
# 好大学接口数据
|
||||
module Mobile
|
||||
module Apis
|
||||
class Cnmooc < Grape::API
|
||||
before {cnmooc_access_key!}
|
||||
content_type :json, 'application/json;charset=UTF-8'
|
||||
|
||||
resources :cnmoocs do
|
||||
desc '获取实训数据'
|
||||
get "get_resources_data" do
|
||||
CnmoocsService.new.get_resources_data params
|
||||
end
|
||||
|
||||
desc "实训搜索功能"
|
||||
params do
|
||||
requires :name, type: String, desc: "搜索名称"
|
||||
end
|
||||
get 'search_resources' do
|
||||
CnmoocsService.new.search_resources params
|
||||
end
|
||||
|
||||
desc " 查找用户"
|
||||
params do
|
||||
requires :mail, type: String, desc: "邮箱地址"
|
||||
end
|
||||
get 'find_user' do
|
||||
CnmoocsService.new.find_user params
|
||||
end
|
||||
|
||||
desc "创建用户"
|
||||
params do
|
||||
requires :mail, type: String, desc: "邮箱地址"
|
||||
requires :name, type: String, desc: "昵称"
|
||||
requires :password, type: String, desc: "密码"
|
||||
end
|
||||
post "create_user" do
|
||||
CnmoocsService.new.create_user params
|
||||
end
|
||||
|
||||
desc "远程登录"
|
||||
params do
|
||||
requires :mail, type: String, desc: "邮箱地址"
|
||||
requires :password, type: String, desc: "密码"
|
||||
end
|
||||
get "login_educoder" do
|
||||
CnmoocsService.new.login_educoder params
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue