更改:关注、点赞、fork项目更新时间,以及issue列表返回里程碑ID

This commit is contained in:
yystopf 2023-03-23 10:41:52 +08:00
parent 1ce55b27f4
commit b127323589
4 changed files with 7 additions and 0 deletions

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

@ -7,6 +7,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}