-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadMe.txt
More file actions
38 lines (30 loc) · 1.43 KB
/
ReadMe.txt
File metadata and controls
38 lines (30 loc) · 1.43 KB
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
go build
env GOOS=linux GOARCH=amd64 go build
go install
go get
go fmt
go test
go test -v
// api design
http status code:
200 get succuss
201 create success
204 no content
400 page not exist
401 no verify
403 no auth
500 server error
url method sc
* create user : /user post 201, 400, 500
* login : /user/:username post 201, 400, 500
* get user info: /user/:username get 200, 400, 401, 403, 500
* del user : /user/:username delete 204, 400, 401, 403, 500
* list all videos: /user/:username/videos get 200, 400, 500
* get one video: /user/:username/videos/:vid-id get 200, 400, 500
* delete one video: /user/:username/videos/:vid-id delete 204, 400, 401, 403, 500
* show comments /videos/:vid-id/comments get 200, 400, 500
* post a comment /videos/:vid-id/comments post 201, 400, 500
* delete a comment /videos/:vid-id/comment/:cmt-id delete 204, 400, 401, 403, 500
handler->validation{1.request, 2.user}->business logic->response
1. data model
2. error handling