Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
yystopf 2023-03-24 10:28:58 +08:00
commit 56f45f896f
7 changed files with 22 additions and 2 deletions

View File

@ -149,6 +149,9 @@ module ProjectsHelper
when 'vue' then "#{url}/v1/vue/entropy"
when 'bootstrap' then "#{url}/v1/bootstrap/entropy"
when 'tensorflow' then "#{url}/v1/tensorflow/entropy"
when 'kernel' then "#{url}/v1/openeuler/entropy"
when 'opengauss-server' then "#{url}/v1/opengauss/entropy"
when 'mindspore' then "#{url}/v1/mindspore/entropy"
else ''
end
end
@ -163,6 +166,9 @@ module ProjectsHelper
when 'vue' then "#{url}/v2/getMediumData?repo_login=vuejs&repo_name=vue"
when 'bootstrap' then "#{url}/v2/getMediumData?repo_login=twbs&repo_name=bootstrap"
when 'tensorflow' then "#{url}/v2/getMediumData?repo_login=tensorflow&repo_name=tensorflow"
when 'kernel' then "#{url}/v2/getMediumData?repo_login=openeuler&repo_name=kernel"
when 'opengauss-server' then "#{url}/v2/getMediumData?repo_login=opengauss&repo_name=openGauss-server"
when 'mindspore' then "#{url}/v2/getMediumData?repo_login=mindspore&repo_name=mindspore"
else ''
end
end
@ -177,6 +183,9 @@ module ProjectsHelper
when 'vue' then "#{url}/v2/getIndexData?repo_login=vuejs&repo_name=vue"
when 'bootstrap' then "#{url}/v2/getIndexData?repo_login=twbs&repo_name=bootstrap"
when 'tensorflow' then "#{url}/v2/getIndexData?repo_login=tensorflow&repo_name=tensorflow"
when 'kernel' then "#{url}/v2/getIndexData?repo_login=openeuler&repo_name=kernel"
when 'opengauss-server' then "#{url}/v2/getIndexData?repo_login=opengauss&repo_name=openGauss-server"
when 'mindspore' then "#{url}/v2/getIndexData?repo_login=mindspore&repo_name=mindspore"
else ''
end
end
@ -190,7 +199,10 @@ module ProjectsHelper
when 'paddle' then "#{url}/paddle/entropy"
when 'vue' then "#{url}/vue/entropy"
when 'bootstrap' then "#{url}/bootstrap/entropy"
when 'tensorflow' then "#{url}/tensorflow/entropy"
when 'tensorflow' then "#{url}/tensorflow/entropy"
when 'kernel' then "#{url}/openeuler/entropy"
when 'opengauss-server' then "#{url}/opengauss/entropy"
when 'mindspore' then "#{url}/mindspore/entropy"
else ''
end
end

View File

@ -25,10 +25,12 @@ class ForkUser < ApplicationRecord
def incre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {forks: 1}, self.project_id)
self.project.update_column(:updated_on, Time.now)
end
def decre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {forks: -1}, self.project_id)
self.project.update_column(:updated_on, Time.now)
end
def incre_user_statistic

View File

@ -26,10 +26,12 @@ class PraiseTread < ApplicationRecord
def incre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {praises: 1}, self.praise_tread_object_id) if self.praise_tread_object_type == "Project"
self.praise_tread_object.update_column(:updated_on, Time.now) if self.praise_tread_object_type == "Project"
end
def decre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {praises: -1}, self.praise_tread_object_id) if self.praise_tread_object_type == "Project"
self.praise_tread_object.update_column(:updated_on, Time.now) if self.praise_tread_object_type == "Project"
end
def incre_user_statistic

View File

@ -28,10 +28,12 @@ class Watcher < ApplicationRecord
def incre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {watchers: 1}, self.watchable_id) if self.watchable_type == "Project"
self.watchable.update_column(:updated_on, Time.now) if self.watchable_type == "Project"
end
def decre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {watchers: -1}, self.watchable_id) if self.watchable_type == "Project"
self.watchable.update_column(:updated_on, Time.now) if self.watchable_type == "Project"
end
def incre_user_statistic

View File

@ -69,7 +69,7 @@ class Api::V1::Issues::ListService < ApplicationService
issues = issues.joins(:assigners).where(users: {id: assigner_id}) if assigner_id.present?
# status_id
issues = issues.where(status_id: status_id) if status_id.present?
issues = issues.where(status_id: status_id) if status_id.present? && category != 'closed'
if begin_date&.present? || end_date&.present?
issues = issues.where("issues.created_on between ? and ?", begin_date&.present? ? begin_date.to_time : Time.now.beginning_of_day, end_date&.present? ? end_date.to_time.end_of_day : Time.now.end_of_day)

View File

@ -8,6 +8,7 @@ end
json.status_name issue.issue_status&.name
json.priority_name issue.priority&.name
json.milestone_name issue.version&.name
json.milestone_id issue.fixed_version_id
json.author do
if issue.user.present?
json.partial! "api/v1/users/simple_user", locals: {user: issue.user}

View File

@ -2,6 +2,7 @@ json.status 0
json.message "success"
json.data do
json.array! @install_bots do |install_bot|
json.installation_id install_bot.id
json.extract! install_bot.bot, :id, :name
end
end