Fix search publication mechanism.

This commit is contained in:
Florian THIERRY
2024-03-15 17:39:04 +01:00
parent 6e2b86153e
commit da1937cb31
18 changed files with 258 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
meta {
name: Create a new category
type: http
seq: 1
}
post {
url: {{url}}/api/categories
body: json
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:json {
{
"name": "New category with sub-category",
"subCategoryIds": [
"2d19d037-57a1-44a1-9a20-766b4e3628b6"
]
}
}

View File

@@ -0,0 +1,15 @@
meta {
name: Delete an existing category
type: http
seq: 3
}
delete {
url: {{url}}/api/categories/{{categoryId}}
body: none
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}

View File

@@ -0,0 +1,11 @@
meta {
name: Get all categories
type: http
seq: 4
}
get {
url: {{url}}/api/categories
body: none
auth: none
}

View File

@@ -0,0 +1,22 @@
meta {
name: Update an existing category
type: http
seq: 2
}
put {
url: {{url}}/api/categories/{{categoryId}}
body: json
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:json {
{
"name": "Another name of the category",
"subCategoryIds": []
}
}

View File

@@ -0,0 +1,19 @@
meta {
name: Create a new picture
type: http
seq: 1
}
post {
url: {{url}}/api/pictures
body: multipartForm
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:multipart-form {
file: @file(/Users/florian_thierry/Pictures/applications_mac.jpeg)
}

View File

@@ -0,0 +1,11 @@
meta {
name: Load a picture
type: http
seq: 2
}
get {
url: {{url}}/api/pictures/{{pictureId}}
body: none
auth: none
}

View File

@@ -0,0 +1,25 @@
meta {
name: Create a new publication
type: http
seq: 1
}
post {
url: {{url}}/api/publications
body: json
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:json {
{
"title" : "Test",
"text" : "Test",
"description" : "Test",
"illustrationId" : "e2a5618e-ef83-4e83-b8ec-0aa129173f85",
"categoryId" : "3f4b4540-a901-92f3-1c15-8ec9172f820e"
}
}

View File

@@ -0,0 +1,15 @@
meta {
name: Delete an existing publication
type: http
seq: 3
}
delete {
url: {{url}}/api/publications/{{publicationId}}
body: none
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}

View File

@@ -0,0 +1,15 @@
meta {
name: Get a publication by its id
type: http
seq: 4
}
get {
url: {{url}}/api/publications/{{publicationId}}
body: none
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}

View File

@@ -0,0 +1,19 @@
meta {
name: Search publications
type: http
seq: 5
}
get {
url: {{url}}/api/publications?query=test
body: none
auth: bearer
}
query {
query: test
}
auth:bearer {
token: {{bearerToken}}
}

View File

@@ -0,0 +1,25 @@
meta {
name: Update an existing publication
type: http
seq: 2
}
put {
url: {{url}}/api/publications/{{publicationId}}
body: json
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:json {
{
"title" : "Le titre de la publication.",
"text" : "Un autre contenu de la publication.",
"description" : "Une autre description de la publication",
"image" : "https://google.com/logos/doodles/2024/celebrating-the-flat-white-6753651837110463-s.png",
"categoryId" : "fd424c2f-6e58-4812-a179-00e50a0eab05"
}
}

View File

@@ -0,0 +1,18 @@
meta {
name: Login as admin user
type: http
seq: 2
}
post {
url: {{url}}/api/users/login
body: json
auth: none
}
body:json {
{
"id": "15a13dc7-029d-4eab-a63d-c1e96f90241d",
"password": "password"
}
}

View File

@@ -0,0 +1,18 @@
meta {
name: Login as standard user
type: http
seq: 1
}
post {
url: {{url}}/api/users/login
body: json
auth: none
}
body:json {
{
"id": "5ad462b8-8f9e-4a26-bb86-c74fef5d11b6",
"password": "password"
}
}

View File

@@ -0,0 +1,11 @@
meta {
name: Sign in
type: http
seq: 3
}
post {
url: {{url}}/users
body: none
auth: none
}

View File

@@ -1,7 +1,7 @@
vars {
url: http://localhost:8080
publicationId: e23831a6-9cc0-4f3d-9efa-7a1cae191cb1
bearerToken: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ0NjJiOC04ZjllLTRhMjYtYmI4Ni1jNzRmZWY1ZDExYjYiLCJleHAiOjE3MTA0OTc2MTd9.xYfS-9CrJxCKUyvZ1ejMKErEttA1zysXxjlVzHFzXJ3ct9dt13xuiI7PHA-8_xY7HQjuIP1M5P2p0OGVsnxXsw
bearerToken: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ0NjJiOC04ZjllLTRhMjYtYmI4Ni1jNzRmZWY1ZDExYjYiLCJleHAiOjE3MTA1MjE5NzN9.KgYeDYNjgM4ndv_An0fAoOdx7qHRJDXuUPnBEcn6es5kn2g-HDjgt1n_s5CD3_F13alBdR18--9dZlWV8qQmHg
categoryId: 172fa901-3f4b-4540-92f3-1c15820e8ec9
pictureId: 65b660b7-66bb-4e4a-a62c-fd0ca101f972
}