From 407b88114450a1c1e8cecb487448aa5afc52bafb Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Fri, 8 Dec 2023 13:38:42 +0100 Subject: [PATCH 1/9] added comment --- Documents/proto/general/openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 028edc6..43e9aba 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -1,3 +1,4 @@ +# hihi openapi: 3.0.0 info: title: ClydeAPI From 05fc134281f0059508a4851f418f13c81a6995b1 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Fri, 8 Dec 2023 17:17:40 +0100 Subject: [PATCH 2/9] Extension Article Scientifique ajout endpoint dans : secretariat, users, researcher ajout schemas : article --- Documents/proto/general/openapi.yaml | 165 ++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 5 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 43e9aba..5e0674a 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -1,4 +1,3 @@ -# hihi openapi: 3.0.0 info: title: ClydeAPI @@ -136,6 +135,7 @@ paths: summary: modifier les informations d'un utilisateur tags: - Admin + - Secretariat security: - bearer: [] requestBody: @@ -227,7 +227,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -268,7 +267,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -336,7 +334,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -356,7 +353,125 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' + + + + + + + +# Extension publication scientifique + + /article: + post: + summary: create an article + tags: + - Researcher + security: + - bearer : [] + responses: + "201" : + description: OK + '401': + $ref: '#/components/responses/UnauthorizedError' + requestBody: + required : true + content: + application/pdf: + schema: + type: string + format : binary + application/json: + schema: + type: object + properties: + acces: + type: string + summary: + type: string + language: + type: string + title: + type: string + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + views: + type: integer #TODO check comment envoyer fichier + json + /article/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary: get a certain article + tags: + - Users + security: + - bearer: [] + responses: + "201": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Article' + '401': + $ref: '#/components/responses/UnauthorizedError' + patch: + summary: modify an article + tags: + - Researcher + security: + - bearer : [] + responses: + "201": + description: article modifié + '401': + $ref: '#/components/responses/UnauthorizedError' + requestBody: + required : true + content: + application/pdf: + schema: + type: string + format : binary + application/json: + schema: + type: object + properties: + acces: + type: string + summary: + type: string + language: + type: string + title: + type: string + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + views: + type: integer + + delete: + summary: delete own article + tags: + - Researcher + security: + - bearer: [] + responses: + '201': + description: OK + '401': + $ref: '#/components/responses/UnauthorizedError' + + + + components: securitySchemes: bearer: @@ -418,7 +533,6 @@ components: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -449,6 +563,47 @@ components: "id": 42, "courses": ['Math', 'Info'] } + + Article: + type: object + properties: + articleId: + type: integer + acces : + type : string + pdf : + type : string + description : file location + summary: + type : string + language: + type : string + title : + type : string + date: + type : string + views : + type : integer + authors: + type: array + items: + $ref: '#/components/schemas/User' + description: first user is the author, the remaining users are co-authors + example: + { + "articleId": 42, + "acces": "private", + "pdf": "/articles/42", + "summary": "looks in details about graph's second theorem", + "language": "english", + "title": "graph's second theorem study", + "date":"2023-02-01", + "views": 420, + "authors" : [] + } + + + responses: UnauthorizedError: description: Permission non accordée From b00ab090797b8dbad7346f2c906cafcaa5bcd825 Mon Sep 17 00:00:00 2001 From: Wal Date: Sun, 10 Dec 2023 13:15:49 +0100 Subject: [PATCH 3/9] Gestion Horaire osamerilyabcp --- Documents/proto/general/openapi.yaml | 689 ++++++++++++++++++++++++--- 1 file changed, 630 insertions(+), 59 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 4c74faa..64fa70c 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -11,39 +11,108 @@ servers: paths: /ping: get: - summary: Test if the api is up. + summary: Check the API status responses: default: - description: Standard response to ping + description: pong content: text/plain: schema: type: string example: pong - /user: - put: - summary: create a new user + /users: + get: + summary: list all users tags: - - users + - SI security: - bearer: [] - responses: + parameters: + - in: query + name: type + required: false + schema: + type: string + enum: [teacher, student, secretary] + responses: '200': - description: User created + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" '401': $ref: '#/components/responses/UnauthorizedError' - /user/{mat}: + + /user: get: - summary: get user's info + summary: get informations about yourself tags: - - users + - Users responses: '200': - description: User found + description: Ok content: application/json: schema: $ref: "#/components/schemas/User" + post: + summary: Create user + tags: + - Users + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + LastName: + type: string + FirstName: + type: string + Email: + type: string + Address: + $ref: "#/components/schemas/Address" + BirthDate: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + example: + { + "LastName": "Doe" , + "FirstName": "John", + "Email": "John.Doe@example.com", + "Address": { + "Address": "Rue de Tournais 42", + "Country": "BE"}, + "BirthDate": "1941-02-22", + } + responses: + '201': + description: User created + '401': + $ref: '#/components/responses/UnauthorizedError' + patch: + summary: Change informations about yourself + tags: + - Users + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/User' + responses: + '201': + description: Successfully changed. + '401': + $ref: '#/components/responses/UnauthorizedError' + /user/{mat}: parameters: - name: mat in: path @@ -51,42 +120,459 @@ paths: required: true schema: type: integer - - /cursus/{id}: get: - summary: Voir les informations sur un Cursus + summary: Get user's informations + tags: + - Admin + responses: + '200': + description: User found + content: + application/json: + schema: + $ref: "#/components/schemas/User" + patch: + summary: Alter user's informations + tags: + - Admin + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/User' + responses: + '201': + description: Successfully changed + '401': + $ref: '#/components/responses/UnauthorizedError' + /course: + post: + summary: Create new course + tags: + - Courses + - Secretariat + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + type: string + courses: + type: array + items: + type: string + responses: + '201': + description: course created + '401': + $ref: '#/components/responses/UnauthorizedError' + /courses/{id}: + get: + summary: see courses informations tags: - Courses responses: '200': - description: Cursus found + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Course' + parameters: + - name: id + in: path + required: true + schema: + type: integer + delete: + summary: delete a course + tags: + - Courses + - Secretariat + security: + - bearer: [] + responses: + '201': + description: Success + '401': + $ref: '#/components/responses/UnauthorizedError' + patch: + summary: Change course options + tags: + - Secretariat + - Courses + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + type: string + credits: + type: integer + faculty: + type: string + teachers: + type: object + $ref: '#/components/schemas/User' + assistants: + type: array + items: + $ref: '#/components/schemas/User' + example: + { + "name": "Math pour l'info", + "credits": 11, + "faculty": "science", + "Teacher": , + "Assistants": [ ] + } + responses: + '201': + description: Course modified + '401': + $ref: '#/components/responses/UnauthorizedError' + + /cursus: + post: + summary: Create a cursus + tags: + - cursus + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + type: string + courses: + type: array + items: + type: integer + description: id of courses + example: + { + "name": "Bac1", + [] + } + responses: + '201': + description: Cursus created + '401': + $ref: '#/components/responses/UnauthorizedError' + /cursus/{id}: + get: + summary: See Cursus's informations + tags: + - cursus + responses: + '200': + description: OK content: application/json: schema: $ref: '#/components/schemas/Cursus' - /courses/{id}: - get: - summary: Voir les informations sur un cours* - tags: - - Courses - responses: - - put: - summary: Créer un nouveau cours - tags: - - Courses - security: - - bearer: [] - responses: - + parameters: + - name: id + in: path + required: true + schema: + type: integer delete: - summary: Suprimer un cours + summary: Delete cursus tags: - - Courses + - cursus security: - bearer: [] responses: - + '201': + description: Success + '401': + $ref: '#/components/responses/UnauthorizedError' + patch: + summary: Modify cursus + tags: + - cursus + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + type: string + credits: + type: integer + faculty: + type: string + teachers: + type: object + $ref: '#/components/schemas/User' + assistants: + type: array + items: + $ref: '#/components/schemas/User' + example: + { + "name": "Math pour l'info", + "credits": 11, + "faculty": "science", + "Teacher": , + "Assistants": [ ] + } + responses: + '201': + description: Cursus modified + '401': + $ref: '#/components/responses/UnauthorizedError' + + /lesson: + post: + summary: Create a new lesson + tags: + - Secretariat + - lesson + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + IDcourse: + type: integer + duration: + type: number + classroom: + type: string + responses: + '201': + description: Lesson created + '401': + $ref: '#/components/responses/UnauthorizedError' + /lesson/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary : See lesson's informations + tags: + - Users + - lesson + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Lesson' + patch: + summary : Modify Lesson + tags: + - Secretariat + - lesson + security: + - bearer: [] + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + IDcourse: + type: integer + duration: + type: number + classroom: + type: string + responses: + '201': + description: Lesson modified + '401': + $ref: '#/components/responses/UnauthorizedError' + + delete: + summary: Delete lesson + tags: + - lesson + - Secretariat + security: + - bearer: [] + responses: + '201': + description: Success + '401': + $ref: '#/components/responses/UnauthorizedError' + /request: + post: + summary: Create a new request + tags: + - Teacher + - request + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + id: + type: integer + requestType: + type: string + lessonId: + type: integer + responses: + '201': + description: Request created + /request/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary : See request information + tags: + - Teacher + - Secretariat + - request + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Request' + patch: + summary : Modify request + tags: + - Teacher + - request + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + id: + type: integer + requestType: + type: string + lessonId: + type: integer + responses: + '201': + description: Request modified + delete: + summary: Delete request + tags: + - Teacher + - Secretariat + - request + responses: + '201': + description: Success + + /display: + post: + summary: Create a new display + tags: + - display + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + id: + type: integer + time: + type: string + display: + type: string + userId: + type: integer + responses: + '201': + description: display created + + /display/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary : See display information + tags: + - Users + - display + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Display' + patch: + summary : Modify display + tags: + - Users + - display + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + id: + type: integer + time: + type: string + display: + type: string + userId: + type: integer + responses: + '201': + description: Display modified components: securitySchemes: @@ -97,54 +583,82 @@ components: User: type: object properties: - RegNo: + regNo: type: integer - Photo: + photo: type: object - LastName: + lastName: type: string - FirstName: + firstName: type: string - Email: + email: type: string - Address: + address: $ref: "#/components/schemas/Address" - BirthDate: + birthDate: type: string description: Follow the iso 8601 ("YYYY-MM-DD") - StaffMember: - type: boolean example: { - "RegNo": 42, - "LastName": "Doe" , - "FirstName": "John", - "Email": "John.Doe@example.com", - "Address": { - "Address": "Rue de Tounais 42", - "Country": "BE"}, - "BirthDate": "1941-02-22", - "StaffMember": true + "regNo": 42, + "lastName": "Doe" , + "firstName": "John", + "email": "John.Doe@example.com", + "address": { + "address": "Rue de Tounais 42", + "country": "BE"}, + "birthDate": "1941-02-22", + "staffMember": true, } Address: type: object properties: - Address: + address: type: string - Country: + country: type: string description: Follow the ISO-3166-1 alpha-2 standard. example: { - "Address": "Rue de Tounais 42", - "Country": "BE" + "address": "Rue de Tounais 42", + "country": "BE" + } + Course: + type: object + properties: + id: + type: integer + name: + type: string + credits: + type: integer + faculty: + type: string + teachers: + type: integer + description: user's id + assistants: + type: array + items: + type: integer + description: user's id + example: + { + "id": 42, + "name": "Math pour l'info", + "credits": 11, + "faculty": "science", + "Teacher": 42, + "Assistants": [ ] } Cursus: type: object properties: - Id: + id: type: integer - Courses: + name: + type: string + courses: type: array items: type: string @@ -153,6 +667,63 @@ components: "id": 42, "courses": ['Math', 'Info'] } + Lesson : + type: object + properties: + id: + type: integer + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + duration: + type: number + description: duration of a course in hours + classroom: + type: string + course: + $ref: "#/components/schemas/Course" + example: + { + "id": 12, + "date": "2023-12-01", + "duration": 1.5, + "classroom": "AMPHI01", + "course": } + Request: + type: object + properties: + id: + type: integer + requestType: + type: string + lessonId: + type: integer + example: + { + "id": 12, + "requestType": "delete", + "lessonId": 72 + } + Display: + type: object + properties: + id: + type: integer + time: + type: string + description: Define the period displayed on the schedule (week,month,quadrimester..) + display: + type: string + userId: + type: integer + description: Id of the user who owns this display + example: + { + "id": 12, + "time": "month", + "display": "grid", + "UserId": 12 + } responses: UnauthorizedError: - description: Access token is missing or invalid + description: Unauthorized access or missing bearer \ No newline at end of file From dc559cefeec9b83216c57087ae2b92af1dd37e38 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Mon, 11 Dec 2023 11:27:34 +0100 Subject: [PATCH 4/9] added the Ext (scientific articles) tag --- Documents/proto/general/openapi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 06bb2ff..f1acf19 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -148,6 +148,7 @@ paths: - General - Admin - Secretariat + - Ext (scientific articles) security: - bearer: [] requestBody: @@ -377,6 +378,7 @@ paths: post: summary: create an article tags: + - Ext (scientific articles) - Researcher security: - bearer : [] @@ -420,6 +422,7 @@ paths: summary: get a certain article tags: - Users + - Ext (scientific articles) security: - bearer: [] responses: @@ -436,6 +439,7 @@ paths: summary: modify an article tags: - Researcher + - Ext (scientific articles) security: - bearer : [] responses: @@ -472,6 +476,7 @@ paths: summary: delete own article tags: - Researcher + - Ext (scientific articles) security: - bearer: [] responses: From 87d00943c0cf42c8058a53257807b3ca78ea1e77 Mon Sep 17 00:00:00 2001 From: Wawilski Date: Mon, 11 Dec 2023 11:31:34 +0100 Subject: [PATCH 5/9] Adding Ext (Schedule) --- Documents/proto/general/openapi.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 621e382..97f0cf8 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -378,6 +378,7 @@ paths: tags: - Secretariat - lesson + - Ext (Schedule) security: - bearer: [] requestBody: @@ -413,6 +414,7 @@ paths: tags: - Users - lesson + - Ext (Schedule) responses: '200': description: OK @@ -425,6 +427,7 @@ paths: tags: - Secretariat - lesson + - Ext (Schedule) security: - bearer: [] requestBody: @@ -454,6 +457,7 @@ paths: tags: - lesson - Secretariat + - Ext (Schedule) security: - bearer: [] responses: @@ -467,6 +471,7 @@ paths: tags: - Teacher - request + - Ext (Schedule) requestBody: required: true content: @@ -496,6 +501,7 @@ paths: - Teacher - Secretariat - request + - Ext (Schedule) responses: '200': description: OK @@ -508,6 +514,7 @@ paths: tags: - Teacher - request + - Ext (Schedule) requestBody: required: true content: @@ -530,6 +537,7 @@ paths: - Teacher - Secretariat - request + - Ext (Schedule) responses: '201': description: Success @@ -539,6 +547,7 @@ paths: summary: Create a new display tags: - display + - Ext (Schedule) requestBody: required: true content: @@ -570,6 +579,7 @@ paths: tags: - Users - display + - Ext (Schedule) responses: '200': description: OK @@ -582,6 +592,7 @@ paths: tags: - Users - display + - Ext (Schedule) requestBody: required: true content: From 93ec63beae19f8ecef00391531078821ffa16767 Mon Sep 17 00:00:00 2001 From: Wal Date: Mon, 11 Dec 2023 14:13:37 +0100 Subject: [PATCH 6/9] Modify Request --- Documents/proto/general/openapi.yaml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 97f0cf8..90f59a2 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -508,7 +508,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Request' + $ref: '#/components/schemas/ScheduleRequest' patch: summary : Modify request tags: @@ -727,7 +727,7 @@ components: "duration": 1.5, "classroom": "AMPHI01", "course": } - Request: + ScheduleRequest: type: object properties: id: @@ -736,12 +736,29 @@ components: type: string lessonId: type: integer + description: In the ADD case, lessonId is null + teacherId: + type: integer + newDate: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + newClassroom: + type: string + newCourse: + type: string + description: In the ADD case, correspond to the name of the course to add + example: { "id": 12, - "requestType": "delete", - "lessonId": 72 + "requestType": "moveLesson", + "lessonId": 52, + "teacherId": 12, + "newDate": "2023-12-20", + "newClassroom":, + "newCourse":, } + Display: type: object properties: From ffc8682453345559e7d4df64efa7f5f97ba946fa Mon Sep 17 00:00:00 2001 From: Wal Date: Tue, 12 Dec 2023 11:39:18 +0100 Subject: [PATCH 7/9] =?UTF-8?q?Modification=20via=20les=20r=C3=A9visions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documents/proto/general/openapi.yaml | 105 ++++++++++++--------------- 1 file changed, 48 insertions(+), 57 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 90f59a2..187f3d3 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -57,13 +57,6 @@ paths: - Users security: - bearer: [] - parameters: - - in: query - name: type - required: false - schema: - type: string - enum: [teacher, student, secretary] responses: '200': description: Ok @@ -248,7 +241,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -352,7 +344,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -377,7 +368,7 @@ paths: summary: Create a new lesson tags: - Secretariat - - lesson + - Lesson - Ext (Schedule) security: - bearer: [] @@ -391,7 +382,7 @@ paths: date: type: string description: Follow the iso 8601 ("YYYY-MM-DD") - IDcourse: + CourseId: type: integer duration: type: number @@ -413,7 +404,7 @@ paths: summary : See lesson's informations tags: - Users - - lesson + - Lesson - Ext (Schedule) responses: '200': @@ -426,7 +417,7 @@ paths: summary : Modify Lesson tags: - Secretariat - - lesson + - Lesson - Ext (Schedule) security: - bearer: [] @@ -455,7 +446,7 @@ paths: delete: summary: Delete lesson tags: - - lesson + - Lesson - Secretariat - Ext (Schedule) security: @@ -465,12 +456,12 @@ paths: description: Success '401': $ref: '#/components/responses/UnauthorizedError' - /request: + /scheduleRequest: post: summary: Create a new request tags: - Teacher - - request + - ScheduleRequest - Ext (Schedule) requestBody: required: true @@ -479,16 +470,24 @@ paths: schema: type: object properties: - id: - type: integer requestType: type: string lessonId: type: integer + newDate: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + newClassroom: + type: string + newCourseId: + type: integer responses: '201': description: Request created - /request/{id}: + '401': + $ref: '#/components/responses/UnauthorizedError' + + /scheduleRequest/{id}: parameters: - name: id in: path @@ -500,7 +499,7 @@ paths: tags: - Teacher - Secretariat - - request + - ScheduleRequest - Ext (Schedule) responses: '200': @@ -513,7 +512,7 @@ paths: summary : Modify request tags: - Teacher - - request + - ScheduleRequest - Ext (Schedule) requestBody: required: true @@ -522,11 +521,11 @@ paths: schema: type: object properties: - id: - type: integer - requestType: + newDate: type: string - lessonId: + newClassroom: + type: string + newCourseId: type: integer responses: '201': @@ -536,7 +535,7 @@ paths: tags: - Teacher - Secretariat - - request + - ScheduleRequest - Ext (Schedule) responses: '201': @@ -546,7 +545,7 @@ paths: post: summary: Create a new display tags: - - display + - Display - Ext (Schedule) requestBody: required: true @@ -555,11 +554,9 @@ paths: schema: type: object properties: - id: - type: integer - time: + timeMode: type: string - display: + displayMode: type: string userId: type: integer @@ -578,7 +575,7 @@ paths: summary : See display information tags: - Users - - display + - Display - Ext (Schedule) responses: '200': @@ -591,7 +588,7 @@ paths: summary : Modify display tags: - Users - - display + - Display - Ext (Schedule) requestBody: required: true @@ -600,14 +597,10 @@ paths: schema: type: object properties: - id: - type: integer - time: + timeMode: type: string - display: + displayMode: type: string - userId: - type: integer responses: '201': description: Display modified @@ -718,15 +711,16 @@ components: description: duration of a course in hours classroom: type: string - course: - $ref: "#/components/schemas/Course" + courseId: + type: integer example: - { - "id": 12, - "date": "2023-12-01", - "duration": 1.5, - "classroom": "AMPHI01", - "course": } + { + "id": 12, + "date": "2023-12-01", + "duration": 1.5, + "classroom": "AMPHI01", + "courseId": 12 + } ScheduleRequest: type: object properties: @@ -736,7 +730,6 @@ components: type: string lessonId: type: integer - description: In the ADD case, lessonId is null teacherId: type: integer newDate: @@ -744,10 +737,8 @@ components: description: Follow the iso 8601 ("YYYY-MM-DD") newClassroom: type: string - newCourse: - type: string - description: In the ADD case, correspond to the name of the course to add - + newCourseId: + type: integer example: { "id": 12, @@ -756,7 +747,7 @@ components: "teacherId": 12, "newDate": "2023-12-20", "newClassroom":, - "newCourse":, + "newCourseId":, } Display: @@ -764,10 +755,10 @@ components: properties: id: type: integer - time: + timeMode: type: string description: Define the period displayed on the schedule (week,month,quadrimester..) - display: + displayMode: type: string userId: type: integer @@ -775,8 +766,8 @@ components: example: { "id": 12, - "time": "month", - "display": "grid", + "timeMode": "month", + "displayMode": "grid", "UserId": 12 } responses: From 67552901d6e5b6311d290a2248a420b9d9591cf4 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Tue, 12 Dec 2023 14:36:15 +0100 Subject: [PATCH 8/9] ajout Display-Article (et Mat -> RegNo) --- Documents/proto/general/openapi.yaml | 115 ++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 19 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index f1acf19..7a25336 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -122,11 +122,11 @@ paths: description: Successfully changed. '401': $ref: '#/components/responses/UnauthorizedError' - /user/{mat}: + /user/{RegNo}: parameters: - - name: mat + - name: RegNo in: path - description: Matricule of the user (unique id) + description: Regestration number of the user (unique id) required: true schema: type: integer @@ -390,15 +390,14 @@ paths: requestBody: required : true content: - application/pdf: - schema: - type: string - format : binary application/json: schema: type: object properties: - acces: + pdf: + type: string + description : the B64 version encoding of the pdf file + access: type: string summary: type: string @@ -410,7 +409,19 @@ paths: type: string description: Follow the iso 8601 ("YYYY-MM-DD") views: - type: integer #TODO check comment envoyer fichier + json + type: integer + example: + { + "access": "private", + "pdf": " *the b64 encoding of the pdf* ", + "summary": "looks in details about graph's second theorem", + "language": "english", + "title": "graph's second theorem study", + "date":"2023-02-01", + "views": 420, + "authors" : [] + } + /article/{id}: parameters: - name: id @@ -450,15 +461,14 @@ paths: requestBody: required : true content: - application/pdf: - schema: - type: string - format : binary application/json: schema: type: object properties: - acces: + pdf: + type: string + description : the B64 version encoding of the pdf file + access: type: string summary: type: string @@ -471,6 +481,18 @@ paths: description: Follow the iso 8601 ("YYYY-MM-DD") views: type: integer + example: + { + "access": "public", + "pdf": " *the new b64 encoding of the pdf* ", + "summary": "looks in details about the duck's algorithm problem", + "language": "english", + "title": "duck's algorithm problem solving", + "date":"2023-02-01", + "views": 10, + "authors" : [] + } + delete: summary: delete own article @@ -485,8 +507,39 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' - - + /Display-Article: + parameters: + - in: query + name: author + required: false + schema: + type: string + - in: query + name: access + required: false + schema: + type: string + enum: [public, restricted, private] + - in: query + name: name + required: false + schema: + type: string + + get: + summary: get a list of article's data + tags: + - Users + - Ext (scientific articles) + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Display-Article" components: securitySchemes: @@ -587,7 +640,7 @@ components: properties: articleId: type: integer - acces : + access : type : string pdf : type : string @@ -610,7 +663,7 @@ components: example: { "articleId": 42, - "acces": "private", + "access": "private", "pdf": "/articles/42", "summary": "looks in details about graph's second theorem", "language": "english", @@ -619,9 +672,33 @@ components: "views": 420, "authors" : [] } - + Display-Article: + type: object + properties: + articleId: + type: integer + access: + type: string + summary: + type: string + title: + type: string + author: + type: string + items: + $ref: '#/components/schemas/User' + example: + { + "articleId": 42, + "access": "private", + "summary": "looks in details about graph's second theorem", + "title": "graph's second theorem study", + "author" : "john doe" + } responses: UnauthorizedError: description: Unauthorized access or missing bearer + + From c807568689a9069beaba2cdde987c7cd386589eb Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Wed, 13 Dec 2023 14:41:07 +0100 Subject: [PATCH 9/9] Dispay-Article -> DisplayArticle --- Documents/proto/general/openapi.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 7a25336..7081464 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -507,7 +507,7 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' - /Display-Article: + /DisplayArticle: parameters: - in: query name: author @@ -539,7 +539,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/Display-Article" + $ref: "#/components/schemas/DisplayArticle" components: securitySchemes: @@ -672,7 +672,7 @@ components: "views": 420, "authors" : [] } - Display-Article: + DisplayArticle: type: object properties: articleId: @@ -702,3 +702,4 @@ components: description: Unauthorized access or missing bearer +