diff --git a/app/api/mobile/apis/homeworks.rb b/app/api/mobile/apis/homeworks.rb new file mode 100644 index 000000000..99acfd87f --- /dev/null +++ b/app/api/mobile/apis/homeworks.rb @@ -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 diff --git a/app/api/mobile/middleware/error_handler.rb b/app/api/mobile/middleware/error_handler.rb index d0db6ebf1..018191d8d 100644 --- a/app/api/mobile/middleware/error_handler.rb +++ b/app/api/mobile/middleware/error_handler.rb @@ -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