-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.http
More file actions
123 lines (100 loc) · 2.73 KB
/
Copy pathtest.http
File metadata and controls
123 lines (100 loc) · 2.73 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
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
### test index
GET http://localhost:9090
Cache-Control: no-cache
### test sign up
POST http://localhost:9090/api/sign-up
Content-Type: application/json
{
"username": "Noah1",
"email": "Noah1@gmail.com",
"password": "123456",
"workspace": "Noah1"
}
### test sign in
# @name signin
POST http://localhost:9090/api/sign-in
Content-Type: application/json
{
"email": "Noah@gmail.com",
"password": "123456"
}
###
@token = {{signin.response.body.data.token}}
@request_id = {{signin.response.headers.x-request-id}}
### test get user list
GET http://localhost:9090/api/user/list
Cache-Control: no-cache
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
### test create chat
POST http://localhost:9090/api/chat/create
Content-Type: application/json
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
{
"name": "Noah1",
"user_ids": [1, 2]
}
### test update chat
POST http://localhost:9090/api/chat/update
Content-Type: application/json
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
{
"id": 1,
"name": "IT",
"user_ids": [1, 2],
"is_public": false
}
### test get chat list
GET http://localhost:9090/api/chat/list
Cache-Control: no-cache
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
### test get chat detail
GET http://localhost:9090/api/chat/1
Cache-Control: no-cache
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
### test delete chat
POST http://localhost:9090/api/chat/delete
Content-Type: application/json
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
{
"id": 7
}
### test file upload
POST http://localhost:9090/api/upload
Authorization: Bearer {{token}}
x-request-id: {{request_id}}
Content-Type: multipart/form-data; boundary=MyBoundary
--MyBoundary
Content-Disposition: form-data; name="file"; filename="GvKFaZhW4AAiVbM.jpg"
Content-Type: application/octet-stream
# < C:\Users\Trist\Pictures\表情\11.jpg
< C:\Users\strid\Pictures\照片\GvKFaZhW4AAiVbM.jpg
--MyBoundary
Content-Disposition: form-data; name="hello.txt"
Content-Type: text/plain
hello, world!
--MyBoundary--
### test file download
GET http://localhost:9090/api/chat/files/1/7e1/139/697d00b564f9522765ed41f6b207b12de5.jpg
Cache-Control: no-cache
Authorization: Bearer {{token}}
x-request-id: {{request_id}}
### test send message
POST http://localhost:9090/api/chat/1/message/send
Content-Type: application/json
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}
{
"content": "我是刘秀",
"files": ["/chat/files/1/7e1/139/697d00b564f9522765ed41f6b207b12de5.jpg"]
}
### test get message list
GET http://localhost:9090/api/chat/1/message/list?last_id=3&limit=2
Cache-Control: no-cache
Authorization: Bearer {{ token }}
x-request-id: {{request_id}}