summaryrefslogtreecommitdiffstats
path: root/services/webhook
diff options
context:
space:
mode:
authoroliverpool <git@olivier.pfad.fr>2024-03-21 14:02:14 +0100
committeroliverpool <git@olivier.pfad.fr>2024-03-27 15:38:39 +0100
commit6b719f08d0fed21502925d86cfd94cad19510b2c (patch)
tree1f73220cdd2cf926ab5cf80d8ba295b6a3e15dcc /services/webhook
parent[REFACTOR] webhook msteams endpoint (diff)
downloadforgejo-6b719f08d0fed21502925d86cfd94cad19510b2c.tar.xz
forgejo-6b719f08d0fed21502925d86cfd94cad19510b2c.zip
[REFACTOR] webhook feishu endpoint
Diffstat (limited to 'services/webhook')
-rw-r--r--services/webhook/feishu.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/services/webhook/feishu.go b/services/webhook/feishu.go
index 19a3a0cc03..b27acc9070 100644
--- a/services/webhook/feishu.go
+++ b/services/webhook/feishu.go
@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/git"
api "code.gitea.io/gitea/modules/structs"
webhook_module "code.gitea.io/gitea/modules/webhook"
+ "code.gitea.io/gitea/services/forms"
)
type feishuHandler struct{}
@@ -20,7 +21,20 @@ type feishuHandler struct{}
func (feishuHandler) Type() webhook_module.HookType { return webhook_module.FEISHU }
func (feishuHandler) FormFields(bind func(any)) FormFields {
- panic("TODO")
+ var form struct {
+ forms.WebhookForm
+ PayloadURL string `binding:"Required;ValidUrl"`
+ }
+ bind(&form)
+
+ return FormFields{
+ WebhookForm: form.WebhookForm,
+ URL: form.PayloadURL,
+ ContentType: webhook_model.ContentTypeJSON,
+ Secret: "",
+ HTTPMethod: http.MethodPost,
+ Metadata: nil,
+ }
}
func (feishuHandler) Metadata(*webhook_model.Webhook) any { return nil }