Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

추가사항

JaeYoungKim edited this page Apr 23, 2014 · 12 revisions

변경사항

  • api/manifestos/daily.json 쿼리 캐싱 수행
  • reply_cnt => replies_cnt 컬럼으로 변경 ( 둘다 보내지만 향후에는 replies_cnt 만 사용 )
  • png 등 static file nginx 로 변경

모델 추가

  • versus : Politician 끼리 대결 has_many :vote
  • vote : versus 에 투표 belongs_to :versus :counter_cache
  • reply : Polymorphic 으로 변경 versus 에 댓글추가 ( versus , manifesto ) 댓글 같이 사용
  • hot_issue

API 추가

  • GET api/versus.json => 대결 전체 리스트

  • GET /api/versus/#{id}.json => 특정 대결

    • id : 해당 대결 아이디
  • POST api/versus/#{id}/vote.json => 해당 대결 투표하기

    • id : 해당 대결의 아이디
    • vote_id={0,1} : 왼쪽 후보-0, 오른쪽 후보-1
  • POST api/replies/create.json => 대결 댓글달기

    • versus_id : 해당 대결 아이디 ( manifesto_id 를 넣으면 해당 공약에 리플이 달림 둘중 하나만 넣어야함)
    • content : 리플 내용
  • GET api/issues.json => 해당 이슈들 보기

    • count : 가져올 갯수
    • page : 페이징 번호
  • GET api/issues/#{id}.json => 특정 이슈들 보기

    • id : 해당 이슈의 아이디
Clone this wiki locally