1
0
Fork 0
forked from forgejo/forgejo

[REFACTOR] webhook feishu endpoint

This commit is contained in:
oliverpool 2024-03-21 14:02:14 +01:00
parent 97f0ad49ff
commit 6b719f08d0
4 changed files with 15 additions and 36 deletions

View file

@ -388,27 +388,6 @@ func gogsHookParams(ctx *context.Context) webhookParams {
}
}
// FeishuHooksNewPost response for creating Feishu webhook
func FeishuHooksNewPost(ctx *context.Context) {
createWebhook(ctx, feishuHookParams(ctx))
}
// FeishuHooksEditPost response for editing Feishu webhook
func FeishuHooksEditPost(ctx *context.Context) {
editWebhook(ctx, feishuHookParams(ctx))
}
func feishuHookParams(ctx *context.Context) webhookParams {
form := web.GetForm(ctx).(*forms.NewFeishuHookForm)
return webhookParams{
Type: webhook_module.FEISHU,
URL: form.PayloadURL,
ContentType: webhook.ContentTypeJSON,
WebhookForm: form.WebhookForm,
}
}
// WechatworkHooksNewPost response for creating Wechatwork webhook
func WechatworkHooksNewPost(ctx *context.Context) {
createWebhook(ctx, wechatworkHookParams(ctx))