-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.txt
108 lines (62 loc) · 3.65 KB
/
test.txt
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
%%%% User %%%%
1. Create User:
curl -X POST http://localhost:8080/user/create-user \
-H "Content-Type: application/json" \
-d '{"username": "testuser", "email": "[email protected]", "passwordHash": "passwordhash", "userType": "STUDENT", "major": "Computer Science", "graduationYear": 2024, "profilePic": "profile.jpg", "shortBio": "This is a test user."}'
2. Get User Info:
curl -X GET http://localhost:8080/user/user-info/1
3. Update User:
curl -X PUT http://localhost:8080/user/update-user/1 \
-H "Content-Type: application/json" \
-d '{"username": "updatedUsername", "email": "[email protected]", "passwordHash": "updatedPasswordHash", "userType": "Student", "major": "Computer Science", "graduationYear": 2025, "profilePic": "updatedPath/to/profile_pic.jpg", "shortBio": "Updated short bio about the user."}'
4. Delete User:
curl -X DELETE http://localhost:8080/user/delete-user/1
%%%% Article %%%%
1. Create Article:
curl -X POST http://localhost:8080/article/create-article \
-H "Content-Type: application/json" \
-d '{"title": "Test Article", "content": "This is a test article.", "userId": 1, "submissionDate": "2024-03-03", "articleStatus": "DRAFT", "picture": "test.jpg", "mediaUrl": "http://example.com/media", "category": "Test"}'
2. Get Article Info:
curl -X GET http://localhost:8080/article/article-info/1
3. Update Article:
curl -X PUT http://localhost:8080/article/update-article/16 \
-H "Content-Type: application/json" \
-d '{"title": "Updated Test Article", "content": "This is an updated test article.", "email": "[email protected]", "submissionDate": "2024-03-03", "articleStatus": "PUBLISHED", "picture": "updated.jpg", "mediaUrl": "http://example.com/updated", "category": "TECHNOLOGY", "issue": 2, "volume":1}'
4. Delete Article:
curl -X DELETE http://localhost:8080/article/delete-article/1
%%%% Comment %%%%
1. Create Comment:
curl -X POST http://localhost:8080/comment/create-comment \
-H "Content-Type: application/json" \
-d '{"articleId": 19, "email": "[email protected]", "commentText": "This is a test comment.", "commentDate": "2024-03-03T12:00:00"}'
2. Get Comments by Article ID:
curl -X GET http://localhost:8080/comment/article-comments/1
3. Update Comment:
curl -X PUT http://localhost:8080/comment/update-comment/1 \
-H "Content-Type: application/json" \
-d '{"articleId": 1, "userId": 1, "commentText": "This is an updated test comment.", "commentDate": "2024-03-03T12:00:00"}'
4. Delete Comment:
curl -X DELETE http://localhost:8080/comment/delete-comment/1
%%%% Donation %%%%
1. Make Donation:
curl -X POST http://localhost:8080/donation/make-donation \
-H "Content-Type: application/json" \
-d '{"userId": 1, "donationComment": "This is a test donation.", "donationDate": "2024-03-03", "donationAmount": 100}'
2. Get Donation Info:
curl -X GET http://localhost:8080/donation/donation-info/1
3. Update Donation:
curl -X PUT http://localhost:8080/donation/update-donation/1 \
-H "Content-Type: application/json" \
-d '{"userId": 1, "donationComment": "This is an updated test donation.", "donationDate": "2024-03-03", "donationAmount": 200}'
4. Delete Donation:
curl -X DELETE http://localhost:8080/donation/delete-donation/1
%%%% Search by title %%%%
curl -X GET "http://localhost:8080/article/search?title=robot"
%%%% Search article by username %%%%
curl -X GET "http://localhost:8080/article/user/vlad.bershchanskiy"
%%%% Search comment by username %%%%
curl -X GET "http://localhost:8080/comment/user/vlad.bershchanskiy"
%%%% Comment Count per Article %%%%
curl -X GET "http://localhost:8080/article/1/comment-count"
%%%% Endpoints for different category of article %%%%
curl -X GET "http://localhost:8080/article/TRAVEL"