하루 기록

[팀플: 뉴스피드] DB 스키마, 필요한 API 목록은? 본문

Today I Learned/diary

[팀플: 뉴스피드] DB 스키마, 필요한 API 목록은?

떼굴펜 2024. 6. 3. 12:04

posts

col name data type key nullalbe default 비고
id int PK not null auto increment  
title text PK not null    
content text   nullable (empty)    
writer text    nullable (null)   user_id 와 매칭 (FK는 걸지 않음)
created_at timestamp     now()  
tag text       , 기준으로 끊기 (예시 : a,b,c,d,e)
like int   not null 0  
view int   not null 1  

 

 

users

col name data type key nullalbe default 비고
id int PK not null auto increment  
created_at timestamp   not null now()  
id text PK not null    
password text   not null    

 

 

 


 

필요 API 목록

페이지 API request params 비고
home GET /posts/search keyword : string 최근 작성 순 | title에 keyword 포함된 글
  GET /posts/popular   최근 작성 순 | view > n
  GET /posts/recent   최근 작성 순
mypage GET /users/:user_id user_id : string  
  GET /posts/:user_id user_id : string 최근 작성 순 | user_id가 작성한 글 목록
sign up POST /user/join user_id : string
password:string
 
log in (sign in) POST /user/login user_id : string
password:string
 
log out POST /user/logout user_id : string  
detail GET /post/:post_id post_id : ??  
createPost POST /post title
content
writer : 유저 아이디?
tag 
title : 빈값 안됨
tag : , 기준으로 split 해서 사용할 수 있도록 (예시 : a,b,c,d,e)

 

왜 로그아웃 버튼이 없지? -> 아 한번 들어오면 못나간다.