-
Notifications
You must be signed in to change notification settings - Fork 0
/
draft.yaml
134 lines (124 loc) · 2.94 KB
/
draft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
models:
User: # Update default model,migration
name: string:50
nickname: string:50 unique
email: string:100 nullable unique
phone: string:20 nullable unique
password: string:100 nullable
provider: string:20 nullable
provider_id: string:200 nullable
provider_token: string:200 nullable
timestamps
softDeletes
deleted_reason: string:200 nullable
relationships:
hasMany: UserApple, UserKakao, Post, Comment, Like
UserApple:
user_id: id foreign:users.id
name: string:200
email: string:200 nullable
sub: string:200 nullable
at_hash: string:200 nullable
token: text nullable
timestamps
softDeletes
relationships:
belongsTo: User
UserKakao:
user_id: id foreign:users.id
name: string:200 nullable
email: string:200 nullable
nickname: string:200 nullable
avatar: string:200 nullable
gender: string:20 nullable
birthday: string:20 nullable
calendar: string:20 nullable
age_range: string:20 nullable
sub: string:200 nullable
timestamps
softDeletes
relationships:
belongsTo: User
Post:
user_id: id foreign:users.id
type: enum:free,notice,faq nullable
title: string:100
content: longtext
hit : unsignedInteger default:0
likes_count: unsignedInteger default:0
is_published: boolean default:0
timestamps
softDeletes
relationships:
belongsTo: User
hasMany: Comment
morphMany: Like
Comment:
user_id: id foreign:users.id
post_id: id foreign:posts.id
parent_id: unsignedInteger nullable
content: text
likes_count: unsignedInteger default:0
softDeletes
timestamps
relationships:
belongsTo: User, Post
morphMany: Like
Like:
user_id: id foreign:users.id
# likeable: morphs
softDeletes
timestamps
relationships:
belongsTo: User
morphTo: likeable
seeders: User, UserApple, UserKakao, Post, Comment, Like
controllers:
User:
resource: api.store, api.show, api.update, api.destroy
store:
validate: name, nickname, email, password
save: user
show:
find: user
update:
validate: name, nickname, email, password
update: user
destroy:
validate: deleted_reason
delete: user
Post:
resource: api
index:
validate: search, per_page
store:
validate: title, content
save: post
show:
find: post
with: comments
edit:
find: post
update:
validate: title, content
update: post
destroy:
validate: deleted_reason
delete: post
Comment:
resource: api.store, api.update, api.destroy
store:
validate: post_id, content
save: comment
update:
validate: content
update: comment
destroy:
delete: comment
Like:
resource: api.store, api.destroy
store:
validate: likeable_id, likeable_type
save: like
destroy:
delete: like