API Specification - polynomeer/preptide GitHub Wiki

๐ŸŒ API ๋ช…์„ธ์„œ (RESTful)

๐Ÿ“Œ ์ธ์ฆ

POST /api/auth/login

  • ์š”์ฒญ: { email, oauthProviderToken }
  • ์‘๋‹ต: { accessToken, refreshToken, userInfo }

๐Ÿ“Œ ์งˆ๋ฌธ

GET /api/questions/daily

  • ์„ค๋ช…: ์˜ค๋Š˜์˜ ์งˆ๋ฌธ ์กฐํšŒ
  • ์‘๋‹ต: { id, content, tags, difficulty }

GET /api/questions/{id}

  • ์„ค๋ช…: ํŠน์ • ์งˆ๋ฌธ ์ƒ์„ธ ์กฐํšŒ
  • ์‘๋‹ต: { id, content, tags, difficulty, source }

๐Ÿ“Œ ๋‹ต๋ณ€

POST /api/answers

  • ์š”์ฒญ: { questionId, content }
  • ์‘๋‹ต: { answerId, createdAt }

GET /api/answers/{id}

  • ์‘๋‹ต: { content, createdAt, aiFeedback, followUps[] }

๐Ÿ“Œ AI ํ”ผ๋“œ๋ฐฑ

GET /api/answers/{id}/feedback

  • ์„ค๋ช…: AI ํ”ผ๋“œ๋ฐฑ ๋‹จ๊ฑด ์กฐํšŒ
  • ์‘๋‹ต: { logicalScore, structureScore, detailScore, comment }

๐Ÿ“Œ ๊ผฌ๋ฆฌ์งˆ๋ฌธ

GET /api/answers/{id}/followups

  • ์‘๋‹ต: [ { step, questionText } ]

๐Ÿ“Œ ์ปค๋ฎค๋‹ˆํ‹ฐ

GET /api/community/answers

  • ์„ค๋ช…: ๊ณต๊ฐœ ๋‹ต๋ณ€ ๋ชฉ๋ก ์กฐํšŒ (ํƒ์ƒ‰ ํ”ผ๋“œ)
  • ์ฟผ๋ฆฌ: ?tag=Java&sort=recent
  • ์‘๋‹ต: ๋ฆฌ์ŠคํŠธ ํ˜•ํƒœ

POST /api/answers/{id}/like

  • ์„ค๋ช…: ์ข‹์•„์š” ๋“ฑ๋ก
  • ์‘๋‹ต: { success: true }

POST /api/answers/{id}/comments

  • ์š”์ฒญ: { content }
  • ์‘๋‹ต: { commentId, createdAt }

POST /api/answers/{id}/remix

  • ์š”์ฒญ: { content }
  • ์‘๋‹ต: { remixId }

๐Ÿ“Œ ์ˆํผ ์ฝ˜ํ…์ธ 

GET /api/shorts

  • ์„ค๋ช…: ์ˆํผ ์ฝ˜ํ…์ธ  ์กฐํšŒ
  • ์‘๋‹ต: [ { id, title, url, tags[] } ]

๐Ÿ“Œ ๋ถ๋งˆํฌ

POST /api/bookmarks

  • ์š”์ฒญ: { questionId }
  • ์‘๋‹ต: { success: true }

GET /api/bookmarks

  • ์‘๋‹ต: [ { questionId, content, tags } ]