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

19 lines
413 B
Ruby
Raw Normal View History

2016-03-30 17:47:44 +08:00
#coding=utf-8
module Mobile
module Apis
class Newss< Grape::API
resources :newss do
desc "get special news"
get ':id' do
2016-04-07 11:16:38 +08:00
user = UserWechat.find_by_openid(params[:openid]).user
2016-03-30 17:47:44 +08:00
news = News.find params[:id]
2016-04-07 11:16:38 +08:00
present :data, news, with: Mobile::Entities::News,user: user
2016-03-30 17:47:44 +08:00
present :status, 0
end
end
end
end
end