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

WebhookServiceの構造体定義+NewServerで読み込みを行うようにした #814

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

oER4
Copy link

@oER4 oER4 commented Dec 6, 2024

WebhookServiceの構造体定義+NewServerで読み込みを行うようにした

@oER4 oER4 requested a review from H1rono December 6, 2024 13:58
@oER4 oER4 self-assigned this Dec 6, 2024
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 25.26%. Comparing base (31fc9cf) to head (7f13fde).

Files with missing lines Patch % Lines
router/router.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #814      +/-   ##
==========================================
- Coverage   25.26%   25.26%   -0.01%     
==========================================
  Files         147      147              
  Lines       30583    30585       +2     
==========================================
  Hits         7726     7726              
- Misses      21980    21982       +2     
  Partials      877      877              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +25 to +30
type WebHookService struct {
webhookSecret string;
webhookChannelId string;
webhookId string;

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

構造体の概形はあってます 👍

ただ、フィールドが小文字始まりになってしまっているのでserviceパッケージ側からアクセスできません...
加えて、このPRではservice/webhook.goにあるWebhookEventHandlerRequestWebhookを、ただの関数から作成した構造体のメソッドに置き換えることを目標としたいです。

// before
func WebhookEventHandler(...)
func RequestWebhook(...) error

// after
func (s WebHookService) WebhookEventHandler(...)
func (s WebHookService) RequestWebhook(...) error

ので、構造体の定義はrouter側ではなくservice側に置いて欲しいです。NewWebhookServiceのような関数をservice/webhook.goに生やして、router側ではこの関数を使ってWebhookServiceを作成すると丸そうだなと思ってます。 🙏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(あと細かいですが、WebHookではなくWebhookに揃えて欲しいです)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants