traQへのリクエストにgo-traqを使う
ras0q opened this issue · comments
↓みたいなのを全部go-traqに変える
Lines 15 to 29 in cb9fc32
OAuth2トークンを使ったAPIClientの作成は↓でできる
traqconf := traq.NewConfiguration()
traqconf.HTTPClient = conf.Client(c.Request().Context(), tok)
client := traq.NewAPIClient(traqconf)
現在traQにリクエストをしている箇所は
traQにメッセージを送信
https://github.com/traPtitech/knoQ/blob/main/utils/api.go#L20-L48
ユーザー情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/user.go#L15-L29
複数のユーザー情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/user.go#L31-L51
自分のユーザー情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/user.go#L53-L67
グループ情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/group.go#L14-L28
複数のグループ情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/group.go#L30-L44
ユーザー情報の取得
https://github.com/traPtitech/knoQ/blob/main/infra/traq/group.go#L46-L70
もう少しわかりやすい名前にすれば良かったと思ってるけどwebhookは https://github.com/ras0q/traq-writer とかがあるので記述減らしたい&デバッグ環境でtraQに通知飛ばしたくないときは参考にしてください