加上作业

This commit is contained in:
guange 2015-01-04 14:55:45 +08:00
parent 550577e942
commit d7cad23854
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,29 @@
#coding=utf-8
module Mobile
module Apis
class Homeworks < Grape::API
def self.get_servcie
new HomeworkService
end
resources :homeworks do
desc "作业详情"
params do
requires :id, type: Integer, desc: "作业ID"
end
route_param :id do
get do
get_service.show_homework params
end
end
end
end
end
end

View File

@ -7,7 +7,7 @@ module Mobile
@app.call(@env)
rescue =>e
message = {status: 1, message: e.message }.to_json
puts(detail: e.backtrace.join("\n")) if Rails.env.development?
puts(e.backtrace.join("\n")) if Rails.env.development?
status = 200
headers = { 'Content-Type' => content_type }
Rack::Response.new([message], status, headers).finish