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

19 lines
413 B
Ruby

#coding=utf-8
module Mobile
module Apis
class Newss< Grape::API
resources :newss do
desc "get special news"
get ':id' do
user = UserWechat.find_by_openid(params[:openid]).user
news = News.find params[:id]
present :data, news, with: Mobile::Entities::News,user: user
present :status, 0
end
end
end
end
end