Guest User

Untitled

a guest
Nov 21st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. create table chat_rooms
  2. (
  3. id bigserial not null
  4. constraint chat_rooms_pkey
  5. primary key,
  6. name varchar(255) not null,
  7. owner_id int not null
  8. )
  9. ;
  10.  
  11. create table chat_members
  12. (
  13. id bigserial not null
  14. constraint chat_members_pkey
  15. primary key,
  16. user_id integer not null,
  17. room_id integer not null
  18. )
  19. ;
  20.  
  21. create table chat_comments
  22. (
  23. id bigserial not null
  24. body text,
  25. user_id integer not null,
  26. room_id integer
  27. )
  28. ;
  29.  
  30.  
  31. -- REST Example
  32. --
  33. -- GET /chat?room_id=<room_id> -- 一覧(検索)
  34. -- GET /chat/:room_id -- チャット内容表示
  35. -- POST /chat/:room_id -- 投稿
  36. -- GET /chat/:room_id/members -- チャットメンバー
  37. -- PUT /chat/:comment_id -- 投稿変更
  38. -- DELETE /chat/:comment_id -- 投稿削除
Add Comment
Please, Sign In to add comment