Browse Source

项目动态接口

pull/342/head
xxq250 3 years ago
parent
commit
cba729f482
2 changed files with 1 additions and 9 deletions
  1. +0
    -9
      app/controllers/commit_logs_controller.rb
  2. +1
    -0
      config/routes.rb

+ 0
- 9
app/controllers/commit_logs_controller.rb View File

@@ -28,13 +28,4 @@ class CommitLogsController < ApplicationController
end

end

def activity
commit_sql = CommitLog.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql
project_sql = Project.select("user_id,id as project_id, '' as ref").order(id: :desc).limit(10).to_sql
project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql
project_sql = Issue.select("user_id,project_id, '' as ref").order(id: :desc).limit(10).to_sql
privacy_organizations_sql = Project.with_visibility("privacy").joins(:organization_users).where(organization_users: {user_id: current_user.id}).to_sql
@organizations = Organization.from("( #{ logged_organizations_sql } UNION #{ privacy_organizations_sql } ) AS users")
end
end

+ 1
- 0
config/routes.rb View File

@@ -1074,6 +1074,7 @@ Rails.application.routes.draw do
get 'oauth/get_token_callback', to: 'oauth#get_token_callback'

resources :commit_logs, :only => [:create]
get 'activity/last', to: 'project_trends#last'

scope '/app' do
get '/', to: 'installations#app'


Loading…
Cancel
Save