Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feishu webhook support #10229

Merged
merged 3 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix lint
  • Loading branch information
lunny committed Feb 12, 2020
commit 9523e289ac01fcf563ab74d8719fa8e6780dd953
2 changes: 1 addition & 1 deletion modules/auth/repo_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (f *NewMSTeamsHookForm) Validate(ctx *macaron.Context, errs binding.Errors)
return validate(errs, ctx.Data, f, ctx.Locale)
}

// NewFeishuHookForm form for creating dingtalk hook
// NewFeishuHookForm form for creating feishu hook
type NewFeishuHookForm struct {
PayloadURL string `binding:"Required;ValidUrl"`
WebhookForm
Expand Down
2 changes: 1 addition & 1 deletion modules/structs/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type CreateHookOptionConfig map[string]string
// CreateHookOption options when create a hook
type CreateHookOption struct {
// required: true
// enum: dingtalk,discord,gitea,gogs,msteams,slack,telegram
// enum: dingtalk,discord,gitea,gogs,msteams,slack,telegram,feishu
Type string `json:"type" binding:"Required"`
// required: true
Config CreateHookOptionConfig `json:"config" binding:"Required"`
Expand Down
4 changes: 2 additions & 2 deletions routers/repo/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func SlackHooksNewPost(ctx *context.Context, form auth.NewSlackHookForm) {
ctx.Redirect(orCtx.Link)
}

// FeishuHooksNewPost response for creating slack hook
// FeishuHooksNewPost response for creating feishu hook
func FeishuHooksNewPost(ctx *context.Context, form auth.NewFeishuHookForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsHooks"] = true
Expand Down Expand Up @@ -859,7 +859,7 @@ func MSTeamsHooksEditPost(ctx *context.Context, form auth.NewMSTeamsHookForm) {
ctx.Redirect(fmt.Sprintf("%s/%d", orCtx.Link, w.ID))
}

// FeishuHooksEditPost response for editing MS Teams hook
// FeishuHooksEditPost response for editing feishu hook
func FeishuHooksEditPost(ctx *context.Context, form auth.NewFeishuHookForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsHooks"] = true
Expand Down
3 changes: 2 additions & 1 deletion templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9752,7 +9752,8 @@
"gogs",
"msteams",
"slack",
"telegram"
"telegram",
"feishu"
],
"x-go-name": "Type"
}
Expand Down