Skip to content

[POST] 시간 입력 받아서 비디오 추천 #10

Description

@epitone
  • API 명세서 작성하기
  • 로직 구현

URL

POST /recommend

Request

{
	time: 5
}

Response

{
	status: 200,
	data: {
		videoId: 1,
		title: "헬린이의 2분 운동"
		link: '1yXZIFYv4SE',
		hashTag: [
			"다이어트",
			"홈트"
		]
	}
}

Flow

  • 시간 입력을 POST 의 body로 한다.
  • 받은 시간이 분 단위로 온다.
  • e.g) time_category에서 해당하는 거 전부를 객체로 가져옴
  • rand 함수를 통해서 객체 하나 선택
    ⇒ WATCHING_HISTORY_TB에서 user_id로 조건을 걸어서 본 비디오 id들만 filter함.
    rand에서 뽑을 객체 arr에서 유저가 이미 본 비디오들을 삭제하고, rand를 통해 객체 하나를 뽑아옴.
  • 해당 객체의 정보를 정제해서 반환해 준다.(id는 안 보낸다는 등)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions