35 lines
949 B
Ruby
35 lines
949 B
Ruby
#coding=utf-8
|
|
|
|
module Mobile
|
|
module Apis
|
|
class Issues< Grape::API
|
|
resources :issues do
|
|
include IssuesHelper
|
|
|
|
desc "get special issuse"
|
|
post ':id' do
|
|
begin
|
|
# authenticate!
|
|
user = current_user
|
|
|
|
#is_public true 公开 false 私有 1公开 0私有
|
|
|
|
#0一级回复的更多 1 二级回复的更多
|
|
type = params[:type] || 0
|
|
page = params[:page] || 0
|
|
issue = Issue.find params[:id]
|
|
present :data, issue, with: Mobile::Entities::Issue,user: user,type: type,page: page
|
|
present :type, type
|
|
present :page, page
|
|
present :is_public, issue.project.is_public
|
|
present :status, 0
|
|
rescue Exception=>e
|
|
present :status, -1
|
|
present :message, e.message
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|