Skip to content

Commit

Permalink
Merge pull request #54 from dydhyhwu/master
Browse files Browse the repository at this point in the history
feat(webhook): gitea添加多种模板支持,优化提示新消息模板
  • Loading branch information
dydhyhwu committed Apr 24, 2024
2 parents b3fad0e + caebdef commit 35e32f8
Show file tree
Hide file tree
Showing 11 changed files with 954 additions and 222 deletions.
7 changes: 6 additions & 1 deletion httpd/wrobot/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ func (w *Webhook) receive(c *gin.Context) {

// 根据app类型不同,调用不同的处理方式,参照handler的注册
msg := whapp.Handler(c.Request.Header, app, string(request))
res := wc.CmdClient.SendTxt(msg, hook.TargetId, "")

var res int32

if msg != "" {
res = wc.CmdClient.SendTxt(msg, hook.TargetId, "")
}

if res == 0 {
c.Set("Message", "OK")
Expand Down
1 change: 0 additions & 1 deletion wclient/whapp/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ func Handler(header http.Header, app string, msg string) string {
}

return res

}
184 changes: 0 additions & 184 deletions wclient/whapp/gitea/event.go

This file was deleted.

Loading

0 comments on commit 35e32f8

Please sign in to comment.