Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

API docs for DimiLeague #219

Open
hd1534 opened this issue Apr 6, 2019 · 2 comments
Open

API docs for DimiLeague #219

hd1534 opened this issue Apr 6, 2019 · 2 comments

Comments

@hd1534
Copy link

hd1534 commented Apr 6, 2019

이번에 재민쌤이 디미리그의 진행상황과 점수등을 디미고인을 통해서 볼 수 있게 해달라고 요청하심

선생님이 요구한 사항 :

1. 경기 별로 점수를 볼 수 있게 (ex: 2019-04-08 축구  oo팀, xx팀 0:8)

2. 팀별 총점수 현황 && 팀별 정보(팀원, 종목등등)

3. 선수별로  득점 && 어시스트 확인할 수 있게

[GET] /sports/

다 불러옴

Response

{
  "sports": [
    {
      "idx": 0, // event_idx
      "event": "string", // 종목 
	  "teams": [
	    {
		  "idx": 0,
		  "event": "string", // 종목 
		  "name": "string", // 팀명
          "introduction": "string", //짧은 소개 (300자 이내)
		  "total_win": 0, // 총 이긴 횟수
		  "total_defeat": 0, // 총 진 횟수
		  "total_score": 0, // 팀 종합 점수
		  "total_score_date": 0, // 마지막으로 종합점수 갱신한 날짜 (유닉스)
		  "members": [
			{
			  "idx": 0, // 멤버 idx
			  "total_score": 0, // 득점 총합
			  "total_assist": 0, // 어시스트 총합
			  "user": 
				{
				  "idx": 0, // user_idx
				  "name": "string", // 이름
				  "grade": 0, // 학년
				  "klass": 0, // 반 (class는 예약어라)
				  "number": 0, // 번호
				  "serial": 0, // 학번
				}
			  }
			]
		}
    }
  ]
}

event

[POST] /sports/event

종목을 추가함

Payload

{
  "name": "string" // 종목 이름
}

[DELETE] /sports/event/<event_idx>

종목을 삭제함

[GET] /sports/events

종목들을 불러옴

Response

{
  "events": [
    {
	  "idx": 0, // 종목 idx
	  "name": "string" // 종목 이름
	}
  ]
}

team

[POST] /sports/team

팀을 추가함

Payload

{
  "event_idx": 0, // 종목 idx
  "name": "string", // 팀 이름                  
  "introduction": "string", //짧은 소개 (300자 이내)
}

[GET] /sports/team/<team_idx>

해당 idx의 팀을 보여줌

Response

{
  "team":
    {
      "idx": 0,
      "event": "string", // 종목                   
      "introduction": "string", //짧은 소개 (300자 이내)
	  "name": "string", // 팀명
	  "win": 0, //이긴 횟수
	  "defeat": 0, // 진 횟수
	  "total_score": 0, // 팀 종합 점수
	  "total_score_date": 0, // 마지막으로 종합점수 갱신한 날짜 (유닉스)
	  "members": [
	    {
		  "idx": 0, // 멤버 idx
		  "total_score": 0, // 득점 총합
		  "total_assist": 0, // 어시스트 총합
		  "user": 
		    {
			  "idx": 0, // user_idx
			  "name": "string", // 이름
			  "grade": 0, // 학년
			  "klass": 0, // 반 (class는 예약어라)
			  "number": 0, // 번호
			  "serial": 0, // 학번
			}
		  }
		]
	} 
}

[DELETE] /sports/team/<team_idx>

해당 idx의 팀을 삭제

[GET] /sports/teams

모든 팀을 보여줌 (종목 상관 x)

Response

{
  "teams": [
    {
      "idx": 0,
      "event": "string", // 종목 
	  "name": "string", // 팀명
      "introduction": "string", //짧은 소개 (300자 이내)
	  "win": 0, //이긴 횟수
	  "defeat": 0, // 진 횟수
	  "total_score": 0, // 팀 종합 점수
	  "total_score_date": 0, // 마지막으로 종합점수 갱신한 날짜 (유닉스)
    }
  ]
}

[GET] /sports/teams/event/<event_idx>

해당 idx의 종목의 팀들을 보여줌

Response

{
  "teams": [
	{
	  "idx": 0,
	  "event": "string", // 종목 
	  "name": "string", // 팀명                  
          "introduction": "string", //짧은 소개 (300자 이내)
	  "win": 0, //이긴 횟수
	  "defeat": 0, // 진 횟수
	  "total_score": 0, // 팀 종합 점수
	  "total_score_date": 0, // 마지막으로 종합점수 갱신한 날짜 (유닉스)
	  "members": [
		{
		  "idx": 0, // 멤버 idx
		  "total_score": 0, // 득점 총합
		  "total_assist": 0, // 어시스트 총합
		  "user": 
			{
			  "idx": 0, // user_idx
			  "name": "string", // 이름
			  "grade": 0, // 학년
			  "klass": 0, // 반 (class는 예약어라)
			  "number": 0, // 번호
			  "serial": 0, // 학번
			}
		  }
		]
	}
}

member

[POST] /sports/member

같은사람이라도 종목마다 다른 member_idx를 부여받는다.

Payload

{
  "user_idx": 0, // 등록할 사람 idx
  "event_idx": 0, // 등록하고 싶은 종목 idx
  "team_idx": 0, // 등록하고 싶은 팀 idx
}

[DELETE] /sports/member/<member_idx>

해당 idx member를 지움


scorebook/member

**[POST] /sports/scorebook/member

점수 등록

Payload

{
  "member_idx": 0, // 멤버 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 이번경기 득점
  "assist": 0, // 이번경기 어시스트
}

**[PUT] /sports/scorebook/<scorebook_idx>/member

점수 수정

Payload

{
  "score": 0, // 해당경기 득점
  "assist": 0, // 해당경기 어시스트
}

**[DELETE] /sports/scorebook/<scorebook_idx>

점수 등록 삭제

[GET] /sports/scorebook/<scorebook_idx>/member

해당 scorebook의 정보를 줌

Response

{
  "idx": 0, // scorebook_idx
  "member_idx": 0, // 멤버 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 이번경기 득점
  "assist": 0, // 이번경기 어시스트
} 

[GET] /sports/scorebook/member/<member_idx>/match/<match_idx>

해당 매치의 해당 idx의 맴버의 득점, 어시스트

Response

{
  "idx": 0, // scorebook_idx
  "member_idx": 0, // 멤버 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 이번경기 득점
  "assist": 0, // 이번경기 어시스트
} 

[GET] /sports/scorebook/member/<member_idx>/total

해당 idx의 맴버의 총 득점, 어시스트

Response

{
  "idx": 0, // scorebook_idx
  "member_idx": 0, // 멤버 idx
  "total_score": 0, // 득점 총합
  "total_assist": 0, // 어시스트 총합
} 

scorebook/team

**[POST] /sports/scorebook/team

점수 등록

Payload

{
  "team_idx": 0, // 팀 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 득점
  "result": "string" // "yet" = 아직, "win" = 승리, "draw" = 무승부, "defeat" = 패배
}

**[PUT] /sports/scorebook/<scorebook_idx>/team

점수 수정

Payload

{
  "score": 0, // 득점
  "result": "string" // "yet" = 아직, "win" = 승리, "draw" = 무승부, "defeat" = 패배
}

**[DELETE] /sports/scorebook/<scorebook_idx>

점수 등록 삭제

[GET] /sports/scorebook/<scorebook_idx>/team

해당 scorebook의 정보를 줌

Response

{
  "idx": 0, // scorebook_idx
  "team_idx": 0, // 멤버 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 이번경기 득점
  "result": "string" // "yet" = 아직, "win" = 승리, "draw" = 무승부, "defeat" = 패배
} 

[GET] /sports/scorebook/team/<team_idx>/match/<match_idx>

해당 scorebook의 정보를 줌

Response

{
  "idx": 0, // scorebook_idx
  "team_idx": 0, // 멤버 idx
  "match_idx": 0, // 경기 idx
  "score": 0, // 이번경기 득점
  "result": "string" // "yet" = 아직, "win" = 승리, "draw" = 무승부, "defeat" = 패배
} 

match

[GET] /sports/matchs

모든 경기 일정 불러오기

Response

{
  "matchs": [
    {
	  "idx": 0, // 경기 idx
	  "event": "string", // 종목 이름
	  "event_idx": 0, // 종목 idx
	  "start_date": 0, //시작 시간 (유닉스)
	  "end_date": 0, // 종료 시간 (유닉스)
	  "team1": {
		  "idx": 0, // 팀 idx
		  "name": "string",
		  "score": 0, // 이번 게임 점수
		}
	  "team2": {
		  "idx": 0, // 팀 idx
		  "name": "string",
		  "score": 0, // 이번 게임 점수
		}
	}
  ]
} 

**[POST] /sports/match

경기를 추가

Payload

{
  "event_idx": 0, // 종목 idx
  "start_date": 0, //시작 시간 (유닉스)
  "end_date": 0, // 종료 시간 (유닉스)
  "team1_idx": 0, // 팀1 idx
  "team2_idx": 0, // 팀2 idx
} 

**[GET] /sports/match/<match_idx>

해당 경기를 불러옴

Response

{
  "idx": 0, // 경기 idx
  "event": "string", // 종목 이름
  "event_idx": 0, // 종목 idx
  "start_date": 0, //시작 시간 (유닉스)
  "end_date": 0, // 종료 시간 (유닉스)
  "team1": {
	  "idx": 0, // 팀 idx
	  "name": "string",
	  "score": 0, // 이번 게임 점수
	}
  "team2": {
	  "idx": 0, // 팀 idx
	  "name": "string",
	  "score": 0, // 이번 게임 점수
	}
} 

**[DELETE] /sports/match/<match_idx>

해당 경기일정을 지움

문제있거나 필요한거 있으면 의견좀

@junhoyeo junhoyeo changed the title API docs for sports API docs for DimiLeague Apr 10, 2019
@uhmseohun
Copy link
Member

한 팀의 idx로 그 팀이 참가했던 모든 경기를 불러오는 거 만들어주실 수 있으신가요?

@uhmseohun
Copy link
Member

[GET] /sports/matchs에서 아직 시작되지 않은 경기는 end_date를 0으로 설정해주시면 편할 것 같아요

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

No branches or pull requests

3 participants