diff --git a/app/docs/slate/source/includes/_users.md b/app/docs/slate/source/includes/_users.md index b43ca4101..7225b90e3 100644 --- a/app/docs/slate/source/includes/_users.md +++ b/app/docs/slate/source/includes/_users.md @@ -1,7 +1,7 @@ # Users @@ -101,7 +101,7 @@ await octokit.request('GET /api/users/:login/messages.json') |OrganizationJoined | 账号被拉入组织 | |OrganizationLeft | 账号被移出组织 | |OrganizationRole | 账号组织权限变更 | -|ProjectDelete | 我关注的仓库被删除 | +|ProjectDeleted | 我关注的仓库被删除 | |ProjectFollowed | 我管理的仓库被关注 | |ProjectForked | 我管理的仓库被复刻 | |ProjectIssue | 我管理/关注的仓库有新的易修 | @@ -119,7 +119,9 @@ await octokit.request('GET /api/users/:login/messages.json') |PullRequestAssigned | 有新指派给我的合并请求 | |PullReuqestAtme | 在合并请求中@我 | |PullRequestChanged | 我创建或负责的合并请求状态变更 | -|PullRequestJournal | 我创建或负责的合并请求有新的评论 | +|PullRequestClosed | 我创建或负责的合并请求被关闭 | +|PullRequestJournal | 我创建或负责的合并请求有新的评论 | +|PullRequestMerged | 我创建或负责的合并请求被合并 | > 返回的JSON示例: diff --git a/app/models/message_template.rb b/app/models/message_template.rb index f19b77fb8..bee4ebae6 100644 --- a/app/models/message_template.rb +++ b/app/models/message_template.rb @@ -2,13 +2,54 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # -class MessageTemplate < ApplicationRecord +class MessageTemplate {nickname}关注了你', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::IssueAssigned', sys_notice: '{nickname1}在{nickname2}/{repository}指派给你一个易修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueAssignerExpire', sys_notice: '您负责的易修{title}已临近截止日期,请尽快处理', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueAtme', sys_notice: '{nickname}在易修{title}中@我', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueChanged', sys_notice: '在项目{nickname2}/{repository1}的易修{title}中:{ifassigner}{nickname1}将负责人从{assigner1}修改为{assigner1}{endassigner}
{ifstatus}{nickname1}将状态从{status1}修改为{status1}{endstatus}
{iftracker}{nickname1}将类型从{tracker1}修改为{tracker1}{endtracker}
{ifpriority}{nickname1}将优先度从{priority1}修改为{priority1}{endpriority}
{ifmilestone}{nickname1}将里程碑从{milestone1}修改为{milestone1}{endmilestone}
{iftag}{nickname1}将标签从{tag1}修改为{tag1}{endtag}
{ifdoneratio}{nickname1}将完成度从{doneratio1}修改为{doneratio1}{enddoneratio}
{ifbranch}{nickname1}将指定分支从{branch1}修改为{branch1}{endbranch}
{ifstartdate}{nickname1}将开始日期从{startdate1}修改为{startdate1}{endstartdate}
{ifduedate}{nickname1}将结束日期从{duedate1}修改为{duedate1}{endduedate}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueCreatorExpire', sys_notice: '您发布的易修{title}已临近截止日期,请尽快处理', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueDeleted', sys_notice: '{nickname}已将易修{title}删除', notification_url: '') + self.create(type: 'MessageTemplate::IssueJournal', sys_notice: '{nickname}评论易修{title}:{notes}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::LoginIpTip', sys_notice: '您的账号{nickname}于{login_time)在非常用的IP地址{ip}登录,如非本人操作,请立即修改密码', notification_url: '') + self.create(type: 'MessageTemplate::OrganizationJoined', sys_notice: '你已加入{organization}组织', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::OrganizationLeft', sys_notice: '你已被移出{organization}组织', notification_url: '') + self.create(type: 'MessageTemplate::OrganizationRole', sys_notice: '组织{organization}已把你的角色改为{role}', notification_url: '{baseurl}/{owner}') + self.create(type: 'MessageTemplate::ProjectDeleted', sys_notice: '你关注的仓库{nickname}/{repository}已被删除', notification_url: '') + self.create(type: 'MessageTemplate::ProjectFollowed', sys_notice: '{nickname}关注了你管理的仓库', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::ProjectForked', sys_notice: '{nickname1}复刻了你管理的仓库{nickname1}/{repository1}到{nickname2}/{repository2}', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectIssue', sys_notice: '{nickname1}在{nickname2}/{repository}新建易修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::ProjectJoined', sys_notice: '你已加入{repository}项目', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectLeft', sys_notice: '你已被移出{repository}项目', notification_url: '') + self.create(type: 'MessageTemplate::ProjectMemberJoined', sys_notice: '{nickname1}已加入项目{nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectMemberLeft', sys_notice: '{nickname1}已被移出项目{nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectMilestone', sys_notice: '{nickname1}在{nickname2}/{repository}创建了一个里程碑:{title}', notification_url: '{baseurl}/{owner}/{identifier}/milestones/{id}') + self.create(type: 'MessageTemplate::ProjectPraised', sys_notice: '{nickname}点赞了你管理的仓库', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::ProjectPullRequest', sys_notice: '{nickname1}在{nickname2}/{repository}提交了一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + self.create(type: 'MessageTemplate::ProjectRole', sys_notice: '仓库{repository}已把你的角色改为{role}', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectSettingChanged', sys_notice: '{nickname1}更改了{nickname2}/{repository}仓库设置:{ifname}更改项目名称为"{name}";{endname}{ifdescription}更改项目简介为"{description}";{enddescription}{ifcategory}更改项目类别为"{category}";{endcategory}{iflanguage}更改项目语言为"{language}";{endlanguage}{ifpermission}将仓库设为"{permission}";{endpermission}{ifnavbar}将项目导航更改为"{navbar}";{endnavbar}', notification_url: '{baseurl}/{owner}/{identifier}/settings') + self.create(type: 'MessageTemplate::ProjectTransfer', sys_notice: '你关注的仓库{nickname1}/{repository1}已被转移至{nickname2}/{repository2}', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectVersion', sys_notice: '{nickname1}在{nickname2}/{repository}创建了发行版:{title}', notification_url: '{baseurl}/{owner}/{identifier}/releases') + self.create(type: 'MessageTemplate::PullRequestAssigned', sys_notice: '{nickname1}在{nickname2}/{repository}指派给你一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + self.create(type: 'MessageTemplate::PullRequestAtme', sys_notice: '{nickname}在合并请求{title}中@我', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + self.create(type: 'MessageTemplate::PullRequestChanged', sys_notice: '在项目{nickname2}/{repository1}的合并请求{title}中:{ifassigner}{nickname1}将审查成员从{assigner1}修改为{assigner1}{endassigner}
{ifmilestone}{nickname1}将里程碑从{milestone1}修改为{milestone1}{endmilestone}
{iftag}{nickname1}将标签从{tag1}修改为{tag1}{endtag}
{ifpriority}{nickname1}将优先度从{priority1}修改为{priority1}{endpriority}
', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + self.create(type: 'MessageTemplate::PullRequestClosed', sys_notice: '你提交的合并请求:{title]被拒绝', notification_url: '') + self.create(type: 'MessageTemplate::PullRequestJournal', sys_notice: '{nickname}评论合并请求{title}:{notes}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + self.create(type: 'MessageTemplate::PullRequestMerged', sys_notice: '你提交的合并请求:{title}被合并', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}/Messagecount') + end + + def self.sys_notice + self.last&.sys_notice + end end diff --git a/app/models/message_template/followed_tip.rb b/app/models/message_template/followed_tip.rb new file mode 100644 index 000000000..dd11982c6 --- /dev/null +++ b/app/models/message_template/followed_tip.rb @@ -0,0 +1,16 @@ +# == Schema Information +# +# Table name: message_templates +# +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) +# + +# 被关注提示 +class MessageTemplate::FollowedTip < MessageTemplate +end diff --git a/app/models/message_template/issue_assigned.rb b/app/models/message_template/issue_assigned.rb index 51e3e6174..76e9781ab 100644 --- a/app/models/message_template/issue_assigned.rb +++ b/app/models/message_template/issue_assigned.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 有新指派给我的易修 diff --git a/app/models/message_template/issue_assigner_expire.rb b/app/models/message_template/issue_assigner_expire.rb index 03af6163c..b9afeae00 100644 --- a/app/models/message_template/issue_assigner_expire.rb +++ b/app/models/message_template/issue_assigner_expire.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我负责的易修截止日期到达最后一天 diff --git a/app/models/message_template/issue_atme.rb b/app/models/message_template/issue_atme.rb index d09155828..2a87da11c 100644 --- a/app/models/message_template/issue_atme.rb +++ b/app/models/message_template/issue_atme.rb @@ -2,14 +2,15 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 在易修中@我 class MessageTemplate::IssueAtme < MessageTemplate -end \ No newline at end of file +end diff --git a/app/models/message_template/issue_changed.rb b/app/models/message_template/issue_changed.rb index 98772ab0e..0820d4bfe 100644 --- a/app/models/message_template/issue_changed.rb +++ b/app/models/message_template/issue_changed.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建或负责的易修状态变更 diff --git a/app/models/message_template/issue_creator_expire.rb b/app/models/message_template/issue_creator_expire.rb index ee1940714..41c471528 100644 --- a/app/models/message_template/issue_creator_expire.rb +++ b/app/models/message_template/issue_creator_expire.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建的易修截止日期到达最后一天 diff --git a/app/models/message_template/issue_deleted.rb b/app/models/message_template/issue_deleted.rb index d25fbffd0..a6a0ef204 100644 --- a/app/models/message_template/issue_deleted.rb +++ b/app/models/message_template/issue_deleted.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建或负责的易修删除 diff --git a/app/models/message_template/issue_journal.rb b/app/models/message_template/issue_journal.rb index 4252704c3..e4f7572b9 100644 --- a/app/models/message_template/issue_journal.rb +++ b/app/models/message_template/issue_journal.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建或负责的易修有新的评论 diff --git a/app/models/message_template/login_ip_tip.rb b/app/models/message_template/login_ip_tip.rb index a86e03a50..898a30c72 100644 --- a/app/models/message_template/login_ip_tip.rb +++ b/app/models/message_template/login_ip_tip.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 登录异常提示 diff --git a/app/models/message_template/organization_joined.rb b/app/models/message_template/organization_joined.rb index 4440bb742..95c9611ac 100644 --- a/app/models/message_template/organization_joined.rb +++ b/app/models/message_template/organization_joined.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号被拉入组织 diff --git a/app/models/message_template/organization_left.rb b/app/models/message_template/organization_left.rb index 9d346b7b9..30df516e1 100644 --- a/app/models/message_template/organization_left.rb +++ b/app/models/message_template/organization_left.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号被移出组织 diff --git a/app/models/message_template/organization_role.rb b/app/models/message_template/organization_role.rb index 1222a6242..6ca825034 100644 --- a/app/models/message_template/organization_role.rb +++ b/app/models/message_template/organization_role.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号组织权限变更 diff --git a/app/models/message_template/project_delete.rb b/app/models/message_template/project_delete.rb deleted file mode 100644 index b03813f3a..000000000 --- a/app/models/message_template/project_delete.rb +++ /dev/null @@ -1,15 +0,0 @@ -# == Schema Information -# -# Table name: message_templates -# -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null -# - -# 我关注的仓库被删除 -class MessageTemplate::ProjectDelete < MessageTemplate -end diff --git a/app/models/message_template/project_deleted.rb b/app/models/message_template/project_deleted.rb new file mode 100644 index 000000000..334c6d871 --- /dev/null +++ b/app/models/message_template/project_deleted.rb @@ -0,0 +1,16 @@ +# == Schema Information +# +# Table name: message_templates +# +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) +# + +# 我关注的仓库被删除 +class MessageTemplate::ProjectDeleted < MessageTemplate +end diff --git a/app/models/message_template/project_followed.rb b/app/models/message_template/project_followed.rb index 654e19c7e..d7ade39e2 100644 --- a/app/models/message_template/project_followed.rb +++ b/app/models/message_template/project_followed.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库被关注 diff --git a/app/models/message_template/project_forked.rb b/app/models/message_template/project_forked.rb index 711460c01..b69892fa0 100644 --- a/app/models/message_template/project_forked.rb +++ b/app/models/message_template/project_forked.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库被复刻 diff --git a/app/models/message_template/project_issue.rb b/app/models/message_template/project_issue.rb index fc34d9a52..f657084a5 100644 --- a/app/models/message_template/project_issue.rb +++ b/app/models/message_template/project_issue.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理/关注的仓库有新的易修 diff --git a/app/models/message_template/project_joined.rb b/app/models/message_template/project_joined.rb index 6d21a39e1..1da83b0c4 100644 --- a/app/models/message_template/project_joined.rb +++ b/app/models/message_template/project_joined.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号被拉入项目 diff --git a/app/models/message_template/project_left.rb b/app/models/message_template/project_left.rb index f95467f0a..639235026 100644 --- a/app/models/message_template/project_left.rb +++ b/app/models/message_template/project_left.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号被移出项目 diff --git a/app/models/message_template/project_member_joined.rb b/app/models/message_template/project_member_joined.rb index 6e4e1accc..0b4025459 100644 --- a/app/models/message_template/project_member_joined.rb +++ b/app/models/message_template/project_member_joined.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库有成员加入 diff --git a/app/models/message_template/project_member_left.rb b/app/models/message_template/project_member_left.rb index 3259034d7..ed261e0f3 100644 --- a/app/models/message_template/project_member_left.rb +++ b/app/models/message_template/project_member_left.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库有成员移出 diff --git a/app/models/message_template/project_milestone.rb b/app/models/message_template/project_milestone.rb index b1ff0b9e2..b28766c5f 100644 --- a/app/models/message_template/project_milestone.rb +++ b/app/models/message_template/project_milestone.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库有新的里程碑 diff --git a/app/models/message_template/project_praised.rb b/app/models/message_template/project_praised.rb index ebbdfd93f..ec7a0564f 100644 --- a/app/models/message_template/project_praised.rb +++ b/app/models/message_template/project_praised.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库被点赞 diff --git a/app/models/message_template/project_pull_request.rb b/app/models/message_template/project_pull_request.rb index b1706eb91..43a8359b7 100644 --- a/app/models/message_template/project_pull_request.rb +++ b/app/models/message_template/project_pull_request.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理/关注的仓库有新的合并请求 diff --git a/app/models/message_template/project_role.rb b/app/models/message_template/project_role.rb index a59df5361..95ebe5ba9 100644 --- a/app/models/message_template/project_role.rb +++ b/app/models/message_template/project_role.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 账号仓库权限变更 diff --git a/app/models/message_template/project_setting_changed.rb b/app/models/message_template/project_setting_changed.rb index 1c4040f5d..b983e6c60 100644 --- a/app/models/message_template/project_setting_changed.rb +++ b/app/models/message_template/project_setting_changed.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我管理的仓库项目设置被更改 diff --git a/app/models/message_template/project_transfer.rb b/app/models/message_template/project_transfer.rb index 38998d03b..ce422f090 100644 --- a/app/models/message_template/project_transfer.rb +++ b/app/models/message_template/project_transfer.rb @@ -2,14 +2,15 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我关注的仓库被转移 class MessageTemplate::ProjectTransfer < MessageTemplate -end \ No newline at end of file +end diff --git a/app/models/message_template/project_version.rb b/app/models/message_template/project_version.rb index 330dfe95d..afc25fc4e 100644 --- a/app/models/message_template/project_version.rb +++ b/app/models/message_template/project_version.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我关注的仓库有新的发行版 diff --git a/app/models/message_template/pull_request_assigned.rb b/app/models/message_template/pull_request_assigned.rb index 1be86530c..d6d497daa 100644 --- a/app/models/message_template/pull_request_assigned.rb +++ b/app/models/message_template/pull_request_assigned.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 有新指派给我的合并请求 diff --git a/app/models/message_template/pull_request_atme.rb b/app/models/message_template/pull_request_atme.rb index afa7a4006..5ff526fa9 100644 --- a/app/models/message_template/pull_request_atme.rb +++ b/app/models/message_template/pull_request_atme.rb @@ -11,5 +11,5 @@ # # 在合并请求中@我 -class MessageTemplate::PullReuqestAtme < MessageTemplate +class MessageTemplate::PullRequestAtme < MessageTemplate end \ No newline at end of file diff --git a/app/models/message_template/pull_request_changed.rb b/app/models/message_template/pull_request_changed.rb index 002de3a28..dcde72b84 100644 --- a/app/models/message_template/pull_request_changed.rb +++ b/app/models/message_template/pull_request_changed.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建或负责的合并请求状态变更 diff --git a/app/models/message_template/pull_request_closed.rb b/app/models/message_template/pull_request_closed.rb new file mode 100644 index 000000000..0574b6409 --- /dev/null +++ b/app/models/message_template/pull_request_closed.rb @@ -0,0 +1,16 @@ +# == Schema Information +# +# Table name: message_templates +# +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) +# + +# 我创建或负责的合并请求被关闭 +class MessageTemplate::PullRequestClosed < MessageTemplate +end diff --git a/app/models/message_template/pull_request_journal.rb b/app/models/message_template/pull_request_journal.rb index 0f79d1663..6d3b4fe3b 100644 --- a/app/models/message_template/pull_request_journal.rb +++ b/app/models/message_template/pull_request_journal.rb @@ -2,12 +2,13 @@ # # Table name: message_templates # -# id :integer not null, primary key -# type :string(255) -# sys_notice :text(65535) -# email :text(65535) -# created_at :datetime not null -# updated_at :datetime not null +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) # # 我创建或负责的合并请求有新的评论 diff --git a/app/models/message_template/pull_request_merged.rb b/app/models/message_template/pull_request_merged.rb new file mode 100644 index 000000000..b06687cbc --- /dev/null +++ b/app/models/message_template/pull_request_merged.rb @@ -0,0 +1,16 @@ +# == Schema Information +# +# Table name: message_templates +# +# id :integer not null, primary key +# type :string(255) +# sys_notice :text(65535) +# email :text(65535) +# created_at :datetime not null +# updated_at :datetime not null +# notification_url :string(255) +# + +# 我创建或负责的合并请求被合并 +class MessageTemplate::PullRequestMerged < MessageTemplate +end diff --git a/db/migrate/20210914064456_add_notification_url_to_message_templates.rb b/db/migrate/20210914064456_add_notification_url_to_message_templates.rb new file mode 100644 index 000000000..2adb842c8 --- /dev/null +++ b/db/migrate/20210914064456_add_notification_url_to_message_templates.rb @@ -0,0 +1,5 @@ +class AddNotificationUrlToMessageTemplates < ActiveRecord::Migration[5.2] + def change + add_column :message_templates, :notification_url, :string + end +end diff --git a/public/docs/api.html b/public/docs/api.html index 94b177432..6446d796c 100644 --- a/public/docs/api.html +++ b/public/docs/api.html @@ -921,7 +921,7 @@ Success — a happy kitten is an authenticated kitten!

Users

获取当前登陆用户信息

@@ -1143,7 +1143,7 @@ Success — a happy kitten is an authenticated kitten! 账号组织权限变更 -ProjectDelete +ProjectDeleted 我关注的仓库被删除 @@ -1215,9 +1215,17 @@ Success — a happy kitten is an authenticated kitten! 我创建或负责的合并请求状态变更 +PullRequestClosed +我创建或负责的合并请求被关闭 + + PullRequestJournal 我创建或负责的合并请求有新的评论 + +PullRequestMerged +我创建或负责的合并请求被合并 +