Merge pull request 'Ext_publiScientifique' (#5) from Ext_publiScientifique into master
Reviewed-on: PGL/Clyde#5 Reviewed-by: LeoMoulin <leomoulin125@gmail.com> Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com> Reviewed-by: Wal <karpinskiwal@gmail.com>
This commit is contained in:
		| @ -122,11 +122,11 @@ paths: | |||||||
|           description: Successfully changed.  |           description: Successfully changed.  | ||||||
|         '401': |         '401': | ||||||
|           $ref: '#/components/responses/UnauthorizedError' |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|   /user/{mat}: |   /user/{RegNo}: | ||||||
|     parameters: |     parameters: | ||||||
|       - name: mat |       - name: RegNo | ||||||
|         in: path |         in: path | ||||||
|         description: Matricule of the user (unique id) |         description: Regestration number of the user (unique id) | ||||||
|         required: true |         required: true | ||||||
|         schema: |         schema: | ||||||
|           type: integer |           type: integer | ||||||
| @ -147,6 +147,8 @@ paths: | |||||||
|       tags: |       tags: | ||||||
|         - General |         - General | ||||||
|         - Admin |         - Admin | ||||||
|  |         - Secretariat | ||||||
|  |         - Ext (scientific articles) | ||||||
|       security: |       security: | ||||||
|         - bearer: [] |         - bearer: [] | ||||||
|       requestBody: |       requestBody: | ||||||
| @ -188,6 +190,12 @@ paths: | |||||||
|         '401': |         '401': | ||||||
|           $ref: '#/components/responses/UnauthorizedError' |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|   /courses/{id}: |   /courses/{id}: | ||||||
|  |     parameters: | ||||||
|  |       - name: id | ||||||
|  |         in: path | ||||||
|  |         required: true | ||||||
|  |         schema: | ||||||
|  |           type: integer | ||||||
|     get: |     get: | ||||||
|       summary: see courses informations  |       summary: see courses informations  | ||||||
|       tags: |       tags: | ||||||
| @ -200,12 +208,7 @@ paths: | |||||||
|             application/json: |             application/json: | ||||||
|               schema: |               schema: | ||||||
|                 $ref: '#/components/schemas/Course' |                 $ref: '#/components/schemas/Course' | ||||||
|     parameters: |  | ||||||
|       - name: id |  | ||||||
|         in: path |  | ||||||
|         required: true |  | ||||||
|         schema: |  | ||||||
|           type: integer |  | ||||||
|     delete: |     delete: | ||||||
|       summary: delete a course  |       summary: delete a course  | ||||||
|       tags: |       tags: | ||||||
| @ -265,7 +268,7 @@ paths: | |||||||
|       summary: Create a cursus |       summary: Create a cursus | ||||||
|       tags: |       tags: | ||||||
|         - General |         - General | ||||||
|         - cursus |         - Cursus | ||||||
|       security:  |       security:  | ||||||
|         - bearer: [] |         - bearer: [] | ||||||
|       requestBody: |       requestBody: | ||||||
| @ -297,7 +300,7 @@ paths: | |||||||
|       summary: See Cursus's informations  |       summary: See Cursus's informations  | ||||||
|       tags: |       tags: | ||||||
|         - General |         - General | ||||||
|         - cursus |         - Cursus | ||||||
|       responses: |       responses: | ||||||
|         '200': |         '200': | ||||||
|           description: OK |           description: OK | ||||||
| @ -315,7 +318,7 @@ paths: | |||||||
|       summary: Delete cursus |       summary: Delete cursus | ||||||
|       tags: |       tags: | ||||||
|         - General |         - General | ||||||
|         - cursus |         - Cursus | ||||||
|       security:  |       security:  | ||||||
|         - bearer: [] |         - bearer: [] | ||||||
|       responses: |       responses: | ||||||
| @ -327,7 +330,7 @@ paths: | |||||||
|       summary: Modify cursus  |       summary: Modify cursus  | ||||||
|       tags: |       tags: | ||||||
|         - General |         - General | ||||||
|         - cursus |         - Cursus | ||||||
|       security: |       security: | ||||||
|         - bearer: [] |         - bearer: [] | ||||||
|       requestBody: |       requestBody: | ||||||
| @ -363,9 +366,10 @@ paths: | |||||||
|         '401': |         '401': | ||||||
|           $ref: '#/components/responses/UnauthorizedError' |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|            |            | ||||||
|  |               | ||||||
|   /lesson: |   /lesson: | ||||||
|     post: |     post: | ||||||
|       summary: Create a new lesson |       summary: create a new lesson | ||||||
|       tags: |       tags: | ||||||
|         - Secretariat |         - Secretariat | ||||||
|         - Lesson |         - Lesson | ||||||
| @ -604,6 +608,173 @@ paths: | |||||||
|       responses: |       responses: | ||||||
|         '201': |         '201': | ||||||
|           description: Display modified |           description: Display modified | ||||||
|  |  # Extension publication scientifique  | ||||||
|  |  | ||||||
|  |   /article: | ||||||
|  |     post: | ||||||
|  |       summary: create an article | ||||||
|  |       tags: | ||||||
|  |         - Ext (scientific articles) | ||||||
|  |         - Researcher | ||||||
|  |       security: | ||||||
|  |         - bearer : [] | ||||||
|  |       responses: | ||||||
|  |         "201" :  | ||||||
|  |           description: OK | ||||||
|  |         '401': | ||||||
|  |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|  |       requestBody: | ||||||
|  |         required : true | ||||||
|  |         content:  | ||||||
|  |           application/json: | ||||||
|  |             schema: | ||||||
|  |               type: object | ||||||
|  |               properties: | ||||||
|  |                 pdf: | ||||||
|  |                   type: string  | ||||||
|  |                   description : the B64 version encoding of the pdf file | ||||||
|  |                 access: | ||||||
|  |                   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  | ||||||
|  |             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 | ||||||
|  |         in: path | ||||||
|  |         required: true | ||||||
|  |         schema: | ||||||
|  |           type: integer | ||||||
|  |     get: | ||||||
|  |       summary: get a certain article | ||||||
|  |       tags: | ||||||
|  |         - Users | ||||||
|  |         - Ext (scientific articles) | ||||||
|  |       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 | ||||||
|  |         - Ext (scientific articles) | ||||||
|  |       security: | ||||||
|  |         - bearer : [] | ||||||
|  |       responses: | ||||||
|  |         "201":  | ||||||
|  |           description: article modifié | ||||||
|  |         '401': | ||||||
|  |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|  |       requestBody: | ||||||
|  |         required : true | ||||||
|  |         content:  | ||||||
|  |           application/json: | ||||||
|  |             schema: | ||||||
|  |               type: object | ||||||
|  |               properties: | ||||||
|  |                 pdf: | ||||||
|  |                   type: string  | ||||||
|  |                   description : the B64 version encoding of the pdf file | ||||||
|  |                 access: | ||||||
|  |                   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 | ||||||
|  |               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 | ||||||
|  |       tags: | ||||||
|  |         - Researcher | ||||||
|  |         - Ext (scientific articles) | ||||||
|  |       security:  | ||||||
|  |         - bearer: [] | ||||||
|  |       responses: | ||||||
|  |         '201': | ||||||
|  |           description: OK | ||||||
|  |         '401': | ||||||
|  |           $ref: '#/components/responses/UnauthorizedError' | ||||||
|  |        | ||||||
|  |   /DisplayArticle: | ||||||
|  |       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/DisplayArticle" | ||||||
|  |  | ||||||
| components: | components: | ||||||
|   securitySchemes: |   securitySchemes: | ||||||
| @ -698,6 +869,66 @@ components: | |||||||
|         "id": 42, |         "id": 42, | ||||||
|         "courses": ['Math', 'Info'] |         "courses": ['Math', 'Info'] | ||||||
|         } |         } | ||||||
|  |     Article: | ||||||
|  |       type: object | ||||||
|  |       properties: | ||||||
|  |         articleId:  | ||||||
|  |           type: integer | ||||||
|  |         access : | ||||||
|  |           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, | ||||||
|  |         "access": "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" : [] | ||||||
|  |         } | ||||||
|  |     DisplayArticle:    | ||||||
|  |       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" | ||||||
|  |         } | ||||||
|     Lesson : |     Lesson : | ||||||
|       type: object |       type: object | ||||||
|       properties: |       properties: | ||||||
| @ -773,3 +1004,7 @@ components: | |||||||
|   responses: |   responses: | ||||||
|     UnauthorizedError: |     UnauthorizedError: | ||||||
|       description: Unauthorized access or missing bearer  |       description: Unauthorized access or missing bearer  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user