mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-14 22:24:36 +08:00
add: webhook tasks and test
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
class Gitea::Webhook < Gitea::Base
|
||||
serialize :events, JSON
|
||||
self.inheritance_column = nil
|
||||
|
||||
self.table_name = 'webhook'
|
||||
|
||||
has_many :tasks, class_name: "Gitea::WebhookTask", foreign_key: :hook_id
|
||||
belongs_to :project, class_name: "::Project", primary_key: :gpid, foreign_key: :repo_id, optional: true
|
||||
|
||||
enum hook_task_type: {gogs: 1, slack: 2, gitea: 3, discord: 4, dingtalk: 5, telegram: 6, msteams: 7, feishu: 8, matrix: 9}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class Gitea::WebhookTask < Gitea::Base
|
||||
serialize :payload_content, JSON
|
||||
serialize :request_content, JSON
|
||||
serialize :response_content, JSON
|
||||
|
||||
self.inheritance_column = nil
|
||||
|
||||
self.table_name = 'hook_task'
|
||||
|
||||
belongs_to :webhook, class_name: "Gitea::Webhook", foreign_key: :hook_id
|
||||
|
||||
enum type: {gogs: 1, slack: 2, gitea: 3, discord: 4, dingtalk: 5, telegram: 6, msteams: 7, feishu: 8, matrix: 9}
|
||||
end
|
||||
Reference in New Issue
Block a user