加上作业
This commit is contained in:
parent
550577e942
commit
d7cad23854
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue