Skip to content

教務システムにログインしてAPIの内容を出力#45

Draft
Hosoda-abo wants to merge 4 commits into
mainfrom
room-reservation-job
Draft

教務システムにログインしてAPIの内容を出力#45
Hosoda-abo wants to merge 4 commits into
mainfrom
room-reservation-job

Conversation

@Hosoda-abo

Copy link
Copy Markdown
Member

変更点

  • 教務システムにログインし、APIで取得してきた内容を出力する。

課題

  • 年度の入力が固定値になっている

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

教務システムにログインしてセッションを維持し、その後に指定APIを呼び出してレスポンス内容を標準出力へ出すためのCloud Run Job相当の cmd エントリポイントを追加するPRです。

Changes:

  • 教務システムのログインフォーム(hidden field含む)を取得してPOSTするログイン処理を追加
  • セッション維持した http.Client でAPIをGETし、レスポンスを出力する処理を追加

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/room-reservation-job/main.go Outdated
Comment thread cmd/room-reservation-job/main.go Outdated
Comment on lines +53 to +64
// --- 2. フォームのpayloadを組み立てる ---
payload := url.Values{}
payload.Set("__LASTFOCUS", "")
payload.Set("__EVENTTARGET", "")
payload.Set("__EVENTARGUMENT", "")
payload.Set("__SCROLLPOSITIONX", "0")
payload.Set("__SCROLLPOSITIONY", "0")
payload.Set("ctl00$MainContent$TargetYearList", targetYear)
payload.Set("ctl00$MainContent$TargetTermList", targetTerm)
payload.Set("ctl00$MainContent$LoginId", username)
payload.Set("ctl00$MainContent$LoginPassword", password)
payload.Set("ctl00$MainContent$LoginButton", "ログイン")
Comment thread cmd/room-reservation-job/main.go Outdated
Comment on lines +100 to +116
resp, err := client.Get(apiURL)
if err != nil {
return fmt.Errorf("API取得失敗: %w", err)
}
defer resp.Body.Close()

fmt.Println("ステータスコード:", resp.StatusCode)
fmt.Println("Content-Type:", resp.Header.Get("Content-Type"))

body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("読み込み失敗: %w", err)
}

fmt.Println("---レスポンス内容---")
fmt.Println(string(body))

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploying fun-dotto-server-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d3b6c5
Status: ✅  Deploy successful!
Preview URL: https://393008e0.fun-dotto-server-docs.pages.dev
Branch Preview URL: https://room-reservation-job.fun-dotto-server-docs.pages.dev

View logs

Hosoda-abo and others added 2 commits July 24, 2026 17:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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