socialforge/app/api/mobile/apis/whomeworks.rb

20 lines
436 B
Ruby

#coding=utf-8
module Mobile
module Apis
class Whomeworks< Grape::API
resources :whomeworks do
desc "get one homework"
get ':id' do
authenticate!
user = current_user
homework = HomeworkCommon.find params[:id]
present :data, homework, with: Mobile::Entities::Whomework,user: user
present :status, 0
end
end
end
end
end