f-lab-edu / f-lab-edu/askdata-engine
[FEATURE] 게시글 구현에 대한 설계
- Dominant language
- Kotlin
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## 기능 설명
- MySQL 의 테이블 Post 에 글이 작성되면 사용자는 리스트를 조회할 수 있다.
- 상세 페이지 접근은 `/api/posts/{id}`
- PK는 안됨.
- 다른 키를 만들어서 사용한다.
- UUID
## 리스트
- `/api/posts` 리스트
- Method: GET
- Parameter
- optional
- page: 1 보다 큰 수 (default: 1)
- sort: 최신순, 조회수 순 (default: latest)
- size: 한 페이지에서 보여줄 사이즈 (default: 30)
- Response:
- required: 제목, 조회수, 작성자, 최종 수정일(단, 조회수 증가시 updated_at은 증가하지 않는다.)
- optional: 조회수가 1000이상이면, 인기
- Projection or select all 로 모든 필드를 다 가져올 것인가?
## 상세
- `/api/posts/{post-uuid}`
- Method: GET
- Parameter
- required: path variable `UUID`
- Response:
- required: 제목, 내용, 작성자, 최종 수정일, 조회수
- optional: tag
- 호출할 때 마다 조회수 1 증가, updated_at은 변경되지 않는다.
## 테이블
다음의 컬럼 집합을 갖는다.
1. PK (BigInt)
2. title
3. content (varchar)
4. writer
5. created_at
6. updated_at
7. UUID
8. views (BigInt)
9. Tag (enum or varchar, optional)
## 작업 내용
- [ ] 테이블을 설계하고 생성한다.
- [ ] List와 Detail api 설계하고, 구현한다.
- [ ] 조회수 기능을 연동한다. (조회 할 때마다 1씩 증가한다.)
## 참고 자료
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.