traPtitech / Jomon

Account Support System for traP
7 stars 3 forks source link

webhookのeventhandlerが怪しい #769

Open H1rono opened 4 months ago

H1rono commented 4 months ago

特にtransaction周り

handler登録: https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/router/router.go#L62-L68

handler実装: https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/service/webhook.go#L74 https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/service/webhook.go#L129-L173

POST /api/transactionsPUT /api/transactions/:transactionIDに対して同一の構造体でペイロードをbindしている https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/service/webhook.go#L38-L44 が、この2つのエンドポイントではペイロードの構造が違う POSTのペイロード https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/router/transaction.go#L27-L33 PUTのペイロード https://github.com/traPtitech/Jomon/blob/2083952c199423c2de6c9add9bdaad24ac6cef89/router/transaction.go#L35-L41