32 lines
923 B
Ruby
32 lines
923 B
Ruby
#coding=utf-8
|
|
|
|
module Mobile
|
|
module Apis
|
|
class Whomeworks< Grape::API
|
|
resources :whomeworks do
|
|
|
|
desc "get one homework"
|
|
post ':id' do
|
|
authenticate!
|
|
user = current_user
|
|
|
|
#0一级回复的更多 1 二级回复的更多
|
|
type = params[:type] || 0
|
|
page = params[:page] || 0
|
|
|
|
if type == 0
|
|
homework = HomeworkCommon.find params[:id]
|
|
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page,comment_type: "homework"
|
|
else
|
|
jour = JournalsForMessage.find params[:id]
|
|
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page,comment_type: "homework"
|
|
end
|
|
present :type, type
|
|
present :page, page
|
|
present :status, 0
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|