589 Commits

Author SHA1 Message Date
d21655c535 fix max's scroll issue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 30s
2024-04-22 10:25:07 +02:00
490bf403f0 Merge pull request 'Add the regNo in profile and aboutStudent' (#178) from regNoFix into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 33s
deploy to production / deploy-backend (push) Successful in 18s
Build and test FrontEnd / Build-frontend (push) Successful in 29s
Reviewed-on: #178
2024-04-22 09:52:56 +02:00
c61a092809 Add the regNo in profile and aboutStudent
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m23s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-04-22 09:39:48 +02:00
2cffe28720 show regno on options
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 33s
deploy to production / deploy-backend (push) Successful in 18s
Build and test FrontEnd / Build-frontend (push) Successful in 30s
2024-04-22 09:22:19 +02:00
060526c20d timer on notifications
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m30s
deploy to production / deploy-frontend (push) Successful in 32s
deploy to production / deploy-backend (push) Successful in 18s
Build and test FrontEnd / Build-frontend (push) Successful in 30s
2024-04-22 09:09:53 +02:00
af8bc8872d Merge pull request 'fix with the stats and translations' (#177) from Maxime/Clyde:master into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m29s
deploy to production / deploy-frontend (push) Successful in 34s
deploy to production / deploy-backend (push) Successful in 58s
Build and test FrontEnd / Build-frontend (push) Successful in 31s
Reviewed-on: #177
2024-04-22 02:28:41 +02:00
12ff43e970 fix with the stats and translations
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m26s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 33s
2024-04-22 02:27:21 +02:00
82cf7cbfaf removing apps spacing
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m28s
deploy to production / deploy-frontend (push) Successful in 32s
deploy to production / deploy-backend (push) Successful in 18s
Build and test FrontEnd / Build-frontend (push) Successful in 29s
2024-04-22 01:46:46 +02:00
3b63896439 Merge pull request 'tonitch/front/bar' (#176) from tonitch/front/bar into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 33s
deploy to production / deploy-backend (push) Successful in 18s
Build and test FrontEnd / Build-frontend (push) Successful in 31s
Reviewed-on: #176
2024-04-22 01:39:48 +02:00
bd3b03dfea Merge pull request 'ok last one I promise' (#175) from prank into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m28s
deploy to production / deploy-frontend (push) Successful in 34s
deploy to production / deploy-backend (push) Successful in 19s
Build and test FrontEnd / Build-frontend (push) Successful in 30s
Reviewed-on: #175
2024-04-22 00:55:40 +02:00
b38b1ab6b8 Merge branch 'master' into prank
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m26s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-04-22 00:51:58 +02:00
6e0a9a46e5 ok last one I promise
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 31s
2024-04-22 00:50:44 +02:00
2d8fcb4712 Merge pull request 'Fixing some little bugs and details' (#174) from last into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m28s
deploy to production / deploy-frontend (push) Successful in 34s
deploy to production / deploy-backend (push) Successful in 1m0s
Build and test FrontEnd / Build-frontend (push) Successful in 31s
Reviewed-on: #174
2024-04-22 00:42:56 +02:00
fcb48ac71a Fixing some little bugs and details
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m27s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 33s
2024-04-22 00:39:17 +02:00
043f5c87d2 fixup! fix bar height
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m26s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 31s
2024-04-22 00:12:59 +02:00
a03983d625 fix bar height 2024-04-22 00:09:39 +02:00
b382bf957f Merge pull request 'master' (#173) from Maxime/Clyde:master into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m27s
deploy to production / deploy-frontend (push) Successful in 33s
deploy to production / deploy-backend (push) Successful in 1m2s
Build and test FrontEnd / Build-frontend (push) Successful in 31s
Reviewed-on: #173
2024-04-22 00:06:59 +02:00
bbddcb26ad fixup! Merge pull request 'Notifications on Schedule' (#172) from NotificationSchedule into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m26s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 54s
Build and test FrontEnd / Build-frontend (push) Has been cancelled
2024-04-22 00:03:45 +02:00
22665f0565 oupsi
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-04-21 23:57:29 +02:00
d324d7447d fixing my dumb merge
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m38s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 33s
2024-04-21 23:55:07 +02:00
Wal
71c2af7fcb Merge pull request 'Notifications on Schedule' (#172) from NotificationSchedule into master
Some checks failed
Build and test backend / Build-backend (push) Failing after 1m24s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 42s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #172
2024-04-21 23:39:29 +02:00
c717205764 Notifications Schedule
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m29s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-04-21 23:36:25 +02:00
4d007534b3 Merge remote-tracking branch 'origin/master'
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m19s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 23s
2024-04-21 23:34:19 +02:00
8ac1f7ed8b notifications forum
Some checks failed
Build and test backend / Build-backend (push) Failing after 1m26s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 43s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-04-21 23:25:03 +02:00
1a266cdfbd post User by secretary 2024-04-21 23:14:56 +02:00
32810a9b01 Merge pull request 'oof' (#171) from oof into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 16s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #171
2024-04-21 23:09:52 +02:00
217ad7f0d1 oof
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-21 23:07:04 +02:00
2d20b45c3a Merge pull request 'Better login' (#170) from betterlogin into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Successful in 57s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #170
2024-04-21 22:35:20 +02:00
9cbdaac09d Better login
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-21 22:31:56 +02:00
a90243f4b9 fix register
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m30s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Successful in 53s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-04-21 22:16:08 +02:00
Wal
636e17b4bf Merge pull request 'Add Course to Curriculum' (#169) from AddBranchToCurriculum into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 29s
deploy to production / deploy-backend (push) Successful in 58s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #169
2024-04-21 21:56:14 +02:00
9cd54bdae9 Merge remote-tracking branch 'origin/master' into AddBranchToCurriculum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-21 21:51:14 +02:00
69be9681ff Add course to Curriculum 2024-04-21 21:50:38 +02:00
98082f34b7 Merge pull request 'tonitch/feat/notifications' (#159) from tonitch/feat/notifications into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Successful in 56s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #159
2024-04-21 20:19:47 +02:00
43883caef0 Merge remote-tracking branch 'origin/master' into tonitch/feat/notifications
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-21 20:19:17 +02:00
88b057e19d Merge branch 'master' into tonitch/feat/notifications 2024-04-21 20:16:07 +02:00
260191d790 archiving
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m28s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-21 20:15:47 +02:00
608b6e4893 added reesearcher manager for secretary 2024-04-21 20:07:21 +02:00
05ed28626a Add course to a curriculum when created 2024-04-21 19:55:39 +02:00
Wal
ca10084400 Merge pull request 'Merge Schedule Extension to Master' (#168) from Wal/Clyde:master into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Successful in 1m0s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #168
2024-04-21 19:17:09 +02:00
fa1a2c6d3b Final commit
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-04-21 19:13:03 +02:00
4485dbf803 READY TO PR FINAL
Some checks failed
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
Build and test backend / Build-backend (pull_request) Failing after 1m20s
2024-04-21 18:56:49 +02:00
b52c50fd76 Merge pull request 'Final commit of the extension' (#167) from Inscription into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 59s
Build and test FrontEnd / Build-frontend (push) Successful in 28s
Reviewed-on: #167
2024-04-21 18:48:56 +02:00
172837d6d1 ready to PR 2024-04-21 18:46:54 +02:00
9a5115f7fe Final commit of the extension
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m23s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-21 18:24:58 +02:00
0d6b4ec57c Merge remote-tracking branch 'origin/master' 2024-04-21 18:10:41 +02:00
e0a3a618a1 Final Schedule - merge 2024-04-21 18:10:00 +02:00
0b9227a822 indev
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 17:42:49 +02:00
f14d41f04d je sais vraiment pas ce que j'ai ajouté mais amélioration jt'e jure
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 17:42:29 +02:00
76dcea186c added ProfilePicture handling 2024-04-21 17:07:15 +02:00
a79f23fed0 added patch coAuthors 2024-04-21 15:10:17 +02:00
43f3d66eb9 fixup! fix port
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 12s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
2024-04-21 11:02:51 +02:00
e25ead6230 fix port
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m29s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Failing after 9s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
2024-04-21 10:58:38 +02:00
70bec1a934 Merge branch 'master' into tonitch/feat/notifications
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 10:35:07 +02:00
0837cc800a fixup! fixup! typo
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 1m8s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
2024-04-21 10:33:33 +02:00
30f04b736b fixup! typo
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 2m16s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-04-21 10:18:49 +02:00
f83e689e4d typo
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Failing after 1m28s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-04-21 10:14:19 +02:00
29f13c3a3b fixing backend deploy
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m22s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Failing after 1m29s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
2024-04-21 09:57:13 +02:00
33eb5c0f0c Merge pull request 'Forum for messaging extension' (#157) from tonitch/Clyde:forum into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Failing after 2m6s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #157
2024-04-21 09:44:25 +02:00
0621c6fe68 finish
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 09:46:46 +02:00
ecaf5e3df8 Merge remote-tracking branch 'origin/master' into forum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m26s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 09:04:58 +02:00
846cdedc4b Merge pull request 'Translation of the student inscription extension and profile' (#166) from StudentInscription into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m26s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m5s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #166
2024-04-21 03:14:54 +02:00
881c935c00 Merge branch 'master' into StudentInscription
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-21 03:10:49 +02:00
e8bf0d953d Translation of the student inscription extension and profile
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-21 03:08:27 +02:00
219165aacf final translation and documentation 2024-04-21 01:37:30 +02:00
bc87748b31 Merge master part1 2024-04-21 00:10:33 +02:00
8097f5314f Merge pull request 'Implement an endpoint to get all the courses of an user' (#165) from CoursesEndpoint into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m6s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #165
2024-04-20 23:32:03 +02:00
1e2efac5bc Implement an endpoint to get all the courses of an user
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m21s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-20 23:29:22 +02:00
061f329020 Merge pull request 'Removing toaster at every request' (#160) from tonitch/del/toast into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m26s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 2m7s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #160
2024-04-20 21:23:55 +02:00
892d4f0651 Merge pull request 'Leo/InscriptionDesEtudiants' (#164) from Leo/InscriptionDesEtudiants into master
Some checks failed
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 1m29s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Has been cancelled
Reviewed-on: #164
2024-04-20 21:21:13 +02:00
9e45e6a9c9 Merge branch 'master' into Leo/InscriptionDesEtudiants
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m23s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-20 21:18:49 +02:00
ef03a6bdca Reworking, patching and cleaning the extension
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 3m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-20 21:12:17 +02:00
f081b7206f cleaning frontend 2024-04-20 19:56:07 +02:00
7cdbf6de74 Merge remote-tracking branch 'origin/master' 2024-04-20 19:30:19 +02:00
be23c3ab91 FINAL WITHOUT CLEAN 2024-04-20 19:30:01 +02:00
54d19eb888 added Co Author 2024-04-20 19:07:27 +02:00
e8917cd69e Small changes 2024-04-20 13:17:32 +02:00
cdc3772384 Small changes 2024-04-20 12:42:41 +02:00
e8fea7625f Removing toaster at every request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m19s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
It is possible to explicitly request a toaster for a request by setting
its config['toast'] to true
2024-04-20 10:05:01 +02:00
041fe7f95d filter and abstraction of researchList 2024-04-20 01:12:37 +02:00
0ffc8077db Requests Functionnal 2024-04-19 23:59:30 +02:00
bd1c236635 Request and changes 2024-04-19 21:29:45 +02:00
c15ddccbb0 Merge pull request 'Leo/InscriptionDesEtudiants' (#163) from Leo/InscriptionDesEtudiants into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 2m2s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #163
2024-04-19 20:44:55 +02:00
211bf77322 Merge pull request 'master' (#162) from master into Leo/InscriptionDesEtudiants
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
Reviewed-on: #162
2024-04-19 20:40:58 +02:00
3ca074a3ba typo
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m20s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-19 20:35:16 +02:00
7bb1df123f Merge remote-tracking branch 'origin/master' into forum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-19 20:33:52 +02:00
6077e65b50 added v-if to bibtex download 2024-04-19 19:54:51 +02:00
92cdeaebba Merge remote-tracking branch 'origin/master' into Leo/InscriptionDesEtudiants 2024-04-19 19:25:42 +02:00
4e14370d4f Add the exemptions gestion and improve the navigation between requests 2024-04-19 19:25:28 +02:00
10c1c6096d const error fix
Some checks failed
Build and test backend / Build-backend (push) Successful in 2m39s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Failing after 2m8s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
This error seems to be there for quite some times. for some reason I
haven't seen it at all. I tried to bisect it and couldn't find the
origin so I just fix it in this commit
2024-04-19 18:04:21 +02:00
be7f42aafe fixed POST addview 2024-04-19 17:37:59 +02:00
e998fb2ab4 aled 2024-04-19 17:13:15 +02:00
69fb4e881e Add the Teacher approval for reregister requests 2024-04-19 15:53:31 +02:00
a168d41aee link listResearchers to ResearcherProfile 2024-04-19 12:35:07 +02:00
25575fa4e0 Implements some files uploading in the inscription form and change inscriptionRequest and Curriculum for the cursus acceptance attestation feature 2024-04-19 12:26:48 +02:00
5a57fc78f3 Generalize the ExternalCurriculumList interface so it fits for inscriptionRequest, Studentlist, and inscriptionform 2024-04-19 09:31:55 +02:00
70a8e98a0e Merge pull request 'Leo/InscriptionDesEtudiant' (#161) from Leo/InscriptionDesEtudiant into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m27s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m5s
Build and test FrontEnd / Build-frontend (push) Successful in 29s
Reviewed-on: #161
2024-04-18 21:43:47 +02:00
a9e52d34d4 Start the rework of externalCurriculum interface
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-18 21:35:50 +02:00
3f4f6ed49a added List researches Backend 2024-04-18 18:34:52 +02:00
fed567e9ab added ListResearch App 2024-04-18 17:17:29 +02:00
14c5423328 moved getFile() and no download when managing 2024-04-18 16:47:25 +02:00
7394a23b45 added reactivity to post delete and patch 2024-04-18 16:17:16 +02:00
939b4f5492 Manage ResearcherProfile 2024-04-18 14:53:17 +02:00
da2c0f472d added BibTex File Type 2024-04-18 14:39:57 +02:00
8a5a26e2ab Add the management of changeCurriculum requests 2024-04-18 14:09:06 +02:00
c9556e1eea Merge remote-tracking branch 'origin/master' into Leo/InscriptionDesEtudiant
# Conflicts:
#	backend/src/main/java/ovh/herisson/Clyde/EndPoints/MockController.java
#	backend/src/main/java/ovh/herisson/Clyde/Services/Inscription/InscriptionService.java
#	backend/src/main/java/ovh/herisson/Clyde/Tables/User.java
2024-04-18 10:46:45 +02:00
78507f798f Merge remote-tracking branch 'origin/master' into Leo/InscriptionDesEtudiant 2024-04-18 10:36:09 +02:00
f9b12a5061 Merge pull request 'Implements the RegNo feature' (#158) from Leo/masterRegNo into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m26s
deploy to production / deploy-frontend (push) Successful in 29s
deploy to production / deploy-backend (push) Failing after 2m8s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #158
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-04-18 10:32:24 +02:00
8724748642 Merge branch 'master' into Leo/masterRegNo
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m23s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-18 10:30:01 +02:00
dff225b0f5 Removing toaster at every request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
It is possible to explicitly request a toaster for a request by setting
its config['toast'] to true
2024-04-18 08:48:40 +02:00
f8d60f40fc Removing toaster at every request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
It is possible to explicitly request a toaster for a request by setting
its config['toast'] to true
2024-04-18 08:32:06 +02:00
3281bf1d7e patch Researcher Profile and researches 2024-04-17 23:00:37 +02:00
47f1bffb24 backend fixed Patch Research 2024-04-17 23:00:00 +02:00
f19236b3f7 Avoid password leakage
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m27s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Failing after 2m10s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
The password should never be parsed to json ever so can be safely
ignored.
2024-04-17 21:44:30 +02:00
cba11d54ff Page to right size (#152)
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Reviewed-on: #152
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-04-17 21:43:49 +02:00
a27cf63daf Add the post feature for differents types of changeCurriculumRequest 2024-04-17 21:42:33 +02:00
8fa29460ef base
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m53s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 29s
2024-04-17 21:41:29 +02:00
1be7b4cdbe Add the unregistration of a specific cursus only 2024-04-17 13:57:52 +02:00
3ea48c20aa front add manageProfileApp 2024-04-17 13:34:39 +02:00
8c70108a1c added translations 2024-04-17 13:33:35 +02:00
e303048f7e backend add ManageResearcherProfile 2024-04-17 13:32:46 +02:00
6116cbdaa4 added distinct languages to SQL query 2024-04-17 12:41:58 +02:00
bdfa2e6389 backend returns views 2024-04-17 12:41:36 +02:00
d4c442c64a added ResearchProfile to Apps (to be changed) 2024-04-17 12:40:52 +02:00
94be706226 Merge remote-tracking branch 'origin/master' into tonitch/feat/notifications 2024-04-17 12:37:44 +02:00
5c0dfa3596 fixed stats and added views in researchComp 2024-04-17 12:37:14 +02:00
24f82812f4 added views to research DTO 2024-04-17 12:22:45 +02:00
881b30e5c9 indev 2024-04-17 12:00:52 +02:00
058c53dbbc Add the actual in UserCurriculum
Rework the unregister procedure
Add ChangeCurriculumRequest
Add the changeCurriculumRequest submit
2024-04-17 11:55:56 +02:00
caa39696d2 Rework the profile page
Add the accept/refuse for unreg request
2024-04-17 08:53:28 +02:00
b9d7950e12 Merge branch 'master' into Leo/masterRegNo
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m43s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-04-17 07:52:58 +02:00
f269e24bb4 Merge remote-tracking branch 'origin/master' 2024-04-17 00:32:39 +02:00
7a05fc1316 fixed spelling mistake 2024-04-17 00:26:56 +02:00
c0233fce57 Merge pull request 'adding compose for launching properly everything' (#151) from tonitch/compose into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m57s
deploy to production / deploy-frontend (push) Successful in 29s
deploy to production / deploy-backend (push) Failing after 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 27s
Reviewed-on: #151
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-04-17 00:26:11 +02:00
821377a72f added addview and download PDF 2024-04-17 00:09:30 +02:00
a2be04bfb3 link backend Post Patch Delete Lesson 2024-04-16 22:03:48 +02:00
388c53e47b fixed front 2024-04-16 11:54:53 +02:00
87b02af68e added stats SQL queries 2024-04-16 11:54:11 +02:00
f184de21a8 translate month number to name 2024-04-16 11:24:28 +02:00
63d0087d0c junction front - back 2024-04-15 23:35:05 +02:00
451944e4fb Implements the RegNo feature
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m50s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 29s
2024-04-15 20:57:29 +02:00
c434b28fe3 Add the display for unregister requests
Rename all ocurrences of uninscription
to unregister
Rework the uninscriptionRequest so we have an history and it doesn't take an user so better security
2024-04-15 20:13:01 +02:00
a89d1b192c Add the gestion of scholarshipRequest (accept and refuse and select the amount) 2024-04-15 16:17:27 +02:00
eacdf8d47a stats Service and endpoint
todo: statsRepository
2024-04-14 23:29:51 +02:00
61eac8959a Merge pull request 'Leo/InscriptionDesEtudiants' (#156) from Leo/InscriptionDesEtudiants into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 3m18s
deploy to production / deploy-frontend (push) Successful in 28s
deploy to production / deploy-backend (push) Successful in 1m35s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #156
2024-04-14 19:49:15 +02:00
05bff0fa77 Add the uninscription request submission
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 3m38s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-04-14 18:29:23 +02:00
9112004326 Schedule management 2024-04-14 13:52:09 +02:00
1498cfa11e added comments and fixed logic issue 2024-04-14 12:34:04 +02:00
c6ce6d3e5b translations of forum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 3m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-04-13 16:05:14 +02:00
2e02cd8870 Style bits redone 2024-04-13 15:56:43 +02:00
98c9d2d754 Link the ExternalCurriculum to a user after the inscription.
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m31s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Add the ExternalCurriculum lists in AboutStudent.vue
2024-04-12 09:28:56 +02:00
17cb969160 added all endPoints 2024-04-12 01:56:18 +02:00
8ebedec689 Fix fews things and rename the inscription app to managerequests also sort the files
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 29s
2024-04-11 21:06:57 +02:00
4199663d64 Huge commit
- Rework the inscription requests system so that it considers the equivalence systems and the impact of the teacher in the inscription procedure.
2024-04-11 16:45:48 +02:00
adaa828810 Filter and lists 2024-04-11 15:47:56 +02:00
4720669c2c added EndPoints and Mock 2024-04-11 12:29:03 +02:00
5e9eccc4f6 Researches EndPoints 2024-04-11 00:24:40 +02:00
34c0a2bfe8 Merge remote-tracking branch 'origin/master' into Leo/InscriptionDesEtudiants
# Conflicts:
#	frontend/src/rest/apps.js
2024-04-10 23:28:00 +02:00
706481ed1a Fix and simplifie the post and get for externalCurriculum 2024-04-10 23:09:38 +02:00
0c04bed799 this is a test dw 2024-04-10 22:00:08 +02:00
95ef4023d6 change schedule Curriculum and own schedule 2024-04-10 20:22:07 +02:00
9d0b3da9d3 Implements the backend and frontend methods to get some scholarshipRequests and exemptionsRequest
Extends the inscription.vue so that it also list scholarship and exemptions requests (not only inscription) this vue should be renamed later. Also implements some filters and parameters to select the data displayed in the list.
2024-04-10 14:40:41 +02:00
8650482d11 changed "article" to "research"
to be more more general
2024-04-10 11:50:17 +02:00
783cd8fa9f added comments in entities 2024-04-10 01:14:34 +02:00
40186f9898 changed button colors 2024-04-10 01:14:14 +02:00
106bf96a98 responses and general modifications 2024-04-09 23:41:43 +02:00
b7a729c899 added extention entities 2024-04-09 19:52:31 +02:00
fdf4993def remove unecessary imports 2024-04-09 18:24:46 +02:00
dad6953f99 Merge remote-tracking branch 'origin/master' 2024-04-09 17:59:54 +02:00
f99ed470f8 added comment 2024-04-09 17:58:02 +02:00
9a83d14aea added article Popup 2024-04-09 17:32:04 +02:00
7b0d76dae8 Merge remote-tracking branch 'origin/master' into forum 2024-04-09 17:28:59 +02:00
61e269eb27 Linking front for forum creation 2024-04-09 17:27:26 +02:00
76c3b76153 Merge pull request 'Messaging system' (#150) from tonitch/Clyde:msg into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 3m45s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 1m35s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #150
2024-04-09 17:08:57 +02:00
21a5dbdb22 Implements the possibility to ask for a scholarship for a student 2024-04-09 15:58:10 +02:00
142ea996d8 link front and back part 1 2024-04-09 14:01:23 +02:00
0cbe0dd82b filter popup mock done 2024-04-09 00:57:06 +02:00
3167d1f2fc added the Filters button and popup 2024-04-08 22:56:44 +02:00
e6e147af26 Implements the school fees gestion for a student and a payment table containing a history of all the financial transactions of the system 2024-04-08 14:50:37 +02:00
a94167c8a0 scrollable + better search 2024-04-08 11:02:59 +02:00
194b14f02b Implements the backend logic for the minerval gestion 2024-04-08 10:18:28 +02:00
5f483216b9 indev 2024-04-08 10:02:03 +02:00
5a4d066c45 Forum and topic getter and creator endpoints 2024-04-07 18:16:05 +02:00
d31547c4cc added levenshtein distance to search input 2024-04-07 15:51:53 +02:00
ec2b975467 Merge pull request 'proposition of some fixes' (#1) from PGL/Clyde:tonitch/max/front/fix/vue into master
Reviewed-on: Maxime/Clyde#1
2024-04-07 14:59:12 +02:00
f9bcff6d4f Avoid password leakage
The password should never be parsed to json ever so can be safely
ignored.
2024-04-07 14:46:14 +02:00
aa3e1cb868 backend Schedule 2024-04-07 14:33:51 +02:00
3c721de18b Big commit:
make some changes to profile to provide an interface for a student to manage his courses.

implements the submission of exemptions request
2024-04-06 16:12:11 +02:00
5bb7606721 signing and commenting
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m21s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-05 12:54:51 +02:00
b049c46571 Avoid title reseting mid modification
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 3m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-04-05 11:45:47 +02:00
b8b193f344 proposition of some fixes 2024-04-05 09:44:41 +02:00
05359d64ac Merge remote-tracking branch 'origin/master' 2024-04-05 09:06:01 +02:00
7bd745fd5e Adding frontend visual side 2024-04-05 08:57:19 +02:00
3d78851b29 moving file into extensions directory 2024-04-04 21:27:51 +02:00
648b73b585 Fix the implementation of externalCurriculum upload 2024-04-04 16:54:11 +02:00
dbe28a7fed making the chart responsive 2024-04-04 16:14:19 +02:00
bd7d2c2d51 adding colors to piechart 2024-04-04 15:01:10 +02:00
9937a7db39 Display Week and Month End 2024-04-04 14:44:35 +02:00
a96609d2ef Page to right size 2024-04-03 14:58:04 +02:00
cb750b8505 Database creation (Tables) 2024-04-02 21:40:52 +02:00
91c7f42521 finished mock researcher profile 2024-04-02 19:52:38 +02:00
443cf55784 weekly set up, end 2024-04-02 16:52:40 +02:00
7ca5c34afe adding timestamp
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m9s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-04-02 11:08:58 +02:00
2b9bdf8dac fixup! show sender on message
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m8s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-02 10:18:50 +02:00
ccb954e348 show sender on message
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m9s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-04-02 10:05:17 +02:00
3761fa6f49 Adding cdn support with compose
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m10s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Now when you upload a file, the path is stored to the db and the file is
accesible on the client with : `localhost:8000/cdn/3ed026aa-366f-4f33-bc51-fb59d37e35ee.png` for instance.
2024-04-02 00:21:15 +02:00
cb36aa8a30 Fixing file locations
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m33s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 29s
2024-04-01 22:49:24 +02:00
bd27ffd3cb search bar not working (to be shared with william) 2024-04-01 19:13:39 +02:00
2b9493422d setup grid to display courses 2024-04-01 16:51:18 +02:00
8442101c40 Fixed some css 2024-04-01 11:43:42 +02:00
bce53305b3 Merge master into my branch 2024-04-01 10:40:36 +02:00
47e4fb2f8c Merge remote-tracking branch 'origin/master' into Leo/InscriptionDesEtudiants
# Conflicts:
#	frontend/src/Apps/Inscription.vue
#	frontend/src/Apps/Login.vue
#	frontend/src/Apps/Profil.vue
#	frontend/src/Apps/StudentsList.vue
2024-04-01 10:30:29 +02:00
2e2837fec4 adding info about compose
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m45s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-30 23:33:16 +01:00
0e26e1a0db adding compose for launching properly everything 2024-03-30 23:23:33 +01:00
91ee3adbcd adding the dependance 2024-03-30 13:10:11 +01:00
c1b2742a8f better select buttons 2024-03-30 12:38:18 +01:00
2805fede4b researcher profile page separations 2024-03-30 12:38:18 +01:00
951feed3c8 Full screen apps 2024-03-30 12:38:18 +01:00
95054fa973 Login 'fixed' 2024-03-30 12:38:18 +01:00
3af83a58d3 Just to merge 2024-03-30 12:38:17 +01:00
47c5c14862 Make app use full space 2024-03-30 12:38:17 +01:00
4a314449ad Add the backend logic for ExternalCurriculum class (need to do one more endpoint) 2024-03-29 15:31:02 +01:00
ce56e37a33 redesign send bar
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m54s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-03-29 14:31:22 +01:00
1c61a356a4 update when message sent 2024-03-29 14:31:08 +01:00
2bdffe6ab4 remove member of a discussion 2024-03-29 14:30:46 +01:00
a3c9d6a7c0 Fix the profilepicture url issue (it wasn't sent to the db)
add a prototype of a more generic uploadfile function in uploads.js

makes the distinction between a master cursus and a bachelor cursus in display
2024-03-29 10:55:59 +01:00
729d1ad504 adding members management
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 3m35s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-27 23:54:59 +01:00
1522d74ed3 messsaging on the frontend 2024-03-27 19:52:48 +01:00
b4499e04c7 Managing the message with backend
Using DTO to change the way discussions and message are sent to the
client
2024-03-27 19:50:52 +01:00
94f12f0a86 Add the date and identitycard feature to inscriptionRequest 2024-03-27 16:04:55 +01:00
839ca414ce Ajoute le détail des demandes d'inscriptions (big update) 2024-03-27 14:12:20 +01:00
eafff6ec2d Ajoute le détail des étudiants (big update) 2024-03-25 09:57:35 +01:00
914f6bdf36 fix for new discussions not appearing right away 2024-03-25 09:43:45 +01:00
66e7fa24a1 Adding the discussion architectures and creating new discussions 2024-03-25 00:08:44 +01:00
7b9f021c24 first version of the frontend for messages 2024-03-24 22:33:17 +01:00
2dfa0a0ee0 base msg 2024-03-24 22:33:14 +01:00
9e0db361b8 Merge pull request 'Make app use full space' (#148) from tonitch/front/fullSpaceApp into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m26s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 2m5s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #148
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-24 22:32:46 +01:00
621f568ba2 merge full app 2024-03-24 13:49:52 +01:00
972d08a54d added temporary fix to docker issue 2024-03-24 13:37:27 +01:00
7a13d412f1 Full screen apps
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m48s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-23 23:56:24 +01:00
67fa630ecf e 2024-03-23 18:04:36 +01:00
db895a6091 added temporary fix to docker issue 2024-03-23 14:38:26 +01:00
ad0e7b3e35 - Ajoute un champ year dans UserCurriculum pour différencier les anciers cursus de l'actuel pour l'étudiant
- Ajoute la table ExemptionsRequest
- Ajoute la table ScholarshipRequest
- Ajoute la table UninscriptionRequest
2024-03-23 14:08:03 +01:00
9de4b06e75 Login 'fixed'
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m53s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-23 13:57:46 +01:00
123fa97611 Merge branch 'wal/front/temp' into tonitch/front/fullSpaceApp 2024-03-22 20:15:45 +01:00
1fad792be7 Just to merge 2024-03-22 20:14:20 +01:00
acd1262955 Make app use full space
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m50s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-22 13:56:04 +01:00
3d6941ab93 adding cdn to CI
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m57s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 1m29s
2024-03-18 21:39:31 +01:00
de72bd800c CI fix
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m53s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m3s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
2024-03-18 21:13:00 +01:00
b465dcfa92 Merge pull request 'Clean le projet' (#146) from Leo/Backend/Cleaning into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m55s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m51s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #146
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-18 21:06:02 +01:00
73f3df0bc6 Clean le projet
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m46s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 20:54:16 +01:00
90a7b7b70e Merge pull request 'Link back and front all get' (#115) from wal/front/listingUsers into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m53s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Failing after 2m48s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #115
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
2024-03-18 20:20:35 +01:00
4f002a29e1 Merge pull request 'added delete self' (#145) from Max/Backend/UserDelete into master
Some checks failed
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Has been cancelled
Reviewed-on: #145
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-18 20:19:41 +01:00
66d090d045 Merge pull request 'Leo/Backend/UnitTest' (#138) from Leo/Backend/UnitTest into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m56s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 2m53s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #138
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-18 19:21:54 +01:00
4715441afd FINAL COMMIT
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 18:47:00 +01:00
77ac771b8f Merge remote-tracking branch 'origin/Max/Backend/UserDelete' into wal/front/listingUsers
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m31s
Build and test backend / Test-backend (pull_request) Failing after 1m31s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 17:36:07 +01:00
3762750968 Tempo 2024-03-18 17:34:35 +01:00
a276c24f8f added delete self
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-18 17:30:04 +01:00
25c5c1b018 Nearly finish
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m31s
Build and test backend / Test-backend (pull_request) Failing after 1m31s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 20s
2024-03-18 17:28:14 +01:00
c7f37b0854 Fix le truc de max et ajoute le test du delete
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m44s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 15:55:38 +01:00
c35f675a11 Manage course + delete course END
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 15:47:04 +01:00
a9e5e45872 Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m5s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 14:57:49 +01:00
73d50f3f50 Merge remote-tracking branch 'refs/remotes/origin/wal/front/listingUsers' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-18 14:52:29 +01:00
0871d2971d manage Course finished 2024-03-18 14:51:27 +01:00
9744bd973f Resolve conflicts and adapt tests
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m49s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-18 14:29:30 +01:00
ecaa0af24a Merge remote-tracking branch 'origin/master' into Leo/Backend/UnitTest
# Conflicts:
#	backend/src/main/java/ovh/herisson/Clyde/Services/AuthenticatorService.java
#	backend/src/main/java/ovh/herisson/Clyde/Services/UserService.java
2024-03-18 13:55:45 +01:00
a762b6875d removing cdn
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m34s
Build and test backend / Test-backend (pull_request) Failing after 1m32s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 13:54:31 +01:00
4e6c4ecf38 Merge pull request 'added GET /user/{id}' (#143) from Max/Backend/GetUserById into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-backend (push) Successful in 2m22s
Reviewed-on: #143
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-18 13:48:07 +01:00
ec3c912847 Merge remote-tracking branch 'origin/master' into Max/Backend/GetUserById
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 13:45:47 +01:00
5636d96478 Merge pull request 'Max/Backend/UserDelete' (#144) from Max/Backend/UserDelete into master
Some checks failed
Build and test FrontEnd / Build-frontend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test backend / Test-backend (push) Has been cancelled
Build and test backend / Build-backend (push) Successful in 2m12s
Reviewed-on: #144
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-18 13:45:04 +01:00
d40ceff2ba disable test on ci, problem for later
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m42s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 12:41:18 +01:00
fd357ba938 GET /curriculum returns user's curriculum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 12:15:13 +01:00
92079c5a47 Merge remote-tracking branch 'origin/Max/Backend/UserDelete' into wal/front/listingUsers
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m32s
Build and test backend / Test-backend (pull_request) Failing after 1m33s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 11:59:44 +01:00
753af3874e Login and register ok and starting requests 2024-03-18 11:55:51 +01:00
e03a01ec89 oups forgot somthing 2024-03-18 11:53:33 +01:00
fd18df7c3a added a InscriptionRequest to POST /mock
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 11:33:50 +01:00
93c161be4c added every delete endpoint required
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m16s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-18 11:22:21 +01:00
853a3a42d2 Small improvement
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m45s
Build and test backend / Test-backend (pull_request) Failing after 3m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-18 02:14:36 +01:00
a80fb2b297 added DELETE user and prepared tables for cascade deletion
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-18 00:14:48 +01:00
f484fb095e added protection for inscription requests 2024-03-18 00:14:26 +01:00
8ff29ca34e Register
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 23s
2024-03-17 23:19:36 +01:00
611e7167f9 CI -> build no test and trying to fix test
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m50s
Build and test backend / Test-backend (pull_request) Failing after 2m38s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-17 22:40:22 +01:00
ee37dc79a7 Fixing the CI
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 2m45s
Build and test backend / Test-backend (pull_request) Failing after 2m37s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Moving the dev test and build to port 5442 from 5432 to avoid
conflicting with the running postgresql
2024-03-17 22:02:12 +01:00
2fb6aef67c added GET /user/{id} 2024-03-17 22:01:48 +01:00
7e7cec2f6c Merge branch 'Max/Backend/GetUserById' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 22:00:56 +01:00
345599888d added GET /user/{id}
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 21:48:58 +01:00
19b4950be4 Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 21:39:04 +01:00
d9307753c4 trop de truc
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 21:38:10 +01:00
7a23dcc96a Merge pull request 'Max/Backend/ReturnUserPasswordIssue' (#137) from Max/Backend/ReturnUserPasswordIssue into master
All checks were successful
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 23s
Build and test backend / Build-backend (push) Successful in 2m12s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #137
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-17 21:36:53 +01:00
f2b80ba89f Resolve conflicts and resolve condition bug in isNotSecretaryOrAdmin
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 2m27s
Build and test backend / Test-backend (pull_request) Failing after 2m25s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 19:17:38 +01:00
114116b97c Merge remote-tracking branch 'origin/master' into Leo/Backend/UnitTest
# Conflicts:
#	backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java
2024-03-17 19:14:25 +01:00
924faca13f Add testing for file uploading and correct minors bugs in service
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 3m14s
Build and test backend / Test-backend (pull_request) Failing after 2m30s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-17 19:06:27 +01:00
ea4a0745e0 creation of the user when request accepted
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m42s
Build and test backend / Test-backend (pull_request) Successful in 2m30s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 33s
2024-03-17 17:15:33 +01:00
76f5a39a8f GET /users doesn't return Admins if the poster isn't an admin
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 16:26:30 +01:00
37f8a3ac4e removed an unused variable 2024-03-17 16:25:00 +01:00
ea46dd664c added a todo to send an email for every state changement of request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-17 16:02:30 +01:00
b2d0be014c UserList and Student List part1
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 15:59:12 +01:00
571d27c230 Add test for user patch
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 2m24s
Build and test backend / Test-backend (pull_request) Failing after 2m22s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 15:53:50 +01:00
37a9eb46ae Add tests for UserController get and post
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 2m22s
Build and test backend / Test-backend (pull_request) Failing after 2m24s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 15:42:43 +01:00
bfc4f6567b Merge remote-tracking branch 'origin/Leo/Backend/UnitTest' into Leo/Backend/UnitTest
# Conflicts:
#	backend/src/main/java/ovh/herisson/Clyde/EndPoints/UserController.java
2024-03-17 15:40:45 +01:00
d423a57fa0 Add tests for UserController get and post 2024-03-17 15:40:14 +01:00
210fda0401 Merge branch 'master' into wal/front/listingUsers 2024-03-17 13:33:47 +01:00
b67b25b4a4 Login Finished, add curricula and apps
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 13:24:24 +01:00
385290d1a2 Merge branch 'master' into Max/Backend/ReturnUserPasswordIssue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 13:07:20 +01:00
cf2deb983d added security to assistant posting and Get courses/owned for owners
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-17 12:13:03 +01:00
dcec45acf5 Merge pull request 'added /students endpoint' (#135) from Max/Backend/StudentEndPoin into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Reviewed-on: #135
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-17 12:00:57 +01:00
008af10d0e Merge branch 'master' into Leo/Backend/UnitTest
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m17s
Build and test backend / Test-backend (pull_request) Successful in 2m17s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 10:36:00 +01:00
f7df234312 moved portective method to Static ProtectiveService
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-17 03:06:19 +01:00
d855bbe911 Merge branch 'Max/Backend/CourseInCurriculum' into Max/Backend/ReturnUserPasswordIssue 2024-03-17 02:50:12 +01:00
f2507ddcdd forgot the return statement 2024-03-17 02:46:33 +01:00
a70b05a0ef protected course'owner password 2024-03-17 02:45:49 +01:00
1d793cef4e moved UserWithouPaswword to authenticatorService 2024-03-17 02:40:05 +01:00
4cf2ac1aa8 fixed an issue with the getting of curriculums
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-17 02:34:00 +01:00
6e6bd285af added security to the post of course and GET /courses 2024-03-17 02:15:08 +01:00
474a8d3f31 added POST /curriculum/{id} endopoint to post courses 2024-03-17 02:00:42 +01:00
4379794dba added /students endpoint
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-16 23:05:26 +01:00
c5d7ce4178 cleaned the Entities
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 20:31:03 +01:00
382d3c203a cleaned the services 2024-03-16 20:25:35 +01:00
5a7934b2a3 Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m14s
Build and test backend / Test-backend (pull_request) Successful in 2m7s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 27s
2024-03-16 19:57:53 +01:00
8476563678 profil part3 2024-03-16 19:54:42 +01:00
97b57b361d cleaned all controllers 2024-03-16 19:13:57 +01:00
069466ef5f Max/Backend/CoursesEndpoints (#129)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m16s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m22s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
PLZ FIX

Reviewed-on: #129
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Co-authored-by: Bartha Maxime <231026@umons.ac.be>
Co-committed-by: Bartha Maxime <231026@umons.ac.be>
2024-03-16 17:17:07 +01:00
d5f6656e2b added the GET /teachers (#130)
Some checks failed
Build and test backend / Build-backend (push) Has been cancelled
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
had to fix the mock and the UserController isAdminOrSecretary

Reviewed-on: #130
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Co-authored-by: Bartha Maxime <231026@umons.ac.be>
Co-committed-by: Bartha Maxime <231026@umons.ac.be>
2024-03-16 17:16:46 +01:00
32e26f35cb Merge pull request 'show apps by role' (#131) from tonitch/front/apps into master
Some checks failed
Build and test backend / Build-backend (push) Has been cancelled
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Reviewed-on: #131
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-16 17:16:34 +01:00
36fc33c3e9 Profil part.2/?
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 2m4s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-16 17:01:26 +01:00
17ab241250 show map by role
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m7s
Build and test backend / Test-backend (pull_request) Successful in 2m4s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 16:57:52 +01:00
36ce5a553b Profil, merge Master and corrections
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-16 15:21:10 +01:00
a5807148e1 And again we continue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 15:06:21 +01:00
53e478b05c Merge pull request 'added ApplicationController and Application enum' (#119) from Max/Backend/AppsController into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m12s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
deploy to production / deploy-frontend (push) Successful in 26s
Reviewed-on: #119
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-16 14:51:56 +01:00
182be8ac7b Merge branch 'master' into Max/Backend/AppsController
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-16 14:48:03 +01:00
beba199f60 Merge pull request 'Login indication' (#127) from tonitch/front/loginIndication into master
All checks were successful
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test backend / Build-backend (push) Successful in 2m12s
Reviewed-on: #127
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-16 14:45:02 +01:00
767a83d1d6 Merge pull request 'Max/Backend/BackendClean' (#121) from Max/Backend/BackendClean into master
Some checks failed
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Has been cancelled
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 2m12s
Build and test backend / Test-backend (push) Successful in 1m20s
Reviewed-on: #121
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-16 14:38:19 +01:00
da3f8c47f9 Fix merge because i'm bad
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 22s
2024-03-16 14:34:11 +01:00
8d1235be92 again links
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-16 14:31:44 +01:00
1546fc6d47 Merge branch 'master' into Max/Backend/BackendClean
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m34s
Build and test backend / Test-backend (pull_request) Failing after 1m31s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-16 14:13:47 +01:00
04f64f505e Indicated that you are logged by coloring the icon in orange and disconnect if clicked on it
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 13:56:29 +01:00
e84e34d735 login 2024-03-16 12:47:49 +01:00
c955fbf5f8 Merge pull request 'fix tokens characters' (#126) from tonitch/back/fixTokens into master
All checks were successful
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Build-backend (push) Successful in 2m11s
Reviewed-on: #126
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-16 12:42:54 +01:00
847936b799 fix tokens characters
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-16 12:36:17 +01:00
0b27d2e8d8 Merge branch 'master' into tonitch/front/pagesAPI
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-16 12:35:15 +01:00
45fbef52ed fix tokens characters
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 12:29:51 +01:00
Wal
ca6f676fb7 Merge pull request 'tonitch/front/manageCourses/LinkToBackend' (#125) from tonitch/front/manageCourses/LinkToBackend into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
Reviewed-on: #125
2024-03-16 12:26:57 +01:00
cc8530621d Merge branch 'master' into tonitch/front/manageCourses/LinkToBackend
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 12:01:44 +01:00
abff9aef3a Merge branch 'master' into Max/Backend/AppsController
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 11:58:03 +01:00
41288258c9 Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 11:56:37 +01:00
47a0c97f3d small commit but its for the big merge+ verif psswrd and confirm in login
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-16 11:52:31 +01:00
3ea6c7886a Merge pull request 'rename Cursus -> Curriculum' (#120) from Max/Backend/CurriculumRename into master
All checks were successful
deploy to production / deploy-frontend (push) Successful in 25s
Build and test backend / Build-backend (push) Successful in 2m9s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-backend (push) Successful in 2m22s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #120
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-16 11:50:49 +01:00
17d0ae7ccc Refactoring: cursus -> curriculum frontend
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
I hope I didn't missed anything, this commit is following the previous
one in this branch
2024-03-16 10:17:04 +01:00
8f2fb04112 I pressed tab by accident
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 09:03:03 +01:00
c6198b7220 cleaned Services + added private final to all repos
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m35s
Build and test backend / Test-backend (pull_request) Failing after 1m30s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-16 09:02:08 +01:00
13fd048cd2 added a inscriptionService mock user 2024-03-16 09:01:36 +01:00
b7b2eafb93 removed the GET /Apps/{id} frontend just iterates on the /apps list
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 00:44:11 +01:00
0860567e1b fixed the GetAuthorizedApps method
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 00:42:46 +01:00
25009ba149 Enum in CamelCase
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-16 00:34:20 +01:00
208c6c63e8 moved the isSecretaryOrAdmin method 2024-03-16 00:31:03 +01:00
e2da7271af rename Cursus -> Curriculum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-15 23:53:15 +01:00
d5e4387303 Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-15 22:49:26 +01:00
1903a6c9be "trying functions"
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m4s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-15 22:47:40 +01:00
77a170be6d Merge branch 'master' into tonitch/front/pagesAPI
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-15 22:37:37 +01:00
9f02207eb0 Merge pull request 'Max/Backend/Curriculum' (#106) from Max/Backend/Curriculum into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m12s
deploy to production / deploy-frontend (push) Successful in 26s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-backend (push) Successful in 2m21s
Reviewed-on: #106
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-15 22:33:25 +01:00
ae4ad036a8 Merge remote-tracking branch 'origin/master' into tonitch/front/manageCourses/LinkToBackend 2024-03-15 22:32:21 +01:00
3996765c8a Simple hook for when the backend is ready
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-15 22:25:26 +01:00
b047c4de35 Listing users and students
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-15 20:23:33 +01:00
1f14890d43 added ApplicationController and Application enum
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-15 18:54:53 +01:00
2ea6ed16bb removed missclick
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-15 18:53:58 +01:00
189e664f37 Add tests for Storage system
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m53s
Build and test backend / Test-backend (pull_request) Successful in 2m17s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-15 18:49:41 +01:00
f33a421aee Merge branch 'master' into Max/Backend/Curriculum
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 21s
2024-03-15 17:40:42 +01:00
017235cccf fixed inscription in the backend
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m8s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-15 17:29:45 +01:00
1bff48a4b9 changed the frontend API calls
to better suit the backend and logic (register => list and register => single item)
2024-03-15 17:09:18 +01:00
385640c10e Merge branch 'master' into wal/front/listingUsers
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-15 15:14:18 +01:00
a0c38a8d59 adding list of user PROTO 2024-03-15 15:12:01 +01:00
198ee8a4ce Register API and form optimization [depend: backend /register] (#93)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m7s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Made the register api following the backend

refactored the register form for more ergonomy

**PS: Waiting for the backend to catch up**

Reviewed-on: #93
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-15 14:46:39 +01:00
08c662a65f Fetch inscription on backend
Some checks failed
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 2m14s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Has been cancelled
This commit is waiting for the backend implementation to be merged.

The list of field expected is writen in comment
2024-03-15 14:41:21 +01:00
c8b7930a8e Setup unit tests and implements test for the token limit and trivial tests for userRepository 2024-03-15 11:20:23 +01:00
20d52b2b21 Merge pull request 'Max/Backend/RegisterEndPoint' (#105) from Max/Backend/RegisterEndPoint into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
deploy to production / deploy-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #105
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-14 23:30:13 +01:00
1502cc871c Merge pull request 'UploadAPI and profilePicture' (#102) from tonitch/front/apiUpload into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 26s
Reviewed-on: #102
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-14 22:37:30 +01:00
826bbf5990 Create the directory if not exists
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
2024-03-14 22:36:48 +01:00
c26972369f Putting the right configuration for cors
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
2024-03-14 22:35:57 +01:00
Wal
4c5cae7ff5 Merge pull request 'Translations' (#104) from wal/front/Translations into master
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Reviewed-on: #104
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-14 22:34:45 +01:00
59c3442647 lil corrections
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 2m5s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-14 22:33:16 +01:00
12846ed83d added cursus/course interactions
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-14 21:53:43 +01:00
bb4ee784fa Merge pull request 'Max/Backend/UserControllerUpdate' (#94) from Max/Backend/UserControllerUpdate into master
All checks were successful
deploy to production / deploy-frontend (push) Successful in 25s
Build and test backend / Build-backend (push) Successful in 2m16s
Build and test backend / Test-backend (push) Successful in 1m22s
deploy to production / deploy-backend (push) Successful in 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #94
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-14 21:53:33 +01:00
1777e894e9 removing spaces
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-14 21:33:36 +01:00
3c3659c056 Merge branch 'master' into wal/front/Translations 2024-03-14 21:31:22 +01:00
e05492f4a8 Adding all translations 2024-03-14 21:27:03 +01:00
97a2c8a9f6 Fix the "error" bug
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m34s
deploy to production / deploy-frontend (push) Successful in 27s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test backend / Test-backend (push) Successful in 1m21s
Even when the requests was sucessfull, the "error" toast was
appearing... now it should do a "success" when adequate
2024-03-14 21:06:33 +01:00
9aa425d1c3 changed details 2024-03-14 20:04:27 +01:00
f0a411c031 added InscriptionController
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-14 16:36:09 +01:00
6228e21d38 easter is coming (dont look it's not fun)
All checks were successful
deploy to production / deploy-frontend (push) Successful in 26s
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m23s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
2024-03-13 23:28:25 +01:00
64e7f8dc6b modifying the frontend to send the image and getting the data
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-13 22:33:39 +01:00
a0285e700d Modifying backend so it send the full entry of a file upload 2024-03-13 22:28:59 +01:00
68e55e8355 Putting the right configuration for cors 2024-03-13 20:42:06 +01:00
157e5951fc ups je change un copié collé 2024-03-13 19:14:22 +01:00
4241f15731 j'ai envie de me pendre 2024-03-13 19:12:46 +01:00
cead1188ab Merge pull request 'Leo/Backend' (#95) from Leo/Backend into master
All checks were successful
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m19s
Build and test backend / Build-backend (push) Successful in 2m15s
Build and test backend / Test-backend (push) Successful in 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #95
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-13 18:06:33 +01:00
5c7147bb17 fixing the double throw before the merge
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Signed-off-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-13 18:05:35 +01:00
7d8e1113cc Remove course
All checks were successful
deploy to production / deploy-frontend (push) Successful in 28s
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m21s
2024-03-13 17:54:57 +01:00
354793a29f Create Course 2024-03-13 17:54:57 +01:00
d5b1df32b6 course management 2024-03-13 17:54:57 +01:00
2a58c335f2 Apply les trucs de l'exception
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-13 15:48:28 +01:00
4f511bf066 Merge pull request 'HUUUUGE CHANGE' (#97) from Max/Backend/ServiceInscription into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m15s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #97
2024-03-13 15:44:16 +01:00
62f64eed60 HUUUUGE CHANGE
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m2s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-13 15:36:13 +01:00
4b1db883e2 updated tonitch's reviews
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-13 15:28:17 +01:00
58a4c87661 Removing test gradle
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
2024-03-13 14:39:34 +01:00
f52cb31189 Adding info about self (#88)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
deploy to production / deploy-backend (push) Successful in 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-frontend (push) Successful in 27s
Reviewed-on: #88
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-13 09:54:56 +01:00
044648674c Merge branch 'master' into Max/Backend/UserControllerUpdate
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-12 23:16:35 +01:00
4b0ea8cf40 added the post /user Endpoint
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m23s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-12 23:08:18 +01:00
dae59f67ce encoding the password before saving it
oups I Forgor
2024-03-12 22:35:25 +01:00
66282bce9f Create new constructor for ReinscriptionRequest so you don't have to worry about the type of the request
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m15s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-12 17:53:52 +01:00
b7a574a312 Merge branch 'master' into Leo/Backend
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m57s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-12 11:17:14 +01:00
8fbfb36958 Remove the bad link between users and file. Add a delete function for storageFile entities and clean things.
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-12 10:48:13 +01:00
86f1a6f17b Little corrections
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m16s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
2024-03-12 09:55:26 +01:00
68df9f99fa modify profil strating setup 2024-03-12 09:55:26 +01:00
2fe6153705 Translation correction 2024-03-12 09:55:26 +01:00
042553c123 Profil Teacher and examples 2024-03-12 09:55:26 +01:00
3cf5153e79 Profil Student Prototype 2024-03-12 09:55:26 +01:00
07e5fb3a73 profil menu base 2024-03-12 09:55:26 +01:00
c14d0a9d21 option language settings start 2024-03-12 09:55:26 +01:00
5c728098df protected post /user and get/users and return without password
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-12 00:03:32 +01:00
28d252279a added a small description 2024-03-11 22:33:53 +01:00
ab91a39a63 Create exception for file deletion.
Add user/inscriptionrequest connection to StorageFile entity.
Create a prototype of the delete for file function
2024-03-11 20:23:45 +01:00
d4c48ee9f1 Leo/Backend (#82)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Ce merge enverra dans main : le timeout des token, la limite de 5 token par user, les nouvelles tables pour les demandes d'inscriptions

Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #82
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Co-authored-by: LeoMoulin <leomoulin125@gmail.com>
Co-committed-by: LeoMoulin <leomoulin125@gmail.com>
2024-03-11 19:16:19 +01:00
5325d6e3ae Storage System (#92)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m17s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
First idea of the storage system

Reviewed-on: #92
Co-authored-by: Bartha Maxime <231026@umons.ac.be>
Co-committed-by: Bartha Maxime <231026@umons.ac.be>
2024-03-11 17:52:08 +01:00
ce2efb61c8 fixed some issue for the token authorization (#87)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #87
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Co-authored-by: Bartha Maxime <231026@umons.ac.be>
Co-committed-by: Bartha Maxime <231026@umons.ac.be>
2024-03-10 23:28:13 +01:00
b7c97ead2b Merge pull request 'Reactive Translations' (#86) from tonitch/front/Reactive_Translations into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m8s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m19s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #86
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-10 20:35:32 +01:00
84fe1df671 Reactive Translations
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
Make Translated text reactive so that when switching lang, text is
reload on the fly

Fixes: #77
2024-03-09 19:14:57 +01:00
8fdfb470cb fixing the origin requests once and for all
All checks were successful
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
2024-03-09 18:54:46 +01:00
160cfb0bbf Page api stub
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-09 18:41:20 +01:00
31159ebb5c Merge pull request 'Fixing the cross origine on the frontend side + request in json' (#79) from tonitch/front/fix/crossOrigine into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m15s
Build and test backend / Test-backend (push) Successful in 1m22s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Successful in 2m23s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Reviewed-on: #79
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-09 18:18:15 +01:00
ac88307036 fix expiration date and frontend requests
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-09 16:22:38 +01:00
847b1ca419 Solve crossOrigin Finally
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-09 16:20:55 +01:00
5bda05925c Merge pull request 'Removing more useless stuff' (#81) from tonitch/front/fix/removeComponents into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m19s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #81
2024-03-09 14:58:01 +01:00
be084cfd12 Removing more useless stuff
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-09 12:32:07 +01:00
0b4b38f6c5 Fix typo
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
Merci javascript pour ces erreurs de qualitée...
2024-03-09 10:36:20 +01:00
21de520175 Fixing the cross origine on the frontend side
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 21s
2024-03-09 10:29:32 +01:00
b88d820c12 Merge pull request 'fixed a token encoding issue' (#70) from Max/backend/loginFix into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 26s
Reviewed-on: #70
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
2024-03-09 09:57:52 +01:00
521c98fdc2 token is now an writable char thanks to the modulos !
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 22s
2024-03-09 00:46:40 +01:00
ba8b32160d Lots of refactoring
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 2m13s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Has been cancelled
- Removing test mentions in readme
- moving login page as an app
- removing vite broken config
- removing auto-generated and unused vite configuration (base.css)

Overall simplification

(sorry @Wal I kinda destroyed your login page a bit but seems fixable 👉👈)
2024-03-08 23:35:11 +01:00
3571b96cfc Merge pull request 'Fix lang toggle' (#72) from tonitch/front/fix/langSwitch into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m14s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 27s
Reviewed-on: #72
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-08 22:22:19 +01:00
619d2601f1 Fix lang toggle
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 2m4s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
This is not perfect as the toggle is not set to the right position when
the site is reload but as @Wal_ said he would refactor, I just made a
working sample good enough imo
2024-03-08 22:00:15 +01:00
03ff0c0568 Merge pull request 'Ajout register + quelques options' (#63) from wal/frontend/Register into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m15s
Build and test backend / Test-backend (push) Successful in 1m22s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 27s
Reviewed-on: #63
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2024-03-08 21:24:10 +01:00
82a3b152f2 put the params in the body and fixed token issue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-08 20:54:23 +01:00
d2a697904e Merge branch 'master' into wal/frontend/Register
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m2s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
2024-03-08 20:53:10 +01:00
fe34ff4705 Merge pull request 'wtf is it doing there ?' (#71) from tonitch/front/fix/stupidLine into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m10s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 2m21s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
Reviewed-on: #71
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-08 20:46:59 +01:00
de7774047f Merge pull request '[Journal de bord] tokens et authentifications' (#65) from maxonitch/jdb/Authentication into master
Some checks failed
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Has been cancelled
Reviewed-on: #65
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
2024-03-08 20:46:27 +01:00
a524845d06 First draft of the register requests api.
Some checks failed
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Has been cancelled
I don't think it's currently usable but it serve as a stub for when
backend will support it
2024-03-08 20:45:22 +01:00
8e40638b5e adding the right dependencies
Some checks failed
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Has been cancelled
2024-03-08 20:43:47 +01:00
13d9020c7d stub for cursus 2024-03-08 20:43:47 +01:00
8a544515d0 Merge branch 'master' into wal/frontend/Register
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-08 20:23:13 +01:00
481c96bec2 i18n added but not usable
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-08 20:22:00 +01:00
1383814e34 change ASCII to ISO_8859_1
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-08 19:57:38 +01:00
7ff47b6e9c wtf is it doing there ?
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 2m4s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-08 19:23:59 +01:00
fba30cff9e fixed a token encoding issue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m33s
Build and test backend / Test-backend (pull_request) Successful in 1m59s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-08 18:52:10 +01:00
875cfb8b7c Merge pull request 'Max/Backend/loginApi Ajout mock Users et Tokens' (#62) from Max/Backend/loginApi into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m16s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
Reviewed-on: #62
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
2024-03-08 16:50:22 +01:00
0ca5640564 Merge branch 'master' into wal/frontend/Register
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 26s
2024-03-08 16:37:00 +01:00
acfd366fc8 fixed the user constructor issue
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-08 12:00:56 +01:00
4111839852 Requests setup
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m54s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-08 11:54:10 +01:00
e69ece23d0 adding set cookie and set lang (#68)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m9s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 21s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
simple set cookie (je deteste javascript) et un setlang pour le syntastic sugar

Reviewed-on: #68
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-08 11:23:32 +01:00
b42324987b stub for courses (#60)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m5s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
base for the courses api

Reviewed-on: #60
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-07 22:29:07 +01:00
3b31fa794f Merge branch 'Leo/Backend' into Max/Backend/loginApi
Some checks failed
Build and test backend / Build-backend (pull_request) Failing after 1m36s
Build and test backend / Test-backend (pull_request) Failing after 1m35s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-07 20:53:33 +01:00
c33b73a114 - Ajout de "l'url" de l'image dans User 2024-03-07 19:12:48 +01:00
2f2a72bfa0 added the possibility to remove the mocks
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m6s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 21s
2024-03-07 17:29:31 +01:00
6b58c852a2 cleaning
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m57s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 21s
2024-03-07 17:02:19 +01:00
8b35b3dc01 cleaned the login process 2024-03-07 17:01:50 +01:00
93144d0f90 added what is the token and justifications
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m56s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-07 15:43:16 +01:00
3c08022c20 toggle for language(base) + starting inscription menu
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
2024-03-07 15:42:36 +01:00
204e6a9505 Base oauth et spring sessions
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m0s
Build and test backend / Test-backend (pull_request) Successful in 1m55s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-07 15:24:22 +01:00
Wal
d639fa5ee3 Merge pull request 'fixing top level await' (#64) from tonitch/front/fix/top-level-await into wal/frontend/Register
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Reviewed-on: #64
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2024-03-07 15:21:12 +01:00
e1d8e37c52 Merge branch 'master' into Max/Backend/loginApi
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m1s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
2024-03-07 15:15:32 +01:00
8e932b1b67 fixing top level await 2024-03-07 14:51:36 +01:00
dbbf74f2c3 Merge pull request 'tonitch/front/User_API' (#56) from tonitch/front/User_API into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m22s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
Reviewed-on: #56
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2024-03-07 14:12:49 +01:00
4aa15ec72a Merge branch 'master' into wal/frontend/Register
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m59s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 21s
2024-03-07 14:11:32 +01:00
2938707f0f added mocks users with their role as password and token
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m58s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 21s
2024-03-07 00:55:07 +01:00
0e7c18e088 Base for rest api utilisation (#53)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m11s
Build and test backend / Test-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 2m18s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
The restConsumer will be the base, then I will create a js file per
"object" (for instance there will be users.js with all endpoints for
users using the restConsumer.js)

Reviewed-on: #53
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-06 21:38:09 +01:00
886077349c Adding menu button + Cursus
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m56s
Build and test backend / Test-backend (pull_request) Successful in 2m0s
Build and test FrontEnd / Build-frontend (pull_request) Failing after 20s
2024-03-06 21:00:35 +01:00
434cc8dd2b - On objectise tout
- Ajout des relation
2024-03-06 20:05:24 +01:00
d9ec085d2c Inputs setup 2024-03-06 17:41:18 +01:00
4a85a55290 added Token and User Services 2024-03-06 17:38:09 +01:00
37d24c59e7 add generic HttpResponse 2024-03-06 17:37:38 +01:00
5acca4d10d added foreign key to user 2024-03-06 17:37:06 +01:00
b050a74b75 added LoginController Post(/login) 2024-03-06 17:35:49 +01:00
010f9200a7 removed useless line 2024-03-06 17:35:27 +01:00
6a39464f61 /bin/bash: line 1: q: command not found 2024-03-06 17:34:18 +01:00
7222bca6e2 added spring boot security without the login page 2024-03-06 17:30:13 +01:00
6df81a66f2 Fixing i18n path
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m56s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
Build and test backend / Build-backend (push) Successful in 2m5s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 21s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
2024-03-06 14:41:03 +01:00
34a36f8b1e i18n try 2024-03-06 14:35:58 +01:00
2a558e40cb Merge branch 'master' into wal/frontend/Register 2024-03-06 14:23:24 +01:00
3350533e74 Register proto 2024-03-06 14:20:32 +01:00
aaaba0ddf3 User api first draft finished
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
2024-03-06 14:08:39 +01:00
a253a5152d My life is a potato
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m9s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
2024-03-06 11:20:29 +01:00
38ed249150 using unix socket
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m9s
Build and test backend / Test-backend (push) Successful in 1m18s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
deploy to production / deploy-frontend (push) Successful in 20s
deploy to production / deploy-backend (push) Successful in 1m33s
2024-03-06 10:52:11 +01:00
212ab638a2 allow unix socket connection for database in prod
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m3s
Build and test backend / Test-backend (push) Successful in 1m16s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
2024-03-06 10:01:55 +01:00
e158fa1f87 backbone for login
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m58s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-03-06 09:00:55 +01:00
6289be529a package-lock was forgoten 2024-03-06 08:59:08 +01:00
1f69040436 adding patch to restConsumer 2024-03-06 08:59:08 +01:00
56a14a3e8a adding toast on requests 2024-03-06 08:59:06 +01:00
b72c0a8e17 Merge pull request 'LeoMoulin/Backend/Leo' (#55) from LeoMoulin/Backend/Leo into master
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m2s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 21s
deploy to production / deploy-backend (push) Successful in 2m13s
Build and test FrontEnd / Build-frontend (push) Successful in 19s
Reviewed-on: #55
2024-03-05 23:41:59 +01:00
bb0e6783ec correction commit
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m3s
Build and test backend / Test-backend (pull_request) Successful in 1m53s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
2024-03-05 23:34:49 +01:00
57de070eb1 Merge branch 'master' into LeoMoulin/Backend/Leo
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
2024-03-05 20:30:00 +01:00
24a54bdee4 removing useless function & calling reloadLang properly (#52)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m8s
Build and test backend / Test-backend (push) Successful in 1m25s
deploy to production / deploy-frontend (push) Successful in 32s
deploy to production / deploy-backend (push) Successful in 2m17s
Build and test FrontEnd / Build-frontend (push) Successful in 25s
Reviewed-on: #52
Reviewed-by: Maxime <231026@umons.ac.be>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-05 20:28:23 +01:00
d1b4023d92 adding register 2024-03-05 14:58:56 +01:00
c27c3ac9fb - Ajout des champs password et salt dans user
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 2m25s
Build and test backend / Test-backend (pull_request) Successful in 2m1s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 25s
Build and test FrontEnd / Test-frontend (pull_request) Successful in 23s
- Ajout de la table token
- Ajout des foreign keys
2024-03-05 14:14:56 +01:00
837db9aba9 backbone for login 2024-03-05 14:10:13 +01:00
09d5e1c293 Document rest
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m50s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 19s
2024-03-05 11:48:04 +01:00
dcd1fad6ac solve access to /login
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m55s
Build and test backend / Test-backend (pull_request) Successful in 1m49s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
Build and test backend / Build-backend (push) Successful in 2m6s
Build and test backend / Test-backend (push) Successful in 1m23s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m16s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
Vite won't export not specified page, so I specified it in the config.
2024-03-05 10:57:48 +01:00
8c2397c4cf Base for rest api utilisation
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m54s
Build and test backend / Test-backend (pull_request) Successful in 1m52s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 20s
The restConsumer will be the base, then I will create a js file per
"object" (for instance there will be users.js with all endpoints for
users using the restConsumer.js)
2024-03-05 00:15:52 +01:00
cc89d7f5b7 added ResponseEntity and TODOs 2024-03-04 23:35:15 +01:00
36f1ab3203 added .idea/ to .gitignore
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m8s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 21s
deploy to production / deploy-backend (push) Successful in 2m13s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
2024-03-04 21:30:16 +01:00
45bfe08c9a added .idea/ to .gitignore 2024-03-04 21:27:22 +01:00
6c688dab59 added Admin and Secretary 2024-03-04 21:25:44 +01:00
516fc0d5e6 fix last commit
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m7s
deploy to production / deploy-frontend (push) Successful in 22s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-backend (push) Successful in 2m19s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
2024-03-04 20:42:10 +01:00
7abd2a001f relatives position for static api
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m9s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
2024-03-04 20:15:12 +01:00
9850f2145c Fixing the login page availability
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m8s
Build and test backend / Test-backend (push) Successful in 1m24s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 2m20s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
To access the login page you need login.html. Then this page loads the
login.js that generate the login.vue in the div#app (with the '#app')
2024-03-04 19:42:57 +01:00
25fe568148 Convert login.html to Login.vue 2024-03-04 19:42:57 +01:00
672d17cf0e New file for login's style 2024-03-04 19:42:57 +01:00
49196caccc Grid setup frontend 2024-03-04 19:42:57 +01:00
0b0fe9ae78 Table for navigation bars 2024-03-04 19:42:57 +01:00
057d8ff001 Login prototype 2024-03-04 19:42:57 +01:00
684c3095eb - Changement des noms de variables
- Ajout des getters/setters appropriés
- Ajout des constructeur nécessaires
2024-03-03 17:42:26 +01:00
bbe1f9767c Merge remote-tracking branch 'origin/LeoMoulin/Backend/Leo' into LeoMoulin/Backend/Leo 2024-03-03 17:05:09 +01:00
3956037ab5 example backend api with user table 2024-03-02 23:33:48 +01:00
21a42737a2 adding api definition in static files
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m4s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m14s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
2024-03-02 22:19:10 +01:00
2d43707aca Changing name because it's cool...
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m6s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 22s
deploy to production / deploy-backend (push) Successful in 2m12s
Build and test FrontEnd / Build-frontend (push) Successful in 20s
Honestly this commit can be skipped but I want to show-off ^^
2024-03-02 20:09:19 +01:00
f1b3b0dd45 Adding favicon plus perfect clyde
The clyde was good but i'm authistic so I made it perfect (16x16 scaled
up so proportions are perfectly perfect)
2024-03-02 20:09:19 +01:00
512e8a41dd removing action for frontend test
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
2024-03-02 20:09:02 +01:00
1a5f3cf65e Removing vitest 2024-03-02 20:09:02 +01:00
298cdcaae0 Implementation of i18n with documentation
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test FrontEnd / Test-frontend (push) Waiting to run
All files are documented. For further details please read them.
2024-03-02 20:08:02 +01:00
dbe24dbc5f typo
Some checks are pending
Build and test backend / Build-backend (push) Waiting to run
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test FrontEnd / Test-frontend (push) Waiting to run
maxed
2024-03-02 20:07:16 +01:00
1a1baccddd idea of internationalisation in JDB 2024-03-02 20:07:16 +01:00
ba7e9599de Premire journal de bord base
Some checks failed
Build and test backend / Test-backend (push) Waiting to run
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test FrontEnd / Test-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Has been cancelled
Contient le choix des technologies
ainsi que la répartition des taches
2024-03-02 20:04:47 +01:00
fa522eabd3 fixing db
Some checks failed
Build and test backend / Build-backend (push) Successful in 2m6s
Build and test backend / Test-backend (push) Has been cancelled
Build and test FrontEnd / Build-frontend (push) Has been cancelled
Build and test FrontEnd / Test-frontend (push) Has been cancelled
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Has been cancelled
2024-03-02 19:30:26 +01:00
caf11b5b19 Refactoring backend (#42)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m7s
Build and test backend / Test-backend (push) Successful in 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m28s
removing cors fails.
refactoring ping as a proposal for rest endpoints locations

Reviewed-on: #42
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-03-01 18:43:56 +01:00
25019d8b91 Suppression de TeacherOwnerCourse.java et ajout d'un booléen Owned dans TeacherGivenCourse.java 2024-03-01 01:47:11 +01:00
69c3a3b965 Implémentation des différentes classes représentants les tables 2024-02-29 20:08:12 +01:00
0de7b69b1b enable jpa library for managing data
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m57s
Build and test backend / Test-backend (pull_request) Successful in 1m57s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 22s
Build and test FrontEnd / Test-frontend (pull_request) Successful in 22s
Build and test backend / Build-backend (push) Successful in 2m19s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m16s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Build and test FrontEnd / Test-frontend (push) Successful in 23s
2024-02-29 08:53:33 +01:00
7c9fe9235c Example of toaster
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m27s
Build and test backend / Test-backend (push) Successful in 1m21s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Successful in 2m3s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-28 17:57:47 +01:00
56df39b584 [fix] wrong file
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m4s
Build and test backend / Test-backend (push) Successful in 1m15s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m58s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-27 19:15:36 +01:00
4c79b9e51f dependants
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m51s
Build and test backend / Test-backend (push) Successful in 1m19s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m57s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-27 17:16:01 +01:00
6559462f2b docker pipeline
Some checks failed
deploy to production / deploy-frontend (push) Waiting to run
deploy to production / deploy-backend (push) Waiting to run
Build and test FrontEnd / Build-frontend (push) Waiting to run
Build and test FrontEnd / Test-frontend (push) Waiting to run
Build and test backend / Build-backend (push) Successful in 1m55s
Build and test backend / Test-backend (push) Has been cancelled
2024-02-27 17:12:56 +01:00
43adb6d31f database on deploy
Some checks failed
Build and test backend / Build-backend (pull_request) Successful in 1m41s
Build and test backend / Test-backend (pull_request) Successful in 1m43s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 24s
Build and test FrontEnd / Test-frontend (pull_request) Successful in 22s
Build and test backend / Build-backend (push) Successful in 1m52s
Build and test backend / Test-backend (push) Successful in 1m20s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 2m0s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-27 16:55:16 +01:00
9c92e7d1e9 Ajout du CORS Pour le dev local + toastify + exmpl
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m43s
Build and test backend / Test-backend (pull_request) Successful in 1m39s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
Build and test FrontEnd / Test-frontend (pull_request) Successful in 23s
Build and test backend / Build-backend (push) Successful in 1m54s
Build and test backend / Test-backend (push) Successful in 1m15s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 1m58s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
tout est dans le titre
2024-02-27 14:24:26 +01:00
88108918dd adding database support
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m54s
Build and test backend / Test-backend (push) Successful in 1m18s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 1m26s
2024-02-27 12:08:28 +01:00
c0ab074a95 adding fk
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m17s
Build and test backend / Test-backend (push) Successful in 1m16s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m27s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test FrontEnd / Test-frontend (push) Successful in 23s
2024-02-27 08:10:07 +01:00
4f4ed952cc adding base template for working
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m17s
Build and test backend / Test-backend (push) Successful in 1m13s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m24s
Build and test FrontEnd / Build-frontend (push) Successful in 24s
Build and test FrontEnd / Test-frontend (push) Successful in 23s
2024-02-27 00:51:30 +01:00
d8cbbdc94b Removing drone
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m18s
Build and test backend / Test-backend (push) Successful in 1m15s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 1m29s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-27 00:36:52 +01:00
f39cc004ad .
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m19s
Build and test backend / Test-backend (push) Successful in 1m16s
Build and test FrontEnd / Build-frontend (push) Successful in 21s
Build and test FrontEnd / Test-frontend (push) Successful in 21s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Successful in 1m25s
2024-02-27 00:22:22 +01:00
4983b67fbe .
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m18s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 25s
deploy to production / deploy-backend (push) Failing after 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 19:59:23 +01:00
0015763523 .
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m16s
Build and test backend / Test-backend (push) Successful in 1m13s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m21s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 19:51:09 +01:00
f1154713b7 .
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m17s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Failing after 1m21s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 19:29:40 +01:00
883ff19fa3 .
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m20s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 23s
deploy to production / deploy-backend (push) Failing after 1m25s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 18:25:41 +01:00
fdfbd5a948 fk m life
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m20s
Build and test backend / Test-backend (push) Successful in 1m14s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m21s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 23s
2024-02-26 18:17:59 +01:00
b90716ab38 sill am
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m40s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 23s
2024-02-26 17:42:32 +01:00
3f74c5bb07 I am stupid
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m17s
Build and test backend / Test-backend (push) Successful in 1m14s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m21s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 16:52:02 +01:00
c11ad4fa11 wrong file
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m18s
Build and test backend / Test-backend (push) Successful in 1m17s
deploy to production / deploy-frontend (push) Successful in 26s
deploy to production / deploy-backend (push) Failing after 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 21s
2024-02-26 16:45:19 +01:00
5d877c3460 typo
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m19s
Build and test backend / Test-backend (push) Successful in 1m18s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Failing after 1m19s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 16:33:13 +01:00
5691ff1783 Signing
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m16s
Build and test backend / Test-backend (pull_request) Successful in 1m14s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 22s
Build and test FrontEnd / Test-frontend (pull_request) Successful in 21s
Build and test backend / Build-backend (push) Successful in 1m16s
Build and test backend / Test-backend (push) Successful in 1m17s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 15:31:58 +01:00
fbbc6978d5 Deploy backend on push
All checks were successful
Build and test backend / Build-backend (push) Successful in 1m17s
Build and test backend / Test-backend (push) Successful in 1m16s
Build and test FrontEnd / Build-frontend (push) Successful in 23s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 15:25:31 +01:00
bb5d1a6982 Build and push the backend on pr and merge
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m59s
Build and test backend / Test-backend (push) Successful in 1m13s
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
2024-02-26 14:33:39 +01:00
6503af0096 Adding docker entry for backend
All checks were successful
Build and test FrontEnd / Build (pull_request) Successful in 36s
Build and test FrontEnd / Test (pull_request) Successful in 23s
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build (push) Successful in 23s
Build and test FrontEnd / Test (push) Successful in 24s
This allow you to run `docker-compose up` in the backend directory
to run the whole backend in a docker. by default the port is set to 4000
2024-02-26 13:20:03 +01:00
42d9231ef6 Adding dev instructions
All checks were successful
deploy to production / deploy-frontend (push) Successful in 23s
Build and test FrontEnd / Build (push) Successful in 21s
Build and test FrontEnd / Test (push) Successful in 23s
2024-02-23 12:30:12 +01:00
fb6527afd5 base of backend
All checks were successful
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build (push) Successful in 22s
Build and test FrontEnd / Test (push) Successful in 22s
Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Reviewed-on: #29
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-02-23 12:00:36 +01:00
b9fec5e7b4 deploy fix typo
All checks were successful
deploy to production / deploy-frontend (push) Successful in 24s
Build and test FrontEnd / Build (push) Successful in 21s
Build and test FrontEnd / Test (push) Successful in 21s
2024-02-20 11:10:50 +01:00
62136f5060 deploy fix typo
Some checks failed
deploy to production / deploy-frontend (push) Failing after 11s
Build and test FrontEnd / Build (push) Successful in 21s
Build and test FrontEnd / Test (push) Successful in 21s
2024-02-20 11:05:26 +01:00
9ca94668d7 deploy fix typo
Some checks failed
deploy to production / deploy-frontend (push) Failing after 3s
Build and test FrontEnd / Build (push) Successful in 22s
Build and test FrontEnd / Test (push) Successful in 22s
2024-02-20 10:58:38 +01:00
dda321256c frontend-CI (#28)
All checks were successful
Build and test FrontEnd / Build (push) Successful in 22s
Build and test FrontEnd / Test (push) Successful in 21s
Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Reviewed-on: #28
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-02-20 10:55:16 +01:00
85b0be3479 frontend CI (#27)
voilà... normalement tout le ci pour le frontend est bon.. reste plus que le backend

Reviewed-on: #27
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
2024-02-20 09:48:59 +01:00
a795108859 frontend + ci
All checks were successful
deploy to production / deploy-frontend (push) Successful in 47s
2024-02-17 20:58:42 +01:00
3f1c4732ec trying action (#25)
Some checks failed
deploy to production / deploy-frontend (push) Failing after 14s
Reviewed-on: #25
2024-02-17 18:35:50 +01:00
ef4929640d Corrections to api 2023-12-15 15:11:29 +01:00
3abe4cd6ef Bug correction (#20)
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #20
2023-12-15 14:55:46 +01:00
5958b15c84 Adding delete and get to message-id 2023-12-15 14:52:40 +01:00
8648631d32 Put tag guest to DisplayArticle
asked-by: Max
2023-12-15 14:52:40 +01:00
db2003b51a Roles ref problem 2023-12-15 14:52:40 +01:00
6f5f89d954 First api 2023-12-15 14:52:40 +01:00
abef330bd7 class diagram messaging extension (#13)
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #13
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-15 14:36:44 +01:00
4f1a44549b ERB msg done (#14)
# Entity relational diagram

## Messaging extension

```mermaid
%%{init: { "er": {"fontSize": 25}}}%%
erDiagram

%% General
Users

%% Messages
Discussions{
    Integer id PK
    String name
}

Messages{
    Integer id PK
    Integer response FK "Messages"
    String content
}

Discussions ||--o{ Messages: ""
Discussions ||--o{ Users: ""

Messages o|--o{ Messages: "answers"

%% Forums
Forums{
    Integer id PK
    String name
}

Topics{
    Integer id PK
    String subject
    String content
    Boolean locked
}
Answers{
    Integer id PK
    String content
    Boolean anonymous
    TimeStamp creation_time
}

Polls{
    Integer id PK
    enum PollType
}
Options{
    Integer id PK
    String name
}

Forums ||--o{ Users: "Registered"
Forums ||--|| Teacher: "Owner"
Forums ||--|| Course: ""
Forums ||--o{ Topics: ""
Forums ||--o{ Polls: ""

Topics ||--|| Teacher: "Author"
Topics ||--|| Users: "Author"
Topics ||--o{ Answers: ""

Polls ||--o{ Options: ""

Options ||--o{ Votes : ""

Votes }o--|| Users: "Voter"

%% Appointments
Teachers
Appointments{
    Integer id PK
    TIME sent_time
    enum Status
}

Appointments ||--|| Teachers: ""
Appointments ||--|| Users: ""

```

Debucquoy Anthony

Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Reviewed-on: #14
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-15 14:36:10 +01:00
55e095bcc6 small indentation error 2023-12-14 20:58:09 +01:00
26bcb045ed Extension Messagerie (#11)
Voici le use case de messagerie.
et l'interaction overview messagerie.

Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #11
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-14 15:15:39 +01:00
5d8c3d03c5 Extension Requests
Bon les gars je vais pas passer par 4 chemins :
Zǎoshang hǎo zhōngguó xiànzài wǒ yǒu BING CHILLING 🥶🍦 wǒ hěn xǐhuān BING CHILLING 🥶🍦 dànshì sùdù yǔ jīqíng 9 bǐ BING CHILLING 🥶🍦 sùdù yǔ jīqíng sùdù yǔ jīqíng 9 wǒ zuì xǐhuān suǒyǐ…xiànzài shì yīnyuè shíjiān zhǔnbèi 1 2 3 liǎng gè lǐbài yǐhòu sùdù yǔ jīqíng 9 ×3 bùyào wàngjì bùyào cu òguò jìdé qù diànyǐngyuàn kàn sùdù yǔ jīqíng 9 yīn wéi fēicháng hǎo diànyǐng dòngzuò fēicháng hǎo chàbùduō yīyàng BING CHILLING 🥶🍦zàijiàn 🥶🍦

Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #4
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: LeoMoulin <leomoulin125@gmail.com>
Co-committed-by: LeoMoulin <leomoulin125@gmail.com>
2023-12-14 14:37:26 +01:00
95888a4600 Adding role to users (#12)
A user is defined by it's role and should be defined in it's setter and
getter

Closes #8

Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-authored-by: Debucquoy <debucqquoy.anthony@gmail.com>
Reviewed-on: #12
Reviewed-by: Wal <karpinskiwal@gmail.com>
2023-12-14 13:57:06 +01:00
f0f60de12f Ordering Tags (#15)
Fix-issue: #10

Ce pr permet de trier les tags dans un ordre voulu ainsi que de mettre une description aux tags.

Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Reviewed-on: #15
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
2023-12-14 13:56:04 +01:00
351c0dbfb2 Merge pull request 'Ext_publiScientifique' (#5) from Ext_publiScientifique into master
Reviewed-on: #5
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
2023-12-13 15:37:49 +01:00
3e304ca0ac Merge branch 'master' into Ext_publiScientifique 2023-12-13 15:34:36 +01:00
c807568689 Dispay-Article -> DisplayArticle 2023-12-13 14:41:07 +01:00
67552901d6 ajout Display-Article
(et Mat -> RegNo)
2023-12-12 14:36:15 +01:00
dc559cefee added the Ext (scientific articles) tag 2023-12-11 11:27:34 +01:00
9a20462ede Merge branch 'master' into Ext_publiScientifique 2023-12-11 10:45:01 +01:00
05fc134281 Extension Article Scientifique
ajout endpoint dans : secretariat, users, researcher
ajout schemas : article
2023-12-08 17:17:40 +01:00
407b881144 added comment 2023-12-08 13:38:42 +01:00
223 changed files with 22551 additions and 75 deletions

9
.gitattributes vendored Normal file
View File

@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf

View File

@ -0,0 +1,20 @@
name: Build and test backend
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v3
- name: building
run: ./gradlew backend:build -x test

View File

@ -0,0 +1,50 @@
name: deploy to production
run-name: ${{ gitea.actor }} has pushed to production
on:
push:
branches:
- master
workflow_run:
workflows:
- Build and test backend
- Build and test frontend
types:
- completed
workflow_dispatch:
jobs:
deploy-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
working-directory: ./frontend
- run: npm ci
name: clean install
working-directory: ./frontend
- name: building
working-directory: ./frontend
run: npm run build
- name: pushing to the server
working-directory: ./frontend
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 0600 key
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:
- run: echo "The website has been deployed. visit https://clyde.herisson.ovh/"
deploy-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: pushing to the server
run: |
echo "${{ secrets.SSH_KEY }}" > key
chmod 0600 key
scp -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:api/
- name: restarting the backend
run: |
ssh -o "StrictHostKeyChecking=no" -o "LogLevel=ERROR" -i key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} 'cd api/ && sed -i compose.yaml -e "s/8080:8080/4001:8080/" -e "s/8000:8080/4000:8080/" && docker-compose up --force-recreate --build -d'
- run: echo "The backend has been deployed. running at https://clyde.herisson.ovh/api"

View File

@ -0,0 +1,22 @@
name: Build and test FrontEnd
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
Build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
working-directory: ./frontend
- run: npm ci
name: clean install
working-directory: ./frontend
- run: npm run build --if-present
name: build
working-directory: ./frontend

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build
.project
.settings
.idea/

View File

@ -0,0 +1,48 @@
# Journal de bord du 29 février
Ce premier journal de bord permet d'initier une tendance a garder une trace des choix fait lors du dévelopement du
projet de génie logiciel. Ces journaux pourront alors être consultés par la suite, pour la rédaction du rapport.
## Choix des technologies utilisées
### Backend: spring.io
Le backend est imposé, nous devons utiliser spring boots. La courbe d'aprentisage nous semble difficile mais après de
longues documentations nous commençons à comprendre son fonctionnement.
### Frontend: Vue.js
Le frontend n'est pas imposé, nous devons utiliser javascript mais le choix du framework (si utilisé) est libre. Nous
avons pris la recomendation du cours: vue.js qui est un framework simple d'aprentisage et très performant.
#### Librairies
- **Vue3-toastify:** Nous avons opté pour l'utilisation d'une librarie de "notification". cette librairie permet
d'afficher des notifications sur la page. Elle nous est utile autant pour l'application finale que pour le
dévelopement.
### Database: postgresql
C'est une base de données très efficace qui est déjà installé
### VCS: Gitea
C'est une alternative a github mais self-hosted. Nous avons accés à un serveur sur lequel gitea est installé
(https://git.herisson.ovh/).
### CI/CD: Gitea Actions
Gitea a récement implémenter l'équivalent de github actions dans gitea et qui est complètement compatible avec github
actions. Nous avons donc implémentés les test et build en continu lors des pr et merge. Lorsqu'un merge est fait avec la
branche master, le site est instentanément mis à jours (après une dernière verification du build et test) sur l'adresse
http://clyde.herisson.ovh pour le frontent et http://clyde.herisson.ovh/api pour le backend.
## Répartition des taches
Nous nous répartisons les taches par familiarité et préférences avec les différentes partie du projet.
- Wiliam: Frontend visuel
- Anthony: Frontend technique
- Max: Backend Endpoints
- Léo: Backend Data

View File

@ -0,0 +1,36 @@
# Authentification
## Contexte
Le projet demande de pouvoir authentifier les utilisateurs présents. Le but étant de leurs associer un "contexte"
(cours, informations personnelles, ...). Pour que ceux-ci puissent accomplir différentes actions nécéssitantes une
identification (permission, info personelles, ...).
## Méthode
Lorsque qu'un utilisateur se connecte au serveur, nous lui envoyons un token qui sera stocké dans le
navigateur. Ce token est unique à l'utilisateur et pourra être ré-envoyé dans les futures requêtes
pour identifier l'utilisateur.
Ce token est donc une chaine de 64 caractères suivant la norme ISO_8859_1(8bits par cararctère) aléatoires,ce qui est d'après nos recherches suffisant.
De plus une limite de 5 token par utilisateur sera ajoutée de sorte à
1) S'assurer qu'une personne ne noie la base de donnée de tokens.
2) Ajouter une protection supplémentaire pour assurer qu'un token est bien unique à un utilisateur.
## Autres méthodes envisagée
### Oauth2
C'est un protocol d'identification vastement utilisé permettant, en plus d'identifier les requettes,
de gérer leurs permissions. Un utilisateur créen un token peut lui attribuer des permissions
spécifique qui restrainderaients les permissions d'utilisation de ce token. C'est très utile pour
déployer des api de site pouvant notament être accédé par des ordinateurs / bots. Ca n'est en
revanche pas l'objectif du projet et l'option n'a donc pas été retenue
### Spring Sessions / Tomcat sessions
Il aurait été possible de laisser une librairie automatiser les sessions. Malheuresement, celà
implique de devoir se plier au format de la dite librairie. L'implémentation d'un système de gestion
de token maison semblai à la fois, non-imposible et interessant à notre apprentisage. C'est pourquoi
nous n'avons pas utilisé cette option.

View File

@ -0,0 +1,45 @@
# Internationalization (i18n)
L'un des critère du projet est de donner la possibilité aux utilisateur de choisir entre différentes
langues. Minimum 2 sont a implémenter, le français et l'anglais.
## Intention
La gestion des langue au niveau backend peut sembler être une bonne idée aux premier abord car celà
permeterais de laisser la possibilité a différents frontend utilisant la meme api de traduction.
cependant, peu d'éléments venant de la base de données sont traduisible. Nous alons alors opter pour
une internationalization au niveau du frontend. Dans le cas ou un éléments venant du frontend
devrait être traduit, Il suffirait alors de le faire traduire par le frontend directement
## Implémentation
Le frontend va se voir équiper d'une collection de fonctions permettant la traduction. notament
`i18n(key: str) -> str` qui prendrait en entrée une "clé" identifiant la traduction à aller
chercher. Cette clé serait sous la forme : `<context>.<element>`. La fonctions retournera alors la
traduction du texte dans la langue choisie par l'utilisateur. cette langue sera stockée dans les
cookies pour qu'un utilisateur non enregistré puisse naviguer sur le site sans problèmes. Si
l'utilisateur est enregistré elle pourra également être ajouter à son profil pour que la langue soit
mise à jours lors de son prochain passage.
### Base de données de traduction
Les traductions seront rassembler dans fichier txt. Une langue sera présente par fichier et une
traduction par ligne. (Ce format semble être utilisé par certaines librairies de spring. Malgré le
fait que nous ne l'utiliserons finalement pas, ce format semble efficace est facile à utilsier).
Chaque ligne commence par la clé. suivi immédiatement d'un "=". le contenu après ce égale est la
traduction jusqu'au égale.
## Considérations
- Il existe certainemnt des librairies prète à l'emploi de traduction mais celà semble être
relativement simple à implémenter manuellement.
- Dans l'éventualité où nous voudrions implémenter des éléments au milieu d'une traduction (example:
Veuillez vérifier votre addresse mail: `tonitch@herisson.ovh` puis revenir sur le site!). Dans ce
cas nous pouvons utiliser le regex et simplement renseigner ces éléments par \1, \2, \3, ... puis
créer une fonction qui s'occuperais de remplacer ces éléments dans le texte avant de le mettre en
avant.
- Il ne devrait pas etre trop compliqué d'écrire un script qui vérifie que toutes les traductions
sont présente dans tout les fichiers en vérifiant que toutes les clés d'un fichiers sont présente.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
# Entity relational diagram
## Messaging extension
```mermaid
%%{init: { "er": {"fontSize": 25, "stroke": "black" }}}%%
erDiagram
%% General
Users
%% Messages
Discussions{
Integer id PK
String name
}
Messages{
Integer id PK
Integer response FK "Messages"
String content
}
Discussions ||--o{ Messages: ""
Discussions ||--o{ Users: ""
Messages o|--o{ Messages: "answers"
%% Forums
Forums{
Integer id PK
String name
Integer course FK "Course"
}
Topics{
Integer id PK
String subject
String content
Boolean locked
}
Answers{
Integer id PK
String content
Boolean anonymous
TimeStamp creation_time
}
Polls{
Integer id PK
enum PollType
}
Options{
Integer id PK
String name
}
Forums ||--o{ Users: "Registered"
Forums ||--|| Teacher: "Owner"
Forums ||--o{ Topics: ""
Forums ||--o{ Polls: ""
Topics ||--|| Teacher: "Author"
Topics ||--|| Users: "Author"
Topics ||--o{ Answers: ""
Polls ||--o{ Options: ""
Options ||--o{ Votes : ""
Votes }o--|| Users: "Voter"
%% Appointments
Teacher
Appointments{
Integer id PK
Integer teacher FK "Teacher"
TIME sent_time
enum Status
}
Appointments ||--|| Users: ""
```
Debucquoy Anthony

View File

@ -11,8 +11,9 @@ extension_messagerie.pdf:use_case_messagerie.tex extension_messagerie.bbl extens
use_case_messagerie.tex: use_case_messagerie.uml
plantuml -tlatex:nopreamble use_case_messagerie.uml
image: use_case_messagerie.uml interaction_diagram.uml
image: use_case_messagerie.uml interaction_diagram.uml class.uml
plantuml $^
mmdc -i ERD.md -o ERD.png
extension_messagerie.bbl: extension_messagerie.bcf
biber extension_messagerie
@ -24,6 +25,7 @@ clean:
latexmk -C
rm -f use_case_messagerie.tex
rm -f extension_messagerie.{bbl,run.xml}
rm -f class.tex
run: extension_messagerie.pdf
xdg-open $<

View File

@ -0,0 +1,86 @@
@startuml
title Class diagram for Messaging extension
package Messages {
class Message{
content: String
response: Message
respond(User, String)
}
class Discussion{
name: String
users: ArrayList<User>
invite(User)
sendMessage(User, String)
}
Discussion *-- Message
}
package Forums {
class Forum{
name: String
Owner: Teacher
Registered: ArrayList<User>
{static} createForum(Course): Forum
createTopic(String): Topic
createPoll(String, PollType, ArrayList<Option>): Poll
}
class Topic{
subject: String
author: Teacher
content: String
answer(User, String): Answer
lock(Boolean)
}
class Answer{
author: User
content: String
anonymous: Boolean
remove()
}
class Poll{
options: ArrayList<Option>
type: PollType
answer(User, Option): Vote
addOption(Option)
}
class Option{
name: String
}
class Vote{
voter: User
}
enum PollType {
ALLOW_NEW_OPTIONS
ALLOW_MULTIPLE_CHOICE
}
note "Change the behaviour of poll" as N
Forum *-l- Topic
Topic *-l- Answer
Topic <|-d- Poll
Poll *-l- Option
Option "1..*" -d-x Vote
Poll *-- Vote
Poll -- PollType
PollType .r. N
}
package Appointments{
class Appointment{
date: Date
teacher: Teacher
student: Student
{static} Appointment(Student, Teacher, Date)
accept()
refuse()
propose(Date)
export(): File
}
}
Appointments -[hidden]d- Messages
@enduml

View File

@ -3,6 +3,7 @@
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{dirtytalk}
\usepackage{tikz}
\usepackage{biblatex}
@ -20,77 +21,74 @@
\resizebox{345pt}{!}{
\input{./use_case_messagerie.tex}
}
\caption{Use Case Diagram of the messaging extension}
\caption{Use Case Diagram pour l'extension de messagerie}
\label{fig:useCase:msg_ext}
\end{figure}
In the diagram Figure~\ref{fig:useCase:msg_ext},
the <<extend>> definition is not pulled from the "Genie logiciel" course
of the University of Mons (UMONS). It is in fact the definition from
the Dan Pilone's pocket reference \cite{Pilone2006-fn}.
Dans le diagramme \ref{fig:useCase:msg_ext}, la définition du <<extend>> est tirée du livre:
"uml Pocket reference" de Dan Pilone \cite{Pilone2006-fn}.
\say{Use case extension encapsulates a distinct flow of events
that are not considered part of the normal or basic flow.
They are not necessarily exceptional conditions.}
\subsection{Answer topic}
The user should be able to answer to a topic created by a teacher.
This answer will depend on the type of topic. The answer could be a selection on a poll,
a private answer (which mean that the answer is not visible to the other users except to the professor).
The answer could finally be a basic answer to the topic and be visible to other users browsing the topic.
L'utilisateur doit être capable de répondre à un topic crée par l'enseignant.
Cette réponse va dépendre du type de topic. Elle peut être une réponse à un questionnaire,
un message privé (qui ne serait pas visible par les autres utilisateur excepté l'enseignant) ou
une simple réponse qui serait visible par tous.
\subsection{Create discutions}
The user can select multiple users and group them into a discussion.
In this discussion, users will be able to exchange messages readable by
every other members of the discussion
L'utilisateur peut séléctionner plusieurs utilisateurs et les include dans un groupe de discussion.
Dans cette discussion, les utilisateurs peuvent échanger des messages lisible par les autres membres du
groupe
\subsubsection{Send messages}
Allow the creation of a message in a discussion.
The text sent to others shall be received by other users
and these users shall be notified of this message by the notification
system.
Permet la création d'un message dans une discusison.
Ce message va être reçu par les autres utilisateur et ceux-ci vont être notifié
du message par le système de notification
\subsection{Ask appointment}
A student can ask for an appointment to a teacher.
In this request, the student will have to give a date, a time
and a subject he want to propose to the teacher.
Un étudiant peut demander un rendes-vous à un enseignant.
Dans cette demande, l'étudiant doit donner une date qui lui convient pour ce rendez-vous
ainsi qu'une raison à ce rendez-vous.
\subsubsection{Export to calendar}
When an appointment is made. The program can export the event
to an open format that can be read by calendar software to add
the event to the user's calendar.
Quand un rendez-vous est crée, Le programme peut exporter l'événement dans un
format libre qui pourra être lu par les programme de gestions de planning.
\subsection{Manage appointment}
When a teacher received an appointment, he is able to
validate, deny or propose a new appointment schedule to the
student.
Quand un enseignant reçois une demande de rendez-vous,
il a la possibilité de valider/refuser ou de proposer un nouveau rendez-vous
à l'étudiant
\subsubsection{Propose new appointment}
If the teacher can't attend to an appointment because of his
schedule, he can make a new time proposal and send it to
the student. The student then receive a notification of
the proposed modifications.
Si l'enseignant n'est pas disponible pour le rendez-vous proposé,
il peut alors proposer un nouveau créneau horaire et l'envoyer à l'étudiant.
L'étudiant reçois alors une notification du nouveau créneau horaire.
\subsection{Create forum}
The teacher can create a new forum under a specific course
The new forum will then make every student of this course
follow the forum and its topic.
L'enseignant peut créer un nouveau forum lié à un cours.
Ce nouveau forum enregistrera les étudiant du cours automatiquement.
\subsubsection{Post topics}
The teacher can post a new topic inside a forum to let
the student know of something specific or to ask a question to
them.
L'enseignant peut envoyer un topic dans un forum pour préciser quelque chose aux étudiants
ou pour poser une questions
\subsubsection{Post poll}
When posting a topic to a forum, the teacher can choose to
make the post as a poll. In that case, student will have to vote
for one of the options or if allowed by the teacher, create a new option.
Lors d'un post, il est possible de choisir de créer un questionnaire à choix multiples ou non.
Dans ce cas, les étudiants vont devoir voter pour l'une des options proposée ou potentiellement
crée une nouvelle option.
\printbibliography

View File

@ -1,23 +1,19 @@
@startuml
note
Appointment
endnote
mainframe Appointment
start
:Asking Apointment]
:Asking Appointment]
repeat
if (accepted) is (yes) then
:Export to calendar]
stop
else (no)
:Propose new apointment]
:Propose new appointment]
endif
@enduml
@startuml
note
Messaging
endnote
mainframe Messaging
start
split
:Create Discution]
@ -31,10 +27,7 @@ stop
@enduml
@startuml
note
Forum
endnote
mainframe Forum
start
:Forum Creation]

View File

@ -5,14 +5,13 @@ left to right direction
:Student: as s
:Teacher: as t
package "Messagerie"{
(Answer topics) as at
(Ask appointement) as aa
(Create Discution) as cd
(Ask appointment) as aa
(Create Discussion) as cd
(Create Forum) as cf
(Manage appointement) as ma
(Manage appointment) as ma
s -- at
s -- aa
@ -32,7 +31,7 @@ cf <-- pt : << include >>
pt <|-- (Post poll)
cd <-- (Send messages) : << include >>
ma <-- (Propose new appointment) : << exlude>> \n [refuse]
ma <-- (Propose new appointment) : << extends >> \n [refuse]
}

41
README.md Normal file
View File

@ -0,0 +1,41 @@
# Clyde project
## Signature
Projet du groupe 01:
- Debucquoy Anthony: Extension messagerie
- Maxime Bartha: Extension publication scientifique
- William Karpinski: Extension gestion des horaires
- Léo Moulin: Extension inscription des étudiants
## Running
Le projet peut être lancé grace à docker compose.
```sh
$ docker compose up
```
Dans le cas ou vous modifiers des fichiers, pour éviter que les images de docker soient recrées avec les changement
```sh
$ docker compose up --force-recreate --build
```
## Dévelopement
Dans le cas ou vous êtes dans une phase de développement, il est plus simple d'utiliser gradle pour lancer le backend et frontend dans un mode de développement.
**Attention**: Ce mode n'est pas fait pour être utilisé en production!
```sh
$ ./gradlew run --parallel
```
permet de lancer le frontend sur [http://localhost:5173](http://localhost:5173) ansi que le frontend sur [http://localhost:8080](http://localhost:8080)
Ceci requière également docker pour lancer une instance de postgresql pris en charge par spring.
Il est possible de se passer entièrement de docker en supprimant la dépendance dans le fichier `backend/build.gradle.kts`: ~~`developmentOnly("org.springframework.boot:spring-boot-docker-compose")`~~
Il est alors nécéssaire d'avoir une instance de postgresql tournant sur `localhost:5432` avec une table `clyde`, utilisateur: `devel` et password: `devel`
(cette configuration peut également être changée dans le fichier resources/application.properties de spring)

39
backend/.gitignore vendored Normal file
View File

@ -0,0 +1,39 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
/cdn

15
backend/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
## Building phase
FROM gradle:jdk21-alpine AS BUILD
WORKDIR /backend
COPY . .
RUN gradle build -x test
## Running Phase
FROM eclipse-temurin:21-jdk-alpine
WORKDIR /backend
VOLUME /cdn
# ENV SPRING_PROFILES_ACTIVE=prod
COPY --from=BUILD /backend/build/libs/Clyde-0.0.1-SNAPSHOT.jar /backend/app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/backend/app.jar"]

49
backend/build.gradle.kts Normal file
View File

@ -0,0 +1,49 @@
plugins {
java
id("org.springframework.boot") version "3.2.2"
id("io.spring.dependency-management") version "1.1.4"
}
group = "ovh.herisson"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_21
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("com.kohlschutter.junixsocket:junixsocket-core:2.9.0")
// implementation("org.springframework.session:spring-session-jdbc")
developmentOnly("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql")
testImplementation("io.rest-assured:rest-assured")
testImplementation("org.hamcrest:hamcrest")
}
tasks.register("run") {
dependsOn(tasks.bootRun)
}
tasks.withType<Test> {
useJUnitPlatform()
}

9
backend/compose.yaml Normal file
View File

@ -0,0 +1,9 @@
services:
postgres:
image: 'postgres:latest'
environment:
- 'POSTGRES_DB=clyde'
- 'POSTGRES_USER=devel'
- 'POSTGRES_PASSWORD=devel'
ports:
- '5442:5432'

View File

@ -0,0 +1,13 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.6/userguide/multi_project_builds.html in the Gradle documentation.
*/
plugins {
// Apply the foojay-resolver plugin to allow automatic download of JDKs
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}
rootProject.name = "Clyde"

View File

@ -0,0 +1,13 @@
package ovh.herisson.Clyde;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
public class ClydeApplication {
public static void main(String[] args) {
SpringApplication.run(ClydeApplication.class, args);
}
}

View File

@ -0,0 +1,34 @@
package ovh.herisson.Clyde.DTO.Msg;
/******************************************************
* @file DiscussionDTO.java
* @author Anthony Debucquoy
* @scope Extension messagerie
*
* File to format a discussion using messageDTO
******************************************************/
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.Data;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Discussion;
import ovh.herisson.Clyde.DTO.Msg.MessagesDTO;
@Data
@AllArgsConstructor
public class DiscussionDTO {
private long id;
private String name;
private List<User> members;
private List<MessagesDTO> msgs;
public static DiscussionDTO construct(Discussion d, User u){
List<MessagesDTO> msgsdto = new ArrayList<>();
d.getMsgs().forEach(x -> msgsdto.add(MessagesDTO.construct(x, u)));
return new DiscussionDTO(d.getId(), d.getName(), d.getMembers(), msgsdto);
}
}

View File

@ -0,0 +1,33 @@
package ovh.herisson.Clyde.DTO.Msg;
/******************************************************
* @file MessagesDTO.java
* @author Anthony Debucquoy
* @scope Extension messagerie
*
* File to Format the response adding the sender field
******************************************************/
import lombok.AllArgsConstructor;
import lombok.Data;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Message;
import java.util.Date;
@Data
@AllArgsConstructor
public class MessagesDTO {
private long id;
private String content;
private User author;
private boolean sender;
private Date created;
//TODO: Attachment
public static MessagesDTO construct(Message m, User user){
boolean sender = false;
if(m.getAuthor().equals(user))
sender = true;
return new MessagesDTO(m.getId(), m.getContent(), m.getAuthor(), sender, m.getCreated());
}
}

View File

@ -0,0 +1,63 @@
package ovh.herisson.Clyde.DTO.ScientificPublications;
/******************************************************
* @file ResearchDTO.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Research format to return to front (without author's password)
******************************************************/
import lombok.Data;
import ovh.herisson.Clyde.Tables.ScientificPublications.Access;
import ovh.herisson.Clyde.Tables.ScientificPublications.PaperType;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@Data
public class ResearchDTO {
private long id;
private String title;
private ResearcherDTO researcher;
private final Set<ResearcherDTO> coAuthors;
private Date releaseDate;
private PaperType paperType;
private String pdfLocation;
private String bibTexLocation;
private String language;
private Access access;
private String domain;
private String summary;
private long views;
private ResearchDTO(String title, ResearcherDTO researcherDTO, Date releaseDate, PaperType paperType, String pdfLocation, String language, Access access, String domain, String bibTexLocation, String summary, Set<Researcher> coAuthors, long id, long views) {
this.title = title;
this.researcher = researcherDTO;
this.releaseDate = releaseDate;
this.paperType = paperType;
this.pdfLocation = pdfLocation;
this.language = language;
this.access = access;
this.domain = domain;
this.summary = summary;
this.id = id;
this.bibTexLocation = bibTexLocation;
this.coAuthors = new HashSet<>();
for (Researcher coAuthor: coAuthors) {
this.coAuthors.add(ResearcherDTO.construct(coAuthor));
}
this.views = views;
}
public static ResearchDTO construct(Research research){
return new ResearchDTO(research.getTitle(), ResearcherDTO.construct(research.getAuthor()), research.getReleaseDate(),
research.getPaperType(),research.getPdfLocation(),research.getLanguage(),research.getAccess(),
research.getDomain(),research.getBibTexLocation(), research.getSummary(), research.getCoAuthors(),research.getId(), research.getViews());
}
}

View File

@ -0,0 +1,38 @@
package ovh.herisson.Clyde.DTO.ScientificPublications;
/******************************************************
* @file ResearcherDTO.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Researcher Format to return to front (without user password)
******************************************************/
import lombok.Data;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.Map;
@Data
public class ResearcherDTO {
private long id;
private Map<String,Object> user;
private String site;
private String domain;
private String orcidId;
private ResearcherDTO(long id, Map<String ,Object> user, String site,String domain,String orcidId){
this.domain = domain;
this.orcidId = orcidId;
this.site = site;
this.user = user;
this.id = id;
}
public static ResearcherDTO construct(Researcher researcher){
return new ResearcherDTO(researcher.getId(), ProtectionService.userWithoutPassword(researcher.getUser()),researcher.getSite(),
researcher.getDomain(),researcher.getOrcidId());
}
}

View File

@ -0,0 +1,93 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ScientificPublications.ResearchesService;
import ovh.herisson.Clyde.Tables.Applications;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class ApplicationsController {
AuthenticatorService authServ;
ResearchesService researchesServ;
public ApplicationsController(AuthenticatorService authServ, ResearchesService researchesServ){
this.researchesServ = researchesServ;
this.authServ = authServ;
}
/** return a list of authorized applications.
* depends on the token
*/
@GetMapping("/apps")
public ResponseEntity<Iterable<Applications>> getAuthorizedApps(@RequestHeader("Authorization") String token){
return new ResponseEntity<>(getAuthorizedApplications(token), HttpStatus.OK);
}
@GetMapping("/apps/{identifier}")
public ResponseEntity<Boolean> getAppAuthorization(@PathVariable Applications identifier, @RequestHeader("Authorization") String token){
if (getAuthorizedApplications(token).contains(identifier)){
return new ResponseEntity<>(true, HttpStatus.OK);
}
return new ResponseEntity<>(false, HttpStatus.OK);
}
public ArrayList<Applications> getAuthorizedApplications(String token){
ArrayList<Applications> authorizedApps = new ArrayList<>();
//if unAuthed
authorizedApps.add(Applications.Login);
authorizedApps.add(Applications.ListResearches);
authorizedApps.add(Applications.Schedule);
User user = authServ.getUserFromToken(token);
if(user == null)
return authorizedApps;
// if authed
authorizedApps.add(Applications.Profile);
if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Student,Role.Admin},token)) {
authorizedApps.add(Applications.Msg);
authorizedApps.add(Applications.Forum);
authorizedApps.add(Applications.Rdv);
}
if(!authServ.isNotIn(new Role[]{Role.Teacher,Role.Admin},token))
authorizedApps.add(Applications.ManageOwnedLessons);
//if Teacher or Secretary or Admin add ManageCourses App
if (!authServ.isNotIn(new Role[]{Role.Teacher,Role.Secretary,Role.Admin},token))
authorizedApps.add(Applications.ManageCourses);
if (!authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin, Role.Teacher},token)){
authorizedApps.add(Applications.Requests);
authorizedApps.add(Applications.StudentsList);}
if (researchesServ.getResearcherByUser(user) != null)
authorizedApps.add(Applications.ManageResearcherProfile);
if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token)){
authorizedApps.add(Applications.UsersList);
authorizedApps.add(Applications.ManageSchedules);
authorizedApps.add(Applications.LessonRequests);
authorizedApps.add(Applications.CreateUser);
}
if (!authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin, Role.InscriptionService},token)){
authorizedApps.add(Applications.Payments);}
return authorizedApps;
}
}

View File

@ -0,0 +1,174 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CurriculumCourseRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class CourseController {
private final CourseService courseServ;
private final TeacherCourseService teacherCourseServ;
private final AuthenticatorService authServ;
private final UserService userService;
private final CurriculumService curriculumService;
private final UserCurriculumService userCurriculumService;
private final CurriculumCourseRepository curriculumCourseRepository;
private final CurriculumCourseService curriculumCourseService;
public CourseController(CourseService courseServ, TeacherCourseService teacherCourseServ, AuthenticatorService authServ, UserService userService, CurriculumService curriculumService, UserCurriculumService userCurriculumService, CurriculumCourseRepository curriculumCourseRepository, CurriculumCourseService curriculumCourseService) {
this.courseServ = courseServ;
this.teacherCourseServ = teacherCourseServ;
this.authServ = authServ;
this.userService = userService;
this.curriculumService = curriculumService;
this.userCurriculumService = userCurriculumService;
this.curriculumCourseRepository = curriculumCourseRepository;
this.curriculumCourseService = curriculumCourseService;
}
@GetMapping("/course/{id}")
public ResponseEntity<HashMap<String,Object>> getCourse(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.getUserFromToken(token) == null)
return new UnauthorizedResponse<>(null);
Course foundCourse = courseServ.findById(id);
if (foundCourse == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.courseWithoutPassword(foundCourse), HttpStatus.OK);
}
@GetMapping("/courses")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllCourses(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.coursesWithoutPasswords(courseServ.findAll()),HttpStatus.OK);
}
@GetMapping("/courses/owned")
public ResponseEntity<Iterable<HashMap<String ,Object>>> getOwnedCourses(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.coursesWithoutPasswords(courseServ.findOwnedCourses(authServ.getUserFromToken(token))),HttpStatus.OK);
}
@GetMapping("/course/{id}/assistants")
public ResponseEntity<Iterable<HashMap<String,Object>>> getCourseAssistants(@RequestHeader("Authorization")String token, @PathVariable long id){
if (authServ.getUserFromToken(token) == null)
return new UnauthorizedResponse<>(null);
Iterable<User> assistants = teacherCourseServ.findCourseAssistants(courseServ.findById(id));
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(assistants),HttpStatus.OK);
}
@PostMapping("/course/curriculum/{id}")
public ResponseEntity<Map<String ,Object>> postCourse(@RequestHeader("Authorization") String token,
@RequestBody Course course,@PathVariable long id)
{
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
return new UnauthorizedResponse<>(null);
Course createdCourse = courseServ.save(course);
Curriculum curriculum = curriculumService.findById(id);
if (createdCourse == null || curriculum == null)
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
CurriculumCourse curriculumCourse = new CurriculumCourse(curriculum,course);
curriculumCourseService.save(curriculumCourse);
return new ResponseEntity<>(ProtectionService.courseWithoutPassword(createdCourse), HttpStatus.CREATED);
}
@PatchMapping("/course/{id}")
public ResponseEntity<Course> patchCourse(@RequestHeader("Authorization") String token,
@RequestBody Map<String,Object> updates,
@PathVariable long id)
{
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher,Role.Secretary}, token))
return new UnauthorizedResponse<>(null);
if (!courseServ.modifyData(id, updates, authServ.getUserFromToken(token).getRole()))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/course/{id}")
public ResponseEntity<String> postTeachers(@RequestHeader("Authorization") String token,
@RequestBody Iterable<Long> teacherIds,
@PathVariable Long id)
{
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
return new UnauthorizedResponse<>(null);
if (!teacherCourseServ.saveAll(teacherIds,courseServ.findById(id)))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.OK);
}
@DeleteMapping("course/{id}")
public ResponseEntity<String> deleteUser(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
return new UnauthorizedResponse<>(null);
Course toDelete = courseServ.findById(id);
if (toDelete == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
courseServ.delete(courseServ.findById(id));
return new ResponseEntity<>(HttpStatus.OK);
}
//Get all the courses followed by an user
@GetMapping("/usercourses")
public ResponseEntity<List<Course>> getAllUserCourses(@RequestHeader("Authorization") String token){
User u = authServ.getUserFromToken(token);
//We get all the actual curriculums of the user
List<UserCurriculum> userCurricula = userCurriculumService.findByStudentAndActual(u, true);
List<Course> toReturn = new ArrayList<>();
//We iterate through all the curriculums and we extract the courses
for (int i = 0; i < userCurricula.size(); i++){
curriculumCourseRepository.findCoursesByCurriculum(userCurricula.get(i).getCurriculum()).forEach((item) -> {
//We need this to eliminate clones because a course can belong to several curriculums
if(!toReturn.contains(item)){
toReturn.add(item);
}
});
}
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
}

View File

@ -0,0 +1,139 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Tables.*;
import java.util.HashMap;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class CurriculumController {
private final CurriculumService curriculumServ;
private final CourseService courseServ;
private final AuthenticatorService authServ;
private final UserCurriculumService userCurriculumServ;
private final CurriculumCourseService curriculumCourseServ;
private final InscriptionRepository ir;
private final UserService userServ;
private final ExternalCurriculumRepository ecr;
public CurriculumController(CurriculumService curriculumServ, CourseService courseServ, AuthenticatorService authServ, UserCurriculumService userCurriculumServ, CurriculumCourseService curriculumCourseServ, InscriptionRepository ir, UserService userServ, ExternalCurriculumRepository ecr){
this.curriculumServ = curriculumServ;
this.courseServ = courseServ;
this.authServ = authServ;
this.userCurriculumServ = userCurriculumServ;
this.curriculumCourseServ = curriculumCourseServ;
this.ir = ir;
this.userServ = userServ;
this.ecr = ecr;
}
@GetMapping("/curriculum/{id}")
public ResponseEntity<Map<String,Object>> findById(@PathVariable long id){
Curriculum foundCurriculum = curriculumServ.findById(id);
if (foundCurriculum == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(foundCurriculum), HttpStatus.OK);
}
@GetMapping("/curriculum")
public ResponseEntity<Map<String ,Object>> findSelfCurriculum(@RequestHeader("Authorization") String token){
if (authServ.getUserFromToken(token) == null)
return new UnauthorizedResponse<>(null);
Curriculum curriculum = userCurriculumServ.findByUser(authServ.getUserFromToken(token));
if (curriculum == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(curriculumCourseServ.getDepthCurriculum(curriculum),HttpStatus.OK);
}
@GetMapping("/course/curriculum/{id}")
public ResponseEntity<Iterable<Curriculum>> getCurriculumsByCourse(@RequestHeader("Authorization") String token, @PathVariable long id){
if(authServ.isNotIn(new Role[]{Role.Admin, Role.Secretary},token))
return new UnauthorizedResponse<>(null);
Course course = courseServ.findById(id);
if(course == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
Iterable<Curriculum> curriculum = curriculumCourseServ.findCurriculumByCourses(course);
return new ResponseEntity<>(curriculum, HttpStatus.OK);
}
//Return the list of all curicullums of an user
@GetMapping("/onescurriculum/{userId}")
public ResponseEntity<Map<String ,Object>> findOnesCurriculum(@RequestHeader("Authorization") String token, @PathVariable String userId){
if (authServ.getUserFromToken(token) == null)
return new UnauthorizedResponse<>(null);
User u = userServ.getUserById(Long.parseLong(userId));
HashMap<String,Object> toReturn = userCurriculumServ.findAllCurriculumByStudent(u);
if (toReturn == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(toReturn,HttpStatus.OK);
}
@GetMapping("/curriculums")
public ResponseEntity<Iterable<Map<String, Object>>> findAllIndDepth(){
return new ResponseEntity<>(curriculumCourseServ.getAllDepthCurriculum(),HttpStatus.OK);
}
@PostMapping("/curriculum")
public ResponseEntity<Curriculum> postCurriculum(@RequestHeader("Authorization") String token,@RequestBody Curriculum curriculum){
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(curriculumServ.save(curriculum),HttpStatus.CREATED);
}
@PostMapping("/curriculum/{id}")
public ResponseEntity<String> postCourseToCurriculum(@RequestHeader("Authorization") String token,
@RequestBody long coursesId,
@PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
CurriculumCourse curriculumCourse = new CurriculumCourse(curriculumServ.findById(id), courseServ.findById(coursesId));
if(curriculumCourse.getCourse() == null || curriculumCourse.getCurriculum() == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
curriculumCourseServ.save(curriculumCourse);
return new ResponseEntity<>(HttpStatus.OK);
}
@DeleteMapping("/curriculum/{id}")
public ResponseEntity<String > deleteCurriculum(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token))
return new UnauthorizedResponse<>(null);
Curriculum toDelete = curriculumServ.findById(id);
if (toDelete == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
curriculumServ.delete(toDelete);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,62 @@
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class ExternalCurriculumController {
public final ExternalCurriculumRepository ecr;
public final InscriptionRepository inscriptionRepository;
public final UserRepository userRepository;
public ExternalCurriculumController(ExternalCurriculumRepository ecr, InscriptionRepository inscriptionRepository, UserRepository userRepository) {
this.ecr = ecr;
this.inscriptionRepository = inscriptionRepository;
this.userRepository = userRepository;
}
//everyone can post some externalcurriculums (the validity of the elements is assured by the inscription service)
@PostMapping("/externalcurriculum")
public ResponseEntity<ExternalCurriculum> postExternalCurriculum(@RequestBody Map<String, Object> externalCurrInfos){
//An external curriculum can either be linked to an User or to an InscriptionRequest
InscriptionRequest ir = null;
User user = null;
if (externalCurrInfos.get("inscriptionRequestId") != null){
ir = inscriptionRepository.findById((Integer) externalCurrInfos.get("inscriptionRequestId"));
}else{
user = userRepository.findById((Integer) externalCurrInfos.get("userRegNo"));
}
ExternalCurriculum toSave = new ExternalCurriculum(ir, (String) externalCurrInfos.get("school"),(String) externalCurrInfos.get("formation"),(String) externalCurrInfos.get("completion"), (Integer)externalCurrInfos.get("startYear"), (Integer)externalCurrInfos.get("endYear"), (String)externalCurrInfos.get("justifdocUrl"), user);
return new ResponseEntity<>(ecr.save(toSave), HttpStatus.OK);
}
@GetMapping("/externalcurriculum/{inscReqId}")
public ResponseEntity<ArrayList<ExternalCurriculum>> getExternalCurrListByInscrReq(@PathVariable long inscReqId){
InscriptionRequest ir = inscriptionRepository.findById(inscReqId);
ArrayList<ExternalCurriculum> toReturn = ecr.getExternalCurriculumByInscriptionRequest(ir);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping("/externalcurriculumbyuser/{userId}")
public ResponseEntity<ArrayList<ExternalCurriculum>> getExternalCurrByUser(@PathVariable long userId){
User user = userRepository.findById(userId);
ArrayList<ExternalCurriculum> toReturn = ecr.getExternalCurriculumByUser(user);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
}

View File

@ -0,0 +1,136 @@
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.RequestState;
import ovh.herisson.Clyde.Tables.Role;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class InscriptionController {
private final InscriptionService inscriptionServ;
private final AuthenticatorService authServ;
private final CurriculumRepository curriculumRepository;
public InscriptionController(InscriptionService inscriptionServ, AuthenticatorService authServ, CurriculumRepository curriculumRepository){
this.inscriptionServ = inscriptionServ;
this.authServ = authServ;
this.curriculumRepository = curriculumRepository;
}
@GetMapping("/requests/register")
public ResponseEntity<Iterable<Map<String,Object>>> getAllRequests(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService, Role.Teacher},token))
return new UnauthorizedResponse<>(null);
Iterable<InscriptionRequest> inscriptionRequests = inscriptionServ.getAll();
return new ResponseEntity<>(ProtectionService.requestsWithoutPasswords(inscriptionRequests), HttpStatus.OK);
}
@GetMapping("/request/register/{id}")
public ResponseEntity<Map<String,Object>> getById(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService, Role.Teacher},token))
return new UnauthorizedResponse<>(null);
InscriptionRequest foundInscriptionRequest = inscriptionServ.getById(id);
if (foundInscriptionRequest == null)
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(foundInscriptionRequest), HttpStatus.OK);
}
@PatchMapping("/request/register/{id}")
public ResponseEntity<InscriptionRequest> changeRequestState(@PathVariable long id,
@RequestHeader("Authorization") String token,
@RequestBody RequestState state)
{
if (authServ.isNotIn(new Role[]{Role.InscriptionService,Role.Admin},token))
return new UnauthorizedResponse<>(null);
if (!inscriptionServ.modifyState(id, state))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.OK);
}
@DeleteMapping("/request/register/{id}")
public ResponseEntity<String > deleteRequest(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService}, token))
return new UnauthorizedResponse<>(null);
InscriptionRequest toDelete = inscriptionServ.getById(id);
if (toDelete == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
inscriptionServ.delete(toDelete);
return new ResponseEntity<>(HttpStatus.OK);
}
//Allow teacher or admin to accept or refuse the equivalence
@PatchMapping("/request/registerequiv/{id}/{newstate}")
public ResponseEntity<Object> editRegisterEquiv(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newstate){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher}, token))
return new UnauthorizedResponse<>(null);
InscriptionRequest toEdit = inscriptionServ.getById(id);
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (toEdit.getEquivalenceState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
toEdit.setEquivalenceState(newstate);
inscriptionServ.save(toEdit);
if (toEdit.getState() == RequestState.Accepted && (toEdit.getEquivalenceState() == RequestState.Accepted || toEdit.getEquivalenceState() == RequestState.Unrequired))
{
inscriptionServ.createUser(toEdit);
}
return new ResponseEntity<>(HttpStatus.OK);
}
@PatchMapping("/request/registerequivimpose/{id}/{cursusid}")
public ResponseEntity<Object> editRegisterEquiv(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable long cursusid){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher}, token))
return new UnauthorizedResponse<>(null);
InscriptionRequest toEdit = inscriptionServ.getById(id);
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (toEdit.getEquivalenceState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
//We impose a curriculum
Curriculum curriculum = curriculumRepository.findById(cursusid);
toEdit.setCurriculumId(curriculum.getCurriculumId());
toEdit.setEquivalenceState(RequestState.Accepted);
inscriptionServ.save(toEdit);
if (toEdit.getState() == RequestState.Accepted && (toEdit.getEquivalenceState() == RequestState.Accepted || toEdit.getEquivalenceState() == RequestState.Unrequired))
{
inscriptionServ.createUser(toEdit);
}
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,55 @@
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import ovh.herisson.Clyde.Tables.Role;
import java.util.*;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class MinervalController {
private final AuthenticatorService authServ;
private final MinervalRepository mr;
public MinervalController(AuthenticatorService authServ, MinervalRepository mr) {
this.authServ = authServ;
this.mr = mr;
}
//A new minerval entry is posted when the inscription service accept a registration request
@PostMapping("/minerval/{studentRegNo}")
public ResponseEntity<Object> postMinerval(@RequestHeader("Authorization") String token, @PathVariable long studentRegNo){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
Calendar c = new GregorianCalendar();
mr.save(new Minerval(studentRegNo, 0, 835, c.get(Calendar.YEAR)));
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/minerval/{studentRegNo}")
public ResponseEntity<Minerval> getCurrentMinervalbyRegNo(@PathVariable long studentRegNo){
ArrayList<Minerval> mlist = mr.getMinervalsByStudentRegNoOrderByYearDesc(studentRegNo);
//The list is ordered by year in descending order then the index 0 contains the actual minerval (for this year)
Minerval m = mlist.get(0);
return new ResponseEntity<>(m, HttpStatus.OK);
}
@PatchMapping("/minerval")
public ResponseEntity<Object> updateMinerval(@RequestBody Minerval updatedMinerval){
Minerval minerval = mr.findById(updatedMinerval.getId());
minerval.setPaidAmount(updatedMinerval.getPaidAmount());
minerval.setToPay(updatedMinerval.getToPay());
mr.save(minerval);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,45 @@
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.Inscription.PaymentRepository;
import ovh.herisson.Clyde.Tables.Inscription.Payment;
import java.util.ArrayList;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class PaymentController {
private final PaymentRepository paymentRepository;
public PaymentController(PaymentRepository paymentRepository){
this.paymentRepository = paymentRepository;
}
//Post a payment record
@PostMapping("/payment")
public ResponseEntity<Object> postPayment(@RequestBody Payment payment){
paymentRepository.save(payment);
return new ResponseEntity<>(HttpStatus.OK);
}
//Get all payment records of a student
@GetMapping("/payment/{studentRegNo}")
public ResponseEntity<ArrayList<Payment>> getPaymentsByUser(@PathVariable long studentRegNo){
ArrayList<Payment> toReturn = paymentRepository.getPaymentsByStudentRegNo(studentRegNo);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping("/payment")
public ResponseEntity<ArrayList<Payment>> getAllPayments(){
ArrayList<Payment> toReturn = new ArrayList<Payment>();
paymentRepository.findAll().forEach(toReturn::add);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
}

View File

@ -0,0 +1,373 @@
package ovh.herisson.Clyde.EndPoints.Inscription;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.*;
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.TokenService;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class RequestsController {
public final TokenService tokenService;
public final ExemptionsRequestRepository err;
public final ScholarshipRequestRepository srr;
public final UserRepository userRepository;
public final AuthenticatorService authServ;
public final UnregisterRequestRepository unregisterRequestRepository;
public final CourseRepository courseRepository;
public final UserService userService;
public final UserCurriculumRepository userCurriculumRepository;
public final CurriculumRepository curriculumRepository;
public final MinervalRepository minervalRepository;
public final ChangeCurriculumRequestRepository changeCurriculumRequestRepository;
public RequestsController(TokenService tokenService, ExemptionsRequestRepository err, ScholarshipRequestRepository srr, UserRepository userRepository, AuthenticatorService authServ, UnregisterRequestRepository unregisterRequestRepository, CourseRepository courseRepository, UserService userService, UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepository, MinervalRepository minervalRepository, ChangeCurriculumRequestRepository changeCurriculumRequestRepository) {
this.tokenService = tokenService;
this.err = err;
this.srr = srr;
this.userRepository = userRepository;
this.authServ = authServ;
this.unregisterRequestRepository = unregisterRequestRepository;
this.courseRepository = courseRepository;
this.userService = userService;
this.userCurriculumRepository = userCurriculumRepository;
this.curriculumRepository = curriculumRepository;
this.minervalRepository = minervalRepository;
this.changeCurriculumRequestRepository = changeCurriculumRequestRepository;
}
@PostMapping(value="/exemptionreq")
public ResponseEntity<String> createExemptionReq(@RequestBody Map<String, Object> exemptionsRequestInfo){
User user = userRepository.findById((Integer) exemptionsRequestInfo.get("userRegNo"));
Course course = courseRepository.findById((Integer) exemptionsRequestInfo.get("courseId"));
ExemptionsRequest exemptionsRequest = new ExemptionsRequest(user, course, (String) exemptionsRequestInfo.get("justifDocument"), RequestState.Pending, new Date());
err.save(exemptionsRequest);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping(value="/scholarshipreq")
public ResponseEntity<String> createScholarshipReq(@RequestBody Map<String, Object> scholarshipRequestInfo){
User user = userRepository.findById((Integer)scholarshipRequestInfo.get("userId"));
ScholarshipRequest toCreate = new ScholarshipRequest(user, RequestState.Pending, 0, new Date(), (String) scholarshipRequestInfo.get("taxDocUrl"), (String) scholarshipRequestInfo.get("residencyDocUrl"));
srr.save(toCreate);
return new ResponseEntity<>(HttpStatus.CREATED);
}
//Get all the exemptions Request
@GetMapping(value = "/exemptionsreq")
public ResponseEntity<ArrayList<ExemptionsRequest>> getAllExemptionsRequests(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService, Role.Teacher},token))
return new UnauthorizedResponse<>(null);
ArrayList<ExemptionsRequest> toReturn = new ArrayList<>();
err.findAll().forEach(toReturn::add);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping(value = "/exemptionsreq/{id}")
public ResponseEntity<ExemptionsRequest> getExemptionRequestbyId(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ExemptionsRequest exemptionsRequest = err.findById(id);
return new ResponseEntity<>(exemptionsRequest, HttpStatus.OK);
}
@PatchMapping(value = "/exemptionsreq/{id}/{newstate}")
public ResponseEntity<String> changeExemptionReqState(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newstate){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
ExemptionsRequest exemptionsRequest = err.findById(id);
if (exemptionsRequest.getState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
exemptionsRequest.setState(newstate);
err.save(exemptionsRequest);
return new ResponseEntity<>(HttpStatus.OK);
}
//Get all the scholarships requests
@GetMapping(value = "/scholarshipreq")
public ResponseEntity<ArrayList<ScholarshipRequest>> getAllScholarshipRequests(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ArrayList<ScholarshipRequest> toReturn = new ArrayList<>();
srr.findAll().forEach(toReturn::add);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@PostMapping(value = "/unregister")
public ResponseEntity<String> postUnregReq(@RequestBody Map<String,Object> uninscr){
User u = userRepository.findById((int) uninscr.get("userId"));
Curriculum c;
if (uninscr.get("curriculumId") == null){
c = null;
}else{
c = curriculumRepository.findById((Integer) uninscr.get("curriculumId"));
}
UnregisterRequest ur = new UnregisterRequest(RequestState.Pending, (String) uninscr.get("reason"), new Date(), u.getRegNo(), u.getFirstName(), u.getLastName(), u.getEmail(), c);
unregisterRequestRepository.save(ur);
return new ResponseEntity<>(HttpStatus.OK);
}
@PatchMapping(value = "/scholarshipreq/")
public ResponseEntity<String> editScholReq(@RequestHeader("Authorization") String token, @RequestBody Map<String,Object> infos){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ScholarshipRequest scholarshipRequest = srr.findById((Integer) infos.get("id"));
User u = scholarshipRequest.getUser();
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (scholarshipRequest.getState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
if (infos.get("state").equals("Accepted")){
scholarshipRequest.setState(RequestState.Accepted);
scholarshipRequest.setAmount((int) infos.get("amount"));
//We then deduce then amount from the minerval
ArrayList<Minerval> minerval = minervalRepository.getMinervalsByStudentRegNoOrderByYearDesc(u.getRegNo());
minerval.get(0).setPaidAmount(minerval.get(0).getPaidAmount() + scholarshipRequest.getAmount());
minerval.get(0).setToPay(minerval.get(0).getToPay() - scholarshipRequest.getAmount());
minervalRepository.save(minerval.get(0));
}else{
scholarshipRequest.setState(RequestState.Refused);
}
srr.save(scholarshipRequest);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping(value = "/scholarshipreq/{id}")
public ResponseEntity<ScholarshipRequest> getScholReqbyId(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin, Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ScholarshipRequest toReturn = srr.findById(id);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping(value = "/unregister")
public ResponseEntity<ArrayList<UnregisterRequest>> getAllUnregReq(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ArrayList<UnregisterRequest> toReturn = new ArrayList<>();
unregisterRequestRepository.findAll().forEach(toReturn::add);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping(value = "/unregister/{id}")
public ResponseEntity<UnregisterRequest> getUnregbyId(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
UnregisterRequest unregisterRequest = unregisterRequestRepository.findById(id);
return new ResponseEntity<>(unregisterRequest, HttpStatus.OK);
}
@PatchMapping(value = "/unregister/{id}/{newstate}")
public ResponseEntity<String> pathUnregReq(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newstate){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
UnregisterRequest unregisterRequest = unregisterRequestRepository.findById(id);
User u = userRepository.findById(unregisterRequest.getRegNo());
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (unregisterRequest.getState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
unregisterRequest.setState(newstate);
unregisterRequestRepository.save(unregisterRequest);
if (newstate == RequestState.Accepted){
if (unregisterRequest.getCurriculum() == null){
ArrayList<UserCurriculum> userCurricula = userCurriculumRepository.findByUserOrderByCurriculum(u);
for (int i = 0; i < userCurricula.size(); i++){
userCurricula.get(i).setActual(false);
}
userCurriculumRepository.saveAll(userCurricula);
}else{
//This usercurriculum will contain the usercurriculum to set false
UserCurriculum userCurriculum = userCurriculumRepository.findByUserAndCurriculumAndActual(u, unregisterRequest.getCurriculum(), true);
userCurriculum.setActual(false);
userCurriculumRepository.save(userCurriculum);
}
}
return new ResponseEntity<>(HttpStatus.OK);
}
//We look in the usercursus table if the student has already the previous year of a curriculum
public boolean studentHasPrevYear(Curriculum curriculum, User user){
ArrayList<UserCurriculum> userCurrList = userCurriculumRepository.findByUserOrderByCurriculum(user);
for (int i = 0; i < userCurrList.size(); i++){
if (userCurrList.get(i).getCurriculum().getOption().equals(curriculum.getOption()) && userCurrList.get(i).getCurriculum().getYear() == curriculum.getYear()-1){
return true;
}
}
return false;
}
@PostMapping("/changecurriculumreq")
public ResponseEntity<String> addChangeCurrReq(@RequestBody Map<String,Object> reqInfos){
User user = userRepository.findById((Integer) reqInfos.get("userId"));
Curriculum actualCurriculum;
//If null then it means we are in a supplementary cursus case
if (reqInfos.get("actualcursus") == null){
actualCurriculum = null;
}else{
actualCurriculum = curriculumRepository.findById((Integer) reqInfos.get("actualcursus"));
}
Curriculum destinationCurriculum = curriculumRepository.findById((Integer) reqInfos.get("newcursus"));
ChangeCurriculumRequest changeCurriculumRequest = new ChangeCurriculumRequest(user, actualCurriculum, destinationCurriculum, new Date(), RequestState.Pending, RequestState.Unrequired);
//Si l'année du cursus est plus grande que 1 et que l'étudiant n'a pas dans sa liste de cursus l'année d'en dessous alors on demande l'accord du prof
if (destinationCurriculum.getYear() > 1 && !studentHasPrevYear(destinationCurriculum, user)){
changeCurriculumRequest.setTeacherApprovalState(RequestState.Pending);
}
changeCurriculumRequestRepository.save(changeCurriculumRequest);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/changecurriculumreq")
public ResponseEntity<ArrayList <ChangeCurriculumRequest>> getAllChangeCurrReq(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService, Role.Teacher},token))
return new UnauthorizedResponse<>(null);
ArrayList<ChangeCurriculumRequest> toReturn = new ArrayList<>();
changeCurriculumRequestRepository.findAll().forEach(toReturn::add);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@GetMapping("/changecurriculumreq/{id}")
public ResponseEntity<ChangeCurriculumRequest> getCCrbyId(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ChangeCurriculumRequest toReturn = changeCurriculumRequestRepository.findById(id);
return new ResponseEntity<>(toReturn, HttpStatus.OK);
}
@PatchMapping("/changecurriculumreq/{id}/{newState}")
public ResponseEntity<String> editCCReq(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newState){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService},token))
return new UnauthorizedResponse<>(null);
ChangeCurriculumRequest toEdit = changeCurriculumRequestRepository.findById(id);
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (toEdit.getState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
toEdit.setState(newState);
changeCurriculumRequestRepository.save(toEdit);
if (newState == RequestState.Accepted && (toEdit.getTeacherApprovalState() == RequestState.Accepted || toEdit.getTeacherApprovalState() == RequestState.Unrequired)){
//If actual curriculum is not null then we need to set that the user doesn't follow it anymore
acceptProcedure(toEdit);
}
return new ResponseEntity<>(HttpStatus.OK);
}
@PatchMapping("/changecurriculumreqteacher/{id}/{newteacherstate}")
public ResponseEntity<String> editCCReqTeacherState(@RequestHeader("Authorization") String token, @PathVariable long id, @PathVariable RequestState newteacherstate){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
ChangeCurriculumRequest toEdit = changeCurriculumRequestRepository.findById(id);
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (toEdit.getTeacherApprovalState() == RequestState.Accepted){
return new ResponseEntity<>(HttpStatus.OK);
}
toEdit.setState(newteacherstate);
changeCurriculumRequestRepository.save(toEdit);
if (newteacherstate == RequestState.Accepted && toEdit.getState() == RequestState.Accepted){
//If actual curriculum is not null then we need to set that the user doesn't follow it anymore
acceptProcedure(toEdit);
}
return new ResponseEntity<>(HttpStatus.OK);
}
private void acceptProcedure(ChangeCurriculumRequest toEdit) {
User u = toEdit.getUser();
if (toEdit.getActualCurriculum() != null){
ArrayList<UserCurriculum> listcurr = userCurriculumRepository.findByUserOrderByCurriculum(u);
for (int i = 0; i < listcurr.size(); i++){
if (listcurr.get(i).getCurriculum() == toEdit.getActualCurriculum()){
listcurr.get(i).setActual(false);
}
}
userCurriculumRepository.saveAll(listcurr);
}
Calendar c = Calendar.getInstance();
UserCurriculum userCurriculum = new UserCurriculum(u, toEdit.getDestinationCurriculum(), c.get(Calendar.YEAR), true);
userCurriculumRepository.save(userCurriculum);
}
@GetMapping("/exemptionreq/{userId}")
public ResponseEntity<ArrayList<ExemptionsRequest>> getExReqByuser(@RequestHeader("Authorization") String token, @PathVariable long userId){
User currentUser = tokenService.getUserFromToken(token);
//Only admin, teacher, secretary and the student himself can access a student's data here
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher, Role.Secretary},token) && currentUser.getRegNo() != userId)
return new UnauthorizedResponse<>(null);
User u = userRepository.findById(userId);
ArrayList<ExemptionsRequest> exList = err.findByUser(u);
return new ResponseEntity<>(exList, HttpStatus.OK);
}
}

View File

@ -0,0 +1,129 @@
package ovh.herisson.Clyde.EndPoints;
/******************************************************
* @file LessonController.java
* @author William Karpinski
* @scope Extension Horaire
*
* Controller of Lessons API
******************************************************/
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.LessonService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Services.ScheduleLessonService;
import ovh.herisson.Clyde.Tables.Lesson;
import ovh.herisson.Clyde.Tables.Role;
import java.util.HashMap;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class LessonController {
private final LessonService lessonServ;
private final ScheduleLessonService scheduleLessonServ;
private final AuthenticatorService authServ;
public LessonController(LessonService lessonServ, ScheduleLessonService scheduleLessonService, AuthenticatorService authServ) {
this.lessonServ = lessonServ;
this.scheduleLessonServ = scheduleLessonService;
this.authServ = authServ;
}
/**
* Return a lesson via its id
*/
@GetMapping("/lesson/{id}")
public ResponseEntity<HashMap<String,Object>> getLesson(@PathVariable long id){
Lesson lesson = lessonServ.findById(id);
if(lesson == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.lessonWithoutPassword(lesson),HttpStatus.OK);
}
/**
* Return all the lessons
*/
@GetMapping("/lessons")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllLessons(@RequestHeader("Authorization") String token){
if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findAll()),HttpStatus.OK);
}
/**
* Return all the lessons of a teacher's courses
*/
@GetMapping("/lessons/owned")
public ResponseEntity<Iterable<HashMap<String,Object>>> getOwnedLessons(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token)){
return new UnauthorizedResponse<>(null);}
return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findAllOwnedLesson(authServ.getUserFromToken(token))),HttpStatus.OK);
}
/**
⋅* Return all the lessons of a student
*/
@GetMapping("/lessons/OwnCurriculum")
public ResponseEntity<Iterable<HashMap<String,Object>>> getOnesLessons(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Student},token)){
return new UnauthorizedResponse<>(null);}
return new ResponseEntity<>(ProtectionService.lessonsWithoutPassword(lessonServ.findOnesLessons(authServ.getUserFromToken(token))),HttpStatus.OK);
}
/**
* Post a new lesson
*/
@PostMapping("/lesson")
public ResponseEntity<HashMap<String, Object>> postLesson(@RequestHeader("Authorization") String token,
@RequestBody Map<String, Object> lessonInfos){
if(authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
return new UnauthorizedResponse<>(null);
Lesson lesson = lessonServ.createLesson(lessonInfos);
Lesson createdLesson = lessonServ.save(lesson);
scheduleLessonServ.saveToAllSchedule(lesson);
if(createdLesson==null)
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.lessonWithoutPassword(createdLesson), HttpStatus.OK);
}
/**
* Modify a lesson
*/
@PatchMapping("/lesson/{id}")
public ResponseEntity<Lesson> patchLesson(@RequestHeader("Authorization") String token,
@RequestBody Map<String, Object> updates,
@PathVariable long id){
if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
if(!lessonServ.modifyData(id, updates)){
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(HttpStatus.OK);
}
/**
* Delete a lesson
*/
@DeleteMapping("lesson/{id}")
public ResponseEntity<String> deleteLesson(@RequestHeader("Authorization") String token,
@PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
Lesson toDelete = lessonServ.findById(id);
if(toDelete == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
lessonServ.delete(toDelete);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,149 @@
package ovh.herisson.Clyde.EndPoints;
/******************************************************
* @file LessonRequestsController.java
* @author William Karpinski
* @scope Extension Horaire
*
* Controller of lesson requests API
******************************************************/
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Tables.*;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class LessonRequestsController {
private final LessonRequestService lessonRequestServ;
private final AuthenticatorService authServ;
private final UserService userServ;
private final LessonService lessonServ;
public LessonRequestsController(LessonRequestService lessonRequestServer, AuthenticatorService authServ, UserService userServ, LessonService lessonServ) {
this.lessonRequestServ = lessonRequestServer;
this.authServ = authServ;
this.userServ = userServ;
this.lessonServ = lessonServ;
}
/**
* Return a lesson request via its id
*/
@GetMapping("/requests/lessonRequest/{id}")
public ResponseEntity<Map<String,Object>> getById(@RequestHeader("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
LessonChangesRequest lessonRequest= lessonRequestServ.findById(id);
return new ResponseEntity<>(ProtectionService.lessonRequestWithoutPassword(lessonRequest), HttpStatus.OK);
}
/**
* return all the requests made by a user
*/
@GetMapping("/requests/lessonRequests/owned")
public ResponseEntity<Iterable<Map<String, Object>>> getOwnedRequests(@RequestHeader("Authorization") String token){
if(authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
User user = authServ.getUserFromToken(token);
Iterable<LessonChangesRequest> lessonChangesRequests = lessonRequestServ.findOwnRequests(user);
return new ResponseEntity<>(ProtectionService.lessonRequestsWithoutPassword(lessonChangesRequests),HttpStatus.OK);
}
/**
* Return all the lesson requests
*/
@GetMapping("/requests/lessonRequests")
public ResponseEntity<Iterable<Map<String,Object>>> getAllRequests(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
Iterable<LessonChangesRequest> lessonRequests= lessonRequestServ.getAll();
return new ResponseEntity<>(ProtectionService.lessonRequestsWithoutPassword(lessonRequests), HttpStatus.OK);
}
/**
* Post a lesson request
*/
@PostMapping("/requests/lessonRequest")
public ResponseEntity<Map<String, Object>> makeRequest(@RequestHeader("Authorization") String token, @RequestBody Map<String,Object> lessonRequestInfos){
if(authServ.isNotIn(new Role[]{Role.Admin,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
LessonChangesRequest lessonChangesRequest = lessonRequestServ.createLessonRequest(lessonRequestInfos);
LessonChangesRequest createdRequest = lessonRequestServ.save(lessonChangesRequest);
if(createdRequest == null)
return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.lessonRequestWithoutPassword(lessonChangesRequest),HttpStatus.OK);
}
/**
* Modify a lesson Request
*/
@PatchMapping("/requests/lessonRequest/{id}")
public ResponseEntity<LessonChangesRequest> changeRequestState(@PathVariable long id,
@RequestHeader("Authorization") String token,
@RequestBody Map<String , Object> infos){
if(authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin},token))
return new UnauthorizedResponse<>(null);
LessonChangesRequest lessonRequest = lessonRequestServ.findById(id);
String local = "";
RequestState state = null;
for (Map.Entry<String, Object> entry : infos.entrySet()) {
switch (entry.getKey()) {
case "local":
local = (String) entry.getValue();
break;
case "state":
state = RequestState.valueOf((String)entry.getValue());
}
}
if (state == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
if(lessonRequest.getRequestType() == 0 ) {
if (!lessonRequestServ.modifyCreateRequestState(lessonRequest, state, local))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
userServ.Notify(lessonRequest.getUser(), new Notification("Request took in charge","Request"+ state + ":" + lessonRequest.getCourse().getTitle(), "#/manage-owned-lessons"));
}
else if(lessonRequest.getRequestType() == 1){
infos.put("lessonStart", lessonRequest.getLessonStart());
infos.put("lessonEnd", lessonRequest.getLessonEnd());
infos.put("lessonType",lessonRequest.getLessonType());
if(!lessonRequestServ.modifyChangeRequestState(infos,lessonRequest.getLessonId(),state))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
lessonRequest.setState(state);
userServ.Notify(lessonRequest.getUser(), new Notification("Request took in charge","Request"+ state + ":" + lessonServ.findById(lessonRequest.getLessonId()).getCourse().getTitle(), "#/manage-owned-lessons"));
}
else{
userServ.Notify(lessonRequest.getUser(), new Notification("Request took in charge","Request"+ state + ":" + lessonServ.findById(lessonRequest.getLessonId()).getCourse().getTitle(), "#/manage-owned-lessons"));
lessonRequestServ.modifyDeleteRequest(lessonRequest, state);
lessonRequest.setState(state);
}
lessonRequestServ.save(lessonRequest);
return new ResponseEntity<>(HttpStatus.OK);
}
/**
* Delete a lesson request
*/
@DeleteMapping("/requests/lessonRequest/{id}")
public ResponseEntity<String> deleteRequest(@RequestHeader("Authorization") String token, @PathVariable long id){
if(authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.Teacher},token))
return new UnauthorizedResponse<>(null);
LessonChangesRequest lessonChangesRequest = lessonRequestServ.findById(id);
if (lessonChangesRequest == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
lessonRequestServ.delete(lessonChangesRequest);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,70 @@
package ovh.herisson.Clyde.EndPoints;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.RequestState;
import java.util.Date;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class LoginController {
private final AuthenticatorService authServ;
private final CurriculumRepository curriculumRepository;
static public class RequestLogin{
private final String identifier;
private final String password;
@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ss")
private final Date expirationDate;
public RequestLogin(String identifier, String password, Date expirationDate){
this.identifier = identifier;
this.password = password;
this.expirationDate = expirationDate;
}
}
public LoginController(AuthenticatorService authServ, CurriculumRepository curriculumRepository){
this.authServ = authServ;
this.curriculumRepository = curriculumRepository;
}
@PostMapping(value = "/login")
public ResponseEntity<String> login(@RequestBody RequestLogin requestLogin){
String sessionToken = authServ.login(requestLogin.identifier,requestLogin.password,requestLogin.expirationDate);
if (sessionToken == null){
return new UnauthorizedResponse<>("Identifier or Password incorrect");
}
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.set("Set-Cookie",String.format("session_token=%s",sessionToken));
return ResponseEntity.ok().headers(responseHeaders).build();
}
@PostMapping("/register")
public ResponseEntity<Map<String,Object>> register(@RequestBody InscriptionRequest inscriptionRequest){
//We ensure here that if the targeted cursus year is more than first grade then we need the teacher equivalence approval
Curriculum curr = curriculumRepository.findById(inscriptionRequest.getCurriculumId());
if (curr.getYear() > 1){
inscriptionRequest.setEquivalenceState(RequestState.Pending);
}else{
inscriptionRequest.setEquivalenceState(RequestState.Unrequired);
}
InscriptionRequest returnedInscriptionRequest = authServ.register(inscriptionRequest);
return new ResponseEntity<>(ProtectionService.requestWithoutPassword(returnedInscriptionRequest), HttpStatus.CREATED);
}
}

View File

@ -0,0 +1,235 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ScholarshipRequestRepository;
import ovh.herisson.Clyde.Repositories.Inscription.UnregisterRequestRepository;
import ovh.herisson.Clyde.Services.*;
import ovh.herisson.Clyde.Services.ScientificPublications.ResearchesService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.ScientificPublications.Access;
import ovh.herisson.Clyde.Tables.ScientificPublications.PaperType;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
import ovh.herisson.Clyde.Tables.Inscription.*;
import java.util.*;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class MockController {
public final UserService userService;
public final UserRepository userRepo;
public final TokenRepository tokenRepo;
public final TokenService tokenService;
public final CurriculumCourseService CurriculumCourseService;
public final CurriculumService curriculumService;
public final CourseService courseService;
public final ExternalCurriculumRepository externalCurriculumRepository;
public final InscriptionService inscriptionService;
public final LessonService lessonService;
public final ScheduleService scheduleService;
public final ScheduleLessonService scheduleLessonService;
public final LessonRequestService lessonRequestService;
ArrayList<User> mockUsers;
public final ResearchesService researchesService;
public final UserCurriculumRepository ucr;
public final MinervalRepository minervalRepository;
public final ScholarshipRequestRepository scholarshipRequestRepository;
public final UnregisterRequestRepository uninscriptionRequestRepository;
public MockController(UserService userService, UserRepository userRepo, TokenRepository tokenRepo, TokenService tokenService, CurriculumCourseService CurriculumCourseService, CurriculumService curriculumService, CourseService courseService, ExternalCurriculumRepository externalCurriculumRepository, ResearchesService researchesService, InscriptionService inscriptionService, UserCurriculumRepository ucr, MinervalRepository minervalRepository, ScholarshipRequestRepository scholarshipRequestRepository, UnregisterRequestRepository unregisterRequestRepository, LessonService lessonService, ScheduleService scheduleService, ScheduleLessonService scheduleLessonService, LessonRequestService lessonRequestService){
this.userService = userService;
this.tokenRepo = tokenRepo;
this.userRepo = userRepo;
this.tokenService = tokenService;
this.CurriculumCourseService = CurriculumCourseService;
this.curriculumService = curriculumService;
this.courseService = courseService;
this.externalCurriculumRepository = externalCurriculumRepository;
this.inscriptionService = inscriptionService;
this.researchesService = researchesService;
this.lessonService = lessonService;
this.scheduleService = scheduleService;
this.scheduleLessonService = scheduleLessonService;
this.lessonRequestService = lessonRequestService;
this.ucr = ucr;
this.minervalRepository = minervalRepository;
this.scholarshipRequestRepository = scholarshipRequestRepository;
this.uninscriptionRequestRepository = unregisterRequestRepository;
}
/** Saves an example of each user type by :
* email : FooRole@FooRole.com, password : FooRole and token : FooRole
* For example the admin as "admin@admin.com" as email and "admin" as both password and token
* They all have silly names
*/
@PostMapping("/mock")
public void postMock() {
// user part
User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,"admin");
User joe = new User("Piplo","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,"student");
User meh = new User("Polo","Marco","secretary@secretary.com","a Box","Monaco",new Date(0), null,Role.Secretary,"secretary");
User joke = new User("Gaillard","Corentin","teacher@teacher.com","lab","faculty",new Date(0), null,Role.Teacher,"teacher");
User jojo = new User("Bridoux","Justin","teacher2@teacher2.com","lab","faculty",new Date(0), null,Role.Teacher,"teacher");
User lena = new User("Louille","Lena","inscriptionService@InscriptionService.com","no","yes",new Date(0), null,Role.InscriptionService,"inscriptionService");
User popo = new User("Smith", "Paul", "paulsmith@gmail.com", "306 rue du poulet", "belgique", new Date(0), null, Role.Student, "jesuispaulleroi");
mockUsers = new ArrayList<>(Arrays.asList(herobrine,joe,meh,joke,lena,jojo, popo));
userService.saveAll(mockUsers);
ExternalCurriculum externalCurriculum = new ExternalCurriculum(null, "HEH", "Bachelier en ingénieur", "completed", 2015, 2017, null, joe);
externalCurriculumRepository.save(externalCurriculum);
Minerval minerval = new Minerval(joe.getRegNo(), 0, 852, 2023);
minervalRepository.save(minerval);
// Course / Curriculum part
Curriculum infoBab1 = new Curriculum(1,"info", false);
Curriculum chemistryBab1 = new Curriculum(1,"chemistry", false);
Curriculum psychologyBab1 = new Curriculum(1,"psychology", false);
Curriculum infoBab2 = new Curriculum(2,"info", false);
Curriculum masterinfo1 = new Curriculum(4, "info", false);
Curriculum masterinfo2 = new Curriculum(5, "info", false);
Curriculum chemistryBab2 = new Curriculum(2, "chemistry", false);
Curriculum ingebab1 = new Curriculum(1, "ingénieur", true);
curriculumService.save(infoBab1);
curriculumService.save(chemistryBab1);
curriculumService.save(psychologyBab1);
curriculumService.save(infoBab2);
curriculumService.save(masterinfo1);
curriculumService.save(masterinfo2);
curriculumService.save(chemistryBab2);
curriculumService.save(ingebab1);
ucr.save(new UserCurriculum(joe, infoBab1, 2022, false));
ucr.save(new UserCurriculum(joe, chemistryBab1, 2023, true));
ucr.save(new UserCurriculum(joe, infoBab1, 2023, true));
ucr.save(new UserCurriculum(joe, psychologyBab1, 2020, false));
ucr.save(new UserCurriculum(popo, infoBab1, 2022, false));
ucr.save(new UserCurriculum(popo, infoBab2, 2023, true));
Course progra1 = new Course(5,"Programmation et algorithmique 1",joke);
Course chemistry1 = new Course(12, "Thermochimie",jojo);
Course psycho1 = new Course(21, "Neuroreaction of isolated brain cells",joke);
Course commun = new Course(2, "cours commun",joke);
courseService.save(progra1);
courseService.save(chemistry1);
courseService.save(psycho1);
courseService.save(commun);
ScholarshipRequest ssr1 = new ScholarshipRequest(joe, RequestState.Pending, 0, new Date(), "test", "test");
scholarshipRequestRepository.save(ssr1);
CurriculumCourseService.save(new CurriculumCourse(infoBab1,progra1));
CurriculumCourseService.save(new CurriculumCourse(infoBab1,commun));
CurriculumCourseService.save(new CurriculumCourse(infoBab1, psycho1));
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,psycho1));
CurriculumCourseService.save(new CurriculumCourse(psychologyBab1,commun));
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1, chemistry1));
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1, commun));
CurriculumCourseService.save(new CurriculumCourse(chemistryBab1, chemistry1));
InscriptionRequest inscriptionRequest = new InscriptionRequest("helen","prenom","non","helen@gmail.com","america",new Date(),(long) 4,RequestState.Pending,"yes.png","password", null, new Date(), RequestState.Pending, null);
inscriptionService.save(inscriptionRequest);
///////////////////////////
// extension Publications Scientifiques
Researcher jojoResearcherAccount = new Researcher(jojo, "3363-22555-AB33-T", null, "IT");
Researcher joResearchAccount = new Researcher(joe,"N555-321213-BED-DD",null, "Physics");
Researcher output = researchesService.saveResearcher(jojoResearcherAccount);
Researcher joOutput = researchesService.saveResearcher(joResearchAccount);
Set<Researcher> coAuthor = new HashSet<>();
coAuthor.add(joOutput);
Research jojoResearch = new Research("Graphs : Advanced Search Algorithms", output, new Date(0),
PaperType.Article, "test.pdf", null, "english",
Access.OpenSource, "IT", "This Article's title speaks for itself \n We'll discuss about advanced Graph search Algorithms",coAuthor);
Research restrictedResearch = new Research("the great Constantinople war", output, new Date(1111111111),
PaperType.Article, "restricted", null, "Portuguese",
Access.Restricted, "history", "this is a summary", new HashSet<>());
Research privateResearch = new Research("the great Potato War", output, new Date(),
PaperType.Article, "private", null, "english",
Access.Private, "agriculture", "my life is potato",null);
researchesService.saveResearch(restrictedResearch);
researchesService.saveResearch(privateResearch);
researchesService.saveResearch(jojoResearch);
//Schedule part
Lesson lesson_0_progra1 = new Lesson(progra1, "Mon Apr 22 2024 08:15", "Mon Apr 22 2024 10:15","rgb(0,50,100)","A0B2","Course");
Lesson lesson_0_chemistry1 = new Lesson(chemistry1, "Wed Mar 27 2024 08:15", "Wed Mar 27 2024 09:15","rgb(100,50,0)","A0B2","TP");
Lesson lesson_0_psycho1 = new Lesson(psycho1, "Sun Mar 24 2024 10:30 ","Sun Mar 24 2024 12:30 ","rgb(100,50,100)", "A0B2","TD");
Lesson lesson_1_progra1 = new Lesson(progra1, "Mon Apr 02 2024 13:30", "Mon Apr 02 2024 15:30","rgb(0,50,100)","A0B2","TP");
Lesson lesson_0_commun = new Lesson(commun, "Mon Apr 01 2024 10:30", "Mon Apr 01 2024 12:30","rgb(0,50,100)","A0B2","Course");
LessonChangesRequest request1 = new LessonChangesRequest(joke,RequestState.Pending,null,null,null,null,2,null,1);
LessonChangesRequest request2 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 10:30 ","Fri Apr 19 2024 12:30 ",null,null,1,null,2);
LessonChangesRequest request3 = new LessonChangesRequest(joke,RequestState.Pending,"Fri Apr 19 2024 13:30 ","Fri Apr 19 2024 15:30 ","Course",progra1,0,"rgb(27,49,100)",4);
Schedule infoBab1Schedule = new Schedule(infoBab1);
Schedule chemistryBab1Schedule = new Schedule(chemistryBab1);
Schedule psychoBab1Schedule = new Schedule(psychologyBab1);
scheduleService.save(infoBab1Schedule);
scheduleService.save(chemistryBab1Schedule);
scheduleService.save(psychoBab1Schedule);
lessonService.save(lesson_0_progra1);
lessonService.save(lesson_0_chemistry1);
lessonService.save(lesson_0_commun);
lessonService.save(lesson_0_psycho1);
lessonService.save(lesson_1_progra1);
scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_0_progra1));
scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_1_progra1));
scheduleLessonService.save(new ScheduleLesson(infoBab1Schedule,lesson_0_commun));
scheduleLessonService.save(new ScheduleLesson(chemistryBab1Schedule,lesson_0_chemistry1));
scheduleLessonService.save(new ScheduleLesson(chemistryBab1Schedule,lesson_0_commun));
scheduleLessonService.save(new ScheduleLesson(psychoBab1Schedule,lesson_0_psycho1));
scheduleLessonService.save(new ScheduleLesson(psychoBab1Schedule,lesson_0_commun));
lessonRequestService.save(request1);
lessonRequestService.save(request2);
lessonRequestService.save(request3);
UnregisterRequest unregisterRequest = new UnregisterRequest(RequestState.Pending, "je veux partir", new Date(), joe.getRegNo(), joe.getFirstName(), joe.getLastName(), joe.getEmail(), null);
uninscriptionRequestRepository.save(unregisterRequest);
externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null);
externalCurriculumRepository.save(externalCurriculum);
}
}

View File

@ -0,0 +1,113 @@
package ovh.herisson.Clyde.EndPoints.Msg;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import jakarta.websocket.server.PathParam;
import lombok.AllArgsConstructor;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Repositories.Msg.AnswerRepository;
import ovh.herisson.Clyde.Repositories.Msg.ForumRepository;
import ovh.herisson.Clyde.Repositories.Msg.TopicRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.CourseService;
import ovh.herisson.Clyde.Services.Msg.ForumService;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.Token;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Answer;
import ovh.herisson.Clyde.Tables.Msg.Forum;
import ovh.herisson.Clyde.Tables.Msg.Topic;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
@AllArgsConstructor
public class ForumController {
private CourseRepository courseRepo;
private AuthenticatorService authServ;
private ForumService forumServ;
private ForumRepository forumRepo;
private TopicRepository topicRepo;
//// Endpoints to get and create new forums
@GetMapping("/forums/{id}")
public ResponseEntity<List<Forum>> getForumFromCourseId(@RequestHeader("Authorization") String token, @PathVariable long id){
User u = authServ.getUserFromToken(token);
if(u == null){
return new UnauthorizedResponse<>(null);
}
return new ResponseEntity<>(courseRepo.findById(id).getForums(), HttpStatus.OK);
}
@PostMapping("/forums/{id}")
public ResponseEntity<Forum> createForumOfCourse(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Forum data){
User u = authServ.getUserFromToken(token);
Course c = courseRepo.findById(id);
if(!(c.getOwner().equals(u) || u.getRole() == Role.Admin)){
return new UnauthorizedResponse<>(null);
}
forumServ.createForum(c, data);
return new ResponseEntity<>(HttpStatus.ACCEPTED);
}
//// Endpoints to get and create forum's topic
@GetMapping("/forum/{id}")
public ResponseEntity<List<Topic>> getTopicsFromForumId(@RequestHeader("Authorization") String token, @PathVariable long id){
User u = authServ.getUserFromToken(token);
if(u == null){
return new UnauthorizedResponse<>(null);
}
return new ResponseEntity<>(forumRepo.findById(id).orElse(null).getTopics(), HttpStatus.OK);
}
@PostMapping("/forum/{id}")
public ResponseEntity<Topic> postTopicToForum(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Topic data){
User u = authServ.getUserFromToken(token);
Forum f = forumRepo.findById(id).orElse(null);
if(!(f.getWriters().contains(u) || f.getCourse().getOwner().equals(u) || u.getRole() == Role.Admin)){
return new UnauthorizedResponse<>(null);
}
forumServ.createTopic(f, data);
return new ResponseEntity<>(HttpStatus.ACCEPTED);
}
//// Endpoints related to topics and messages
@GetMapping("/forum/post/{id}")
public ResponseEntity<Topic> getPost(@RequestHeader("Authorization") String token, @PathVariable long id){
User u = authServ.getUserFromToken(token);
if(u == null){
return new UnauthorizedResponse<>(null);
}
Topic t = topicRepo.findById(id).orElse(null);
return new ResponseEntity<>(t, HttpStatus.OK);
}
@PostMapping("/forum/post/{id}")
public ResponseEntity<Topic> postTopicToForum(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Answer data){
User u = authServ.getUserFromToken(token);
Topic t = topicRepo.findById(id).orElse(null);
if(t.isLocked() && u.getRole() != Role.Admin){
return new UnauthorizedResponse<>(null);
}
System.out.println(data);
forumServ.answerTopic(t, data, u);
return new ResponseEntity<>(HttpStatus.ACCEPTED);
}
}

View File

@ -0,0 +1,126 @@
package ovh.herisson.Clyde.EndPoints.Msg;
/******************************************************
* @file MessagesController.java
* @author Anthony Debucquoy
* @scope Extension messagerie
*
* Entry point for the messages application
******************************************************/
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import lombok.AllArgsConstructor;
import ovh.herisson.Clyde.DTO.Msg.DiscussionDTO;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Repositories.Msg.DiscussionRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Services.Msg.DiscussionService;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Discussion;
import ovh.herisson.Clyde.Tables.Msg.Message;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
@AllArgsConstructor
public class MessagesController {
private AuthenticatorService authServ;
private DiscussionService discServ;
private DiscussionRepository discRepo;
private UserService userServ;
@GetMapping("/discussions")
public ResponseEntity<Iterable<Discussion>> getDiscussions(@RequestHeader("Authorization") String token ){
User user = authServ.getUserFromToken(token);
if(user == null){
return new UnauthorizedResponse<>(null);
}
Iterable<Discussion> mock = discServ.getOwned(authServ.getUserFromToken(token));
return new ResponseEntity<>(mock, HttpStatus.OK);
}
@GetMapping("/discussion/{id}")
public ResponseEntity<DiscussionDTO> getDiscussion(@RequestHeader("Authorization") String token, @PathVariable long id){
User user = authServ.getUserFromToken(token);
if(user == null || !discServ.hasDiscussion(user, id) ){
return new UnauthorizedResponse<>(null);
}
return new ResponseEntity<>(DiscussionDTO.construct(discRepo.findById(id).orElse(null), authServ.getUserFromToken(token)), HttpStatus.OK);
}
@PatchMapping("/discussion/{id}")
public ResponseEntity<Discussion> AlterDiscussion(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Discussion data){
User user = authServ.getUserFromToken(token);
if(user == null){
return new UnauthorizedResponse<>(null);
}
Discussion disc = discRepo.findById(id).orElse(null);
disc.setName(data.getName());
discRepo.save(disc);
return new ResponseEntity<>(disc, HttpStatus.OK);
}
@PatchMapping("/discussion/{id}/add")
public ResponseEntity<Discussion> invite(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody User data){
User user = authServ.getUserFromToken(token);
if(user == null){
return new UnauthorizedResponse<>(null);
}
Discussion disc = discRepo.findById(id).orElse(null);
User invited = userServ.getUserById(data.getRegNo());
disc.addMember(invited);
discRepo.save(disc);
return new ResponseEntity<>(disc, HttpStatus.OK);
}
@PatchMapping("/discussion/{id}/remove")
public ResponseEntity<Discussion> removeMember(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody User data){
User user = authServ.getUserFromToken(token);
if(user == null){
return new UnauthorizedResponse<>(null);
}
Discussion disc = discRepo.findById(id).orElse(null);
User member = userServ.getUserById(data.getRegNo());
disc.delMember(member);
discRepo.save(disc);
return new ResponseEntity<>(disc, HttpStatus.OK);
}
@PostMapping("/discussion/{id}")
public ResponseEntity<Discussion> sendMessage(@RequestHeader("Authorization") String token, @PathVariable long id, @RequestBody Message msg){
User user = authServ.getUserFromToken(token);
if(user == null){
return new UnauthorizedResponse<>(null);
}
Discussion disc = discRepo.findById(id).orElse(null);
msg.setAuthor(user);
if(disc != null)
discServ.CreateMessage(disc, msg);
return new ResponseEntity<>(disc, HttpStatus.OK);
}
@PostMapping("/discussion")
public ResponseEntity<Discussion> createDiscussion(@RequestHeader("Authorization") String token, @RequestBody Discussion data){
return new ResponseEntity<>(discServ.create(data.getName(), authServ.getUserFromToken(token)), HttpStatus.OK);
}
}

View File

@ -0,0 +1,61 @@
package ovh.herisson.Clyde.EndPoints;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import lombok.AllArgsConstructor;
import ovh.herisson.Clyde.Repositories.NotificationRepository;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Tables.Notification;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Notification.Status;
@RestController
@AllArgsConstructor
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class NotificationController {
private AuthenticatorService authServ;
private NotificationRepository notifRepo;
@GetMapping("/notifications")
public ResponseEntity<List<Notification>> getNotifications(@RequestHeader("Authorization") String token){
User u = authServ.getUserFromToken(token);
if(u == null){
return new UnauthorizedResponse<>(null);
}
ArrayList<Notification> ret = new ArrayList<>();
for (Notification n : u.getNotifications()) {
if(!n.getStatus().equals(Status.Archived)){
ret.add(n);
}
}
return new ResponseEntity<>(ret, HttpStatus.OK);
}
@PostMapping("/notifications/{id}")
public ResponseEntity<Notification> archiveNotification(@RequestHeader("Authorization") String token, @PathVariable long id){
User u = authServ.getUserFromToken(token);
Notification n = notifRepo.findById(id).orElse(null);
if(u == null || n.getUser() != u){
return new UnauthorizedResponse<>(null);
}
n.setStatus(Status.Archived);
notifRepo.save(n);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,20 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RestController;
import ovh.herisson.Clyde.Responses.PingResponse;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class PingController {
@GetMapping("/ping")
public PingResponse ping(){
return new PingResponse(1, "pong");
}
}

View File

@ -0,0 +1,116 @@
package ovh.herisson.Clyde.EndPoints;
/******************************************************
* @file ScheduleController.java
* @author William Karpinski
* @scope Extension Horaire
*
* Controller of Schedule API
******************************************************/
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ScheduleLessonService;
import ovh.herisson.Clyde.Services.ScheduleService;
import ovh.herisson.Clyde.Services.UserCurriculumService;
import ovh.herisson.Clyde.Services.CurriculumService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Services.LessonService;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class ScheduleController {
private final ScheduleService scheduleServ;
private final LessonService lessonServ;
private final CurriculumService curriculumServ;
private final AuthenticatorService authServ;
private final ScheduleLessonService scheduleLessonServ;
public ScheduleController(ScheduleService scheduleServ, AuthenticatorService authServ, ScheduleLessonService scheduleLessonServ, CurriculumService curriculumServ,LessonService lessonServ) {
this.scheduleServ = scheduleServ;
this.authServ = authServ;
this.scheduleLessonServ = scheduleLessonServ;
this.curriculumServ = curriculumServ;
this.lessonServ = lessonServ;
}
/**
* Return schedule via its id
*/
@GetMapping("/schedule/{id}")
public ResponseEntity<Map<String,Object>> findById(@PathVariable long id){
Schedule schedule = scheduleServ.findById(id);
if(schedule == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(scheduleLessonServ.getDepthScheduleBySchedule(schedule),HttpStatus.OK);
}
/**
* Return a schedule via its curriculum id
*/
@GetMapping("/schedule/curriculum/{id}")
public ResponseEntity<Map<String, Object>> findCurriculumSchedule(@PathVariable Long id){
Schedule schedule = scheduleLessonServ.getScheduleByCurriculum(curriculumServ.findById(id));
if(schedule == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(scheduleLessonServ.getDepthScheduleBySchedule(schedule),HttpStatus.OK);
}
/**
* Return all schedules
*/
@GetMapping("/schedules")
public ResponseEntity<Iterable<Map<String , Object>>> findAllSchedule(){
return new ResponseEntity<>(scheduleLessonServ.getAllSchedule(),HttpStatus.OK);
}
/**
* Post a new schedule
*/
@PostMapping("/schedule")
public ResponseEntity<Schedule> postSchedule(@RequestHeader("Authorization") String token,
@RequestBody Schedule schedule){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(scheduleServ.save(schedule),HttpStatus.OK);
}
/**
* Post a lesson to a schedule
*/
@PostMapping("/schedule/{id}")
public ResponseEntity<String> postLessonToSchedule(@RequestHeader("Authorization") String token,
@RequestBody Long lessonId,
@PathVariable long id)
{
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
if (!scheduleLessonServ.save(new ScheduleLesson( scheduleServ.findById(id), lessonServ.findById(lessonId))))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.OK);
}
/**
* Delete a lesson from a schedule
*/
@DeleteMapping("/schedule/lesson/{id}")
public ResponseEntity<String> deleteLessonFromSchedule(@RequestHeader("Authorization") String token,
@RequestBody Long lessonId,
@PathVariable Long id)
{
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
if (!scheduleLessonServ.delete(lessonId))
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,167 @@
package ovh.herisson.Clyde.EndPoints.ScientificPublications;
/******************************************************
* @file ResearchController.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* API class for the researches
******************************************************/
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.DTO.ScientificPublications.ResearchDTO;
import ovh.herisson.Clyde.DTO.ScientificPublications.ResearcherDTO;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ScientificPublications.ResearchesService;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.ArrayList;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
@AllArgsConstructor
public class ResearchController {
private final ResearchesService researchesServ;
private final AuthenticatorService authServ;
/** Is accessible by anyone
* but if the user doesn't have the permission to download the research
* the return Research Download URL will be null
*/
@GetMapping("/research/{id}")
public ResponseEntity<ResearchDTO> getResearch(@RequestHeader(value = "Authorization", required = false) String token, @PathVariable long id){
Research research = researchesServ.getResearchById(id);
if (research == null)
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
if (researchesServ.hasNoAccessTo(research,authServ.getUserFromToken(token))){
research.setPdfLocation(null);
}// If the user doesn't have access to the document he can't download the pdf
return new ResponseEntity<>(ResearchDTO.construct(research), HttpStatus.OK);
}
/**
* @param token used to know if the user can download or not the research pdf
* @return every research
*/
@GetMapping("/researches")
public ResponseEntity<Iterable<ResearchDTO>> getResearches(@RequestHeader(value = "Authorization",required = false) String token){
Iterable<Research> researches = researchesServ.getAllResearches();
ArrayList<ResearchDTO> toReturnResearches = new ArrayList<>();
for (Research research: researches){
if (researchesServ.hasNoAccessTo(research,authServ.getUserFromToken(token))){
research.setPdfLocation(null);
}
toReturnResearches.add(ResearchDTO.construct(research));
}
return new ResponseEntity<>(toReturnResearches,HttpStatus.OK);
}
@GetMapping("/researches/{id}")
public ResponseEntity<Iterable<ResearchDTO>> getResearchesFromResearcher(@RequestHeader(value = "Authorization",required = false) String token,
@PathVariable Long id
){
Iterable<Research> researches = researchesServ.getResearchesByAuthor(id);
if (researches == null) return new ResponseEntity<>(HttpStatus.NOT_FOUND);
ArrayList<ResearchDTO> toReturnResearches = new ArrayList<>();
for (Research research: researches){
if (researchesServ.hasNoAccessTo(research,authServ.getUserFromToken(token))){
research.setPdfLocation(null);
}
toReturnResearches.add(ResearchDTO.construct(research));
}
return new ResponseEntity<>(toReturnResearches,HttpStatus.OK);
}
/** post a new research
*
* @return the research saved
*/
@PostMapping("/research")
public ResponseEntity<Research> postResearch(@RequestHeader("Authorization") String token, @RequestBody Research research){
if (authServ.isNotIn(new Role[]{Role.Admin},token) &&
researchesServ.getResearcherByUser(authServ.getUserFromToken(token)) == null){
return new UnauthorizedResponse<>(null);
} // if the poster isn't a researcher
return new ResponseEntity<>(researchesServ.saveResearch(research), HttpStatus.OK);
}
/** post updates to the research
* in the updates, the coAuthors have to be referenced by their ids
*
*/
@PatchMapping("/research/{id}")
public ResponseEntity<String> patchResearch(@RequestHeader("Authorization") String token,
@RequestBody Map<String,Object> updates,
@PathVariable long id
)
{
Research research = researchesServ.getResearchById(id);
Researcher researcher = researchesServ.getResearcherByUser(authServ.getUserFromToken(token));
if (research == null)
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) &&
researcher != research.getAuthor()) {
return new UnauthorizedResponse<>(null);
}
researchesServ.modifyResearchData(research, updates);
return new ResponseEntity<>(HttpStatus.OK);
}
/** Only Admin, Secretary and author can delete a research
*
*/
@DeleteMapping("/research/{id}")
public ResponseEntity<String> deleteResearch(@RequestHeader("Authorization") String token, @PathVariable long id){
Research research = researchesServ.getResearchById(id);
Researcher researcher = researchesServ.getResearcherByUser(authServ.getUserFromToken(token));
if (research == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
if (authServ.isNotIn(new Role[]{Role.Admin, Role.Secretary},token) &&
researcher != research.getAuthor()){
return new UnauthorizedResponse<>(null);
}
researchesServ.deleteResearch(research);
return new ResponseEntity<>(HttpStatus.OK);
}
///////
//views part
@PostMapping("/addview/cdn/{url}")
public ResponseEntity<ResearchDTO> addView(@PathVariable String url){
System.out.println(url);
Research research = researchesServ.getResearchByUrl("cdn/" + url);
if (research ==null) return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ResearchDTO.construct(researchesServ.addView(research)), HttpStatus.OK);
}
}

View File

@ -0,0 +1,102 @@
package ovh.herisson.Clyde.EndPoints.ScientificPublications;
/******************************************************
* @file ResearcherController.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* API class for the researchers
******************************************************/
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.DTO.ScientificPublications.ResearcherDTO;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ScientificPublications.ResearchesService;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.ArrayList;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
@AllArgsConstructor
public class ResearcherController {
ResearchesService researchesServ;
AuthenticatorService authServ;
@GetMapping("/researcher/{id}")
public ResponseEntity<ResearcherDTO> getResearcher(@PathVariable long id){
Researcher researcher = researchesServ.getResearcherById(id);
return new ResponseEntity<>(ResearcherDTO.construct(researcher),HttpStatus.OK);
}
/**
* Everyone can access every researcher Account
* @return all the researchers accounts
*/
@GetMapping("/researchers")
public ResponseEntity<Iterable<ResearcherDTO>> getAllResearchers(){
Iterable<Researcher> researchers = researchesServ.getAllResearchers();
ArrayList<ResearcherDTO> toReturnResearchersDTO = new ArrayList<>();
for (Researcher researcher: researchers){
toReturnResearchersDTO.add(ResearcherDTO.construct(researcher));
}
return new ResponseEntity<>(toReturnResearchersDTO, HttpStatus.OK);
}
@GetMapping("/researcher")
public ResponseEntity<ResearcherDTO> getSelf(@RequestHeader("Authorization") String token){
Researcher self = researchesServ.getResearcherByUser(authServ.getUserFromToken(token));
if (self ==null) return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ResearcherDTO.construct(self), HttpStatus.OK);
}
@PostMapping("/researcher")
public ResponseEntity<ResearcherDTO> postResearcher(@RequestHeader("Authorization") String token, @RequestBody Researcher researcher){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary}, token)){
return new UnauthorizedResponse<>(null);
}
Researcher posted = researchesServ.saveResearcher(researcher);
if (posted == null) return new ResponseEntity<>(null, HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ResearcherDTO.construct(posted), HttpStatus.CREATED);
}
@PatchMapping("/researcher/{id}")
public ResponseEntity<ResearcherDTO> patchResearcher(@RequestHeader("Authorization") String token,
@PathVariable long id,
@RequestBody Map<String ,Object> updates){
Researcher researcher = researchesServ.getResearcherById(id);
if (authServ.isNotIn(new Role[]{Role.Secretary,Role.Admin}, token)
&& researcher.getId() != researchesServ.getResearcherByUser(authServ.getUserFromToken(token)).getId())
return new UnauthorizedResponse<>(null);
if (researcher == null) return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
researchesServ.modifyResearcherData(researcher,updates);
return new ResponseEntity<>(ResearcherDTO.construct(researcher),HttpStatus.OK);
}
@DeleteMapping("/researcher/{id}")
public ResponseEntity<String> deleteResearcher(@RequestHeader ("Authorization") String token, @PathVariable long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
researchesServ.deleteResearcher(researchesServ.getResearcherById(id));
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,47 @@
package ovh.herisson.Clyde.EndPoints.ScientificPublications;
/******************************************************
* @file StatController.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Api class for handling statistics
******************************************************/
import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Services.ScientificPublications.ResearchesService;
import ovh.herisson.Clyde.Services.ScientificPublications.StatisticsService;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
@AllArgsConstructor
public class StatController {
private StatisticsService statServ;
private ResearchesService researchesServ;
/** returns all the statistics in a 2D array
*
* @param id the researcher's id
* @return all the stats in a 2D array
*/
@GetMapping("/stats/{id}")
public ResponseEntity<Iterable<Iterable<Map<String, Integer>>>> getStat(@PathVariable Long id){
Researcher researcher = researchesServ.getResearcherById(id);
if (researcher == null) return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
Iterable<Iterable<Map<String,Integer>>> stats = statServ.generateStats(researcher);
if (stats == null) return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(stats,HttpStatus.OK);
}
}

View File

@ -0,0 +1,36 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import ovh.herisson.Clyde.Services.StorageService;
import ovh.herisson.Clyde.Tables.FileType;
import ovh.herisson.Clyde.Tables.StorageFile;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class StorageController {
private final StorageService storageServ;
public StorageController(StorageService storageServ){
this.storageServ= storageServ;
}
@PostMapping("/upload/{fileType}")
public ResponseEntity<StorageFile> handleFileUpload(@RequestParam("file") MultipartFile file, @PathVariable FileType fileType) {
StorageFile fileEntry;
try {
fileEntry = storageServ.store(file,fileType);
} catch(Exception e){
e.printStackTrace();
return new ResponseEntity<>(null,HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(fileEntry, HttpStatus.OK);
}
}

View File

@ -0,0 +1,37 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.TokenService;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.Token;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class TokenController {
private final TokenService tokenServ;
private final AuthenticatorService authServ;
public TokenController(TokenService tokenServ, AuthenticatorService authServ){
this.tokenServ = tokenServ;
this.authServ = authServ;
}
@GetMapping("/tokens")
public ResponseEntity<Iterable<Token>> getTokens(@RequestHeader("Authorization")String token){
if (authServ.isNotIn(new Role[]{Role.Admin},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(tokenServ.getAllTokens(), HttpStatus.OK);
}
}

View File

@ -0,0 +1,137 @@
package ovh.herisson.Clyde.EndPoints;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ovh.herisson.Clyde.Responses.UnauthorizedResponse;
import ovh.herisson.Clyde.Services.AuthenticatorService;
import ovh.herisson.Clyde.Services.ProtectionService;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@RestController
@CrossOrigin(originPatterns = "*", allowCredentials = "true")
public class UserController {
private final UserService userService;
private final AuthenticatorService authServ;
public UserController(UserService userService, AuthenticatorService authServ){
this.userService = userService;
this.authServ = authServ;
}
/** returns information about the connected user
*
* @param token the session token of the user
* @return the user information except his password
*/
@GetMapping("/user")
public ResponseEntity<HashMap<String,Object>> getUser(@RequestHeader("Authorization") String token){
User user = authServ.getUserFromToken(token);
if (user == null) return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.userWithoutPassword(user), HttpStatus.OK);
}
@GetMapping("/user/{id}")
public ResponseEntity<HashMap<String ,Object>> getUserById(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary,Role.InscriptionService, Role.Teacher},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.userWithoutPassword(userService.getUserById(id)), HttpStatus.OK);
}
@PostMapping("/user")
public ResponseEntity<Map<String ,Object>> postUser(@RequestBody User user,@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(ProtectionService.userWithoutPassword(userService.save(user)),HttpStatus.CREATED);
}
@GetMapping("/users")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllUsers(@RequestHeader("Authorization") String token){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
Role posterRole = authServ.getUserFromToken(token).getRole();
Iterable<User> users = new ArrayList<>();
if (posterRole == Role.Admin)
users = userService.getAll();
else if (posterRole == Role.Secretary)
users = userService.getAllExceptAdmins();
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(users), HttpStatus.OK);
}
/** changes the specified user's information
*
* @param updates the changes to be made
* @param token the session token of the user posting the change
* @param id the id of the user to change
* @return a string clarifying the issue (if there is any)
*/
@PatchMapping("/user/{id}")
public ResponseEntity<Map<String,Object>> patchUser(@RequestHeader("Authorization") String token,
@RequestBody Map<String,Object> updates,
@PathVariable Long id) {
if (token == null) return new UnauthorizedResponse<>(null);
User poster = authServ.getUserFromToken(token);
if (poster == null) {return new UnauthorizedResponse<>(null);}
User modified = userService.modifyData(id,updates,poster);
if (modified ==null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
return new ResponseEntity<>(ProtectionService.userWithoutPassword(modified), HttpStatus.OK);
}
@GetMapping("/teachers")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllTeachers(@RequestHeader("Authorization") String token){
Iterable<User> teachers = userService.getAllTeachers();
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(teachers), HttpStatus.OK);
}
@GetMapping("/students")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllStudent(@RequestHeader("Authorization") String token){
if (authServ.getUserFromToken(token) == null)
return new UnauthorizedResponse<>(null);
Iterable<User> students = userService.getAllStudents();
return new ResponseEntity<>(ProtectionService.usersWithoutPasswords(students), HttpStatus.OK);
}
@DeleteMapping("/user/{id}")
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) && !id.equals(authServ.getUserFromToken(token).getRegNo()))
return new UnauthorizedResponse<>(null);
User toDelete = userService.getUserById(id);
if (toDelete == null)
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
userService.delete(toDelete);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -0,0 +1,15 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.User;
public interface CourseRepository extends CrudRepository<Course,Long> {
Course findById(long id);
@Query("select c from Course c where c.owner = ?1")
Iterable<Course> findAllOwnedCoures(User teacher);
}

View File

@ -0,0 +1,27 @@
package ovh.herisson.Clyde.Repositories;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.CurriculumCourse;
public interface CurriculumCourseRepository extends CrudRepository<CurriculumCourse,Long> {
@Query("select distinct cc.course from CurriculumCourse cc where cc.curriculum = ?1")
Iterable<Course> findCoursesByCurriculum(Curriculum curriculum);
@Query("select distinct cc.curriculum from CurriculumCourse cc where cc.course = ?1")
Iterable<Curriculum> findCurriculumByCourses(Course course);
@Query("select distinct cc.curriculum from CurriculumCourse cc")
Iterable<Curriculum> findDistinctCurriculums();
@Modifying
@Transactional
@Query("delete from CurriculumCourse cc where cc.course =?1")
void delete(Course course);
}

View File

@ -0,0 +1,8 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Curriculum;
public interface CurriculumRepository extends CrudRepository<Curriculum,Long> {
Curriculum findById(long id);
}

View File

@ -0,0 +1,14 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.StorageFile;
import java.util.ArrayList;
public interface FileRepository extends CrudRepository<StorageFile,Long> {
public StorageFile getStorageFileByName(String name);
}

View File

@ -0,0 +1,9 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ChangeCurriculumRequest;
public interface ChangeCurriculumRequestRepository extends CrudRepository<ChangeCurriculumRequest, Long> {
ChangeCurriculumRequest findById(long id);
}

View File

@ -0,0 +1,13 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.ExemptionsRequest;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
public interface ExemptionsRequestRepository extends CrudRepository<ExemptionsRequest, Long> {
ExemptionsRequest findById(long id);
ArrayList<ExemptionsRequest> findByUser(User user);
}

View File

@ -0,0 +1,15 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
public interface ExternalCurriculumRepository extends CrudRepository<ExternalCurriculum, Long> {
ArrayList<ExternalCurriculum> getExternalCurriculumByInscriptionRequest(InscriptionRequest ir);
ArrayList<ExternalCurriculum> getExternalCurriculumByUser(User user);
ExternalCurriculum getExternalCurriculumById(long id);
}

View File

@ -0,0 +1,10 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
public interface InscriptionRepository extends CrudRepository<InscriptionRequest,Long> {
InscriptionRequest findById(long aLong);
}

View File

@ -0,0 +1,12 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import java.util.ArrayList;
public interface MinervalRepository extends CrudRepository<Minerval, Long> {
public ArrayList<Minerval> getMinervalsByStudentRegNoOrderByYearDesc(Long studentRegNo);
public Minerval findById(long id);
}

View File

@ -0,0 +1,10 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.Payment;
import java.util.ArrayList;
public interface PaymentRepository extends CrudRepository<Payment, Long> {
public ArrayList<Payment> getPaymentsByStudentRegNo(long regNo);
}

View File

@ -0,0 +1,8 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.ScholarshipRequest;
public interface ScholarshipRequestRepository extends CrudRepository<ScholarshipRequest, Long> {
public ScholarshipRequest findById(long id);
}

View File

@ -0,0 +1,8 @@
package ovh.herisson.Clyde.Repositories.Inscription;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Inscription.UnregisterRequest;
public interface UnregisterRequestRepository extends CrudRepository<UnregisterRequest, Long> {
public UnregisterRequest findById(long l);
}

View File

@ -0,0 +1,23 @@
package ovh.herisson.Clyde.Repositories;
/******************************************************
* @file LessonChangesRequestRepository.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.LessonChangesRequest;
import ovh.herisson.Clyde.Tables.User;
public interface LessonChangesRequestRepository extends CrudRepository<LessonChangesRequest, Long> {
LessonChangesRequest findById(long id);
@Query("select lr from LessonChangesRequest lr where lr.user = ?1")
Iterable<LessonChangesRequest> findOwnRequests(User user);
@Query("select lr from LessonChangesRequest lr where lr.lessonId = ?1")
Iterable<LessonChangesRequest> findRequestByLessonId(long id);
}

View File

@ -0,0 +1,20 @@
package ovh.herisson.Clyde.Repositories;
/******************************************************
* @file LessonRepository.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Lesson;
public interface LessonRepository extends CrudRepository<Lesson, Long> {
Lesson findById(long id);
@Query("select l from Lesson l where l.course = ?1")
Iterable<Lesson> findLessonByCourse(Course course);
}

View File

@ -0,0 +1,10 @@
package ovh.herisson.Clyde.Repositories.Msg;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Msg.Answer;
public interface AnswerRepository extends CrudRepository<Answer, Long> {
}

View File

@ -0,0 +1,23 @@
package ovh.herisson.Clyde.Repositories.Msg;
/******************************************************
* @file DiscussionRepository.java
* @author Anthony Debucquoy
* @scope Extension messagerie
*
* Repository of Discussion allowing to fetch discussion by user
******************************************************/
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Msg.Discussion;
public interface DiscussionRepository extends CrudRepository<Discussion, Long>{
@Query("SELECT d FROM Discussion d INNER JOIN FETCH d.members dm WHERE dm.id = ?1")
List<Discussion> findByMembership(long userid);
}

View File

@ -0,0 +1,9 @@
package ovh.herisson.Clyde.Repositories.Msg;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Msg.Forum;
public interface ForumRepository extends CrudRepository<Forum, Long> {
}

View File

@ -0,0 +1,14 @@
package ovh.herisson.Clyde.Repositories.Msg;
/******************************************************
* @file MessageRepository.java
* @author Anthony Debucquoy
* @scope Extension messagerie
******************************************************/
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Msg.Message;
public interface MessageRepository extends CrudRepository<Message, Long> {}

View File

@ -0,0 +1,10 @@
package ovh.herisson.Clyde.Repositories.Msg;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Msg.Topic;
public interface TopicRepository extends CrudRepository<Topic, Long> {
}

View File

@ -0,0 +1,8 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Notification;
public interface NotificationRepository extends CrudRepository<Notification, Long> {}

View File

@ -0,0 +1,33 @@
package ovh.herisson.Clyde.Repositories;
/******************************************************
* @file ScheduleLessonRepository.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.Lesson;
import ovh.herisson.Clyde.Tables.Schedule;
import ovh.herisson.Clyde.Tables.ScheduleLesson;
public interface ScheduleLessonRepository extends CrudRepository<ScheduleLesson,Long> {
@Query("select distinct sl.lesson from ScheduleLesson sl where sl.schedule.curriculum = ?1")
Iterable<Lesson> findLessonByCurriculum(Curriculum curriculum);
@Query("select distinct sl.schedule from ScheduleLesson sl where sl.schedule.curriculum = ?1")
Schedule findScheduleByCurriculum(Curriculum curriculum);
@Query("select distinct sl from ScheduleLesson sl where sl.lesson = ?1")
ScheduleLesson findByLesson(Lesson lesson);
@Modifying
@Transactional
@Query("delete from ScheduleLesson sl where sl.lesson =?1")
void delete(Lesson lesson);
}

View File

@ -0,0 +1,22 @@
package ovh.herisson.Clyde.Repositories;
/******************************************************
* @file ScheduleRepository.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Lesson;
import ovh.herisson.Clyde.Tables.Schedule;
public interface ScheduleRepository extends CrudRepository<Schedule,Long> {
Schedule getById(long id);
@Query("select distinct sl from Schedule sl where EXISTS (select c.curriculum from CurriculumCourse c where (sl.curriculum = c.curriculum) AND (c.course = ?1))")
Iterable<Schedule> findAllLessonSchedule(Course course);
}

View File

@ -0,0 +1,26 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file ResearchRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseach table
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.Map;
public interface ResearchRepository extends CrudRepository<Research,Long> {
Research findById(long id);
Iterable<Research> findByAuthor(Researcher author);
@Query("select r from Research r where r.pdfLocation = ?1")
Research findByPdfLocation(String url);
}

View File

@ -0,0 +1,23 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file ResearcherRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseacher table
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import ovh.herisson.Clyde.Tables.User;
public interface ResearcherRepository extends CrudRepository<Researcher,Long> {
Researcher findByUser(User user);
Researcher findById(long id);
@Query("select r from Research r where r.author = ?1")
Iterable<Research> findAllByAuthorId(Researcher author);
}

View File

@ -0,0 +1,47 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file StatsRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseach table for making statistics
******************************************************/
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import java.util.Map;
public interface StatsRepository extends CrudRepository<Research,Long> {
@Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r group by to_char(r.releaseDate, 'month')")
Iterable<Map<String ,Integer>> viewsByMonths();
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, sum (r.views) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
Iterable<Map<String ,Integer>> viewsByYears();
@Query("select new map(r.domain as label, sum(r.views) as y) from Research r group by r.domain")
Iterable<Map<String ,Integer>> viewsByTopics();
@Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain")
Iterable<Map<String ,Integer>> languageByTopics();
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
Iterable<Map<String ,Integer>> languageByYears();
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate, 'month')")
Iterable<Map<String ,Integer>> languageByMonths();
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
Iterable<Map<String ,Integer>> researchesByYears();
@Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain")
Iterable<Map<String ,Integer>> researchesByTopics();
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate, 'month')")
Iterable<Map<String ,Integer>> researchesByMonth();
}

View File

@ -0,0 +1,14 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.TeacherCourse;
import ovh.herisson.Clyde.Tables.User;
public interface TeacherCourseRepository extends CrudRepository<TeacherCourse, Long> {
@Query("select tc.user from TeacherCourse tc where tc.course = ?1")
Iterable<User> findAllAssistantOfCourse(Course course);
}

View File

@ -0,0 +1,14 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Token;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
public interface TokenRepository extends CrudRepository<Token,Long> {
Token getByToken(String token);
ArrayList <Token> getByUserOrderByExpirationDate(User user);
}

View File

@ -0,0 +1,23 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.Curriculum;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.UserCurriculum;
import java.util.ArrayList;
public interface UserCurriculumRepository extends CrudRepository<UserCurriculum, Long> {
@Query("select uc.curriculum from UserCurriculum uc where uc.user = ?1")
Curriculum findByUser(User student);
@Query("select distinct uc.user from UserCurriculum uc where uc.curriculum = ?1")
Iterable<User> findUsersByCurriculum(Curriculum curriculum);
ArrayList<UserCurriculum> findByUserOrderByCurriculum(User student);
UserCurriculum findByUserAndCurriculumAndActual(User user, Curriculum curriculum, boolean actual);
ArrayList<UserCurriculum> findByUserAndActual(User user, boolean actual);
}

View File

@ -0,0 +1,23 @@
package ovh.herisson.Clyde.Repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.User;
public interface UserRepository extends CrudRepository<User, Long> {
User findById(long id);
User findByEmail(String email);
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Teacher")
Iterable<User> findAllTeachers();
@Query("select u from User u where u.role = ovh.herisson.Clyde.Tables.Role.Student")
Iterable<User> findAllStudents();
@Query("select u from User u where u.role <> ovh.herisson.Clyde.Tables.Role.Admin")
Iterable<User> findAllExceptAdmins();
}

View File

@ -0,0 +1,3 @@
package ovh.herisson.Clyde.Responses;
public record PingResponse(int id, String txt){};

View File

@ -0,0 +1,12 @@
package ovh.herisson.Clyde.Responses;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
public class UnauthorizedResponse<T> extends ResponseEntity<T> {
public UnauthorizedResponse(T message) {
super(message,HttpStatus.UNAUTHORIZED);
}
}

View File

@ -0,0 +1,55 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Services.Inscription.InscriptionService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import java.util.Date;
@Service
public class AuthenticatorService {
private final TokenService tokenService;
private final UserService userService;
private final InscriptionService inscriptionService;
public AuthenticatorService(TokenService tokenService, UserService userService, InscriptionService inscriptionService){
this.tokenService = tokenService;
this.userService = userService;
this.inscriptionService = inscriptionService;
}
public User getUserFromToken(String token){
return tokenService.getUserFromToken(token);
}
public String login(String identifier, String password, Date expirationDate){
User user = userService.getUser(identifier);
if (user == null){return null;}
if (!userService.checkPassword(user,password)){return null;}
String token = tokenService.generateNewToken();
tokenService.saveToken(new Token(user, token,expirationDate));
return token;
}
public InscriptionRequest register(InscriptionRequest inscriptionRequest) {
inscriptionRequest.setState(RequestState.Pending);
return inscriptionService.save(inscriptionRequest);
}
public boolean isNotIn(Role[] roles, String token){
if (token == null)
return true;
User poster = getUserFromToken(token);
if (poster == null) return true;
for (Role r:roles){
if (poster.getRole() == r)
return false;
}
return true;
}
}

View File

@ -0,0 +1,83 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.User;
import java.util.Map;
@Service
public class CourseService {
private final CourseRepository courseRepo;
public CourseService(CourseRepository courseRepo) {
this.courseRepo = courseRepo;
}
public Course save(Course course){
if (course.getOwner().getRole() != Role.Teacher)
return null;
return courseRepo.save(course);
}
public Course findById(long id){
return courseRepo.findById(id);
}
public Iterable<Course> findAll() {
return courseRepo.findAll();
}
public Iterable<Course> findOwnedCourses(User userFromToken) {
return courseRepo.findAllOwnedCoures(userFromToken);
}
public boolean modifyData(long id, Map<String, Object> updates, Role role) {
Course target = courseRepo.findById(id);
if (target == null)
return false;
if (role == Role.Teacher){
for (Map.Entry<String, Object> entry : updates.entrySet()){
if (entry.getKey().equals("title")){
target.setTitle((String) entry.getValue());
courseRepo.save(target);
return true;
}
}
}
if (role != Role.Secretary)
return false;
for (Map.Entry<String ,Object> entry: updates.entrySet()){
switch (entry.getKey()){
case "title":
target.setTitle((String) entry.getValue());
break;
case "credits":
target.setCredits((Integer) entry.getValue());
break;
case "owner":
if (((User) entry.getValue() ).getRole() != Role.Teacher)
break;
target.setOwner((User) entry.getValue());
break;
}
}
courseRepo.save(target);
return true;
}
public void delete(Course course) {
courseRepo.delete(course);
}
}

View File

@ -0,0 +1,97 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Repositories.CurriculumCourseRepository;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@Service
public class CurriculumCourseService {
private final CurriculumCourseRepository curriculumCourseRepo;
private final CourseRepository courseRepo;
private final CurriculumRepository curriculumRepo;
public CurriculumCourseService(CurriculumCourseRepository curriculumCourseRepository, CourseRepository courseRepo, CurriculumRepository curriculumRepo) {
this.curriculumCourseRepo = curriculumCourseRepository;
this.courseRepo = courseRepo;
this.curriculumRepo = curriculumRepo;
}
public void save(CurriculumCourse curriculumCourse){
curriculumCourseRepo.save(curriculumCourse);
}
public Map<String, Object> getDepthCurriculum(Curriculum curriculum){
if (curriculum == null)
return null;
HashMap<String ,Object> toReturn = new HashMap<>();
ArrayList<Map<String ,Object>> courses = new ArrayList<>();
Iterable<Course> foundCourses = curriculumCourseRepo.findCoursesByCurriculum(curriculum);
for (Course c: foundCourses){
courses.add(ProtectionService.courseWithoutPassword(c));
}
toReturn.put("courses",courses);
toReturn.put("curriculumId", curriculum.getCurriculumId());
toReturn.put("year", curriculum.getYear());
toReturn.put("option", curriculum.getOption());
toReturn.put("requireCertificate", curriculum.isRequireCertificate());
return toReturn;
}
public Iterable<Curriculum> findCurriculumByCourses(Course course){
return curriculumCourseRepo.findCurriculumByCourses(course);
}
public Iterable<Map<String, Object>> getAllDepthCurriculum(){
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
for (Curriculum curriculum : curriculumRepo.findAll()){
toReturn.add(getDepthCurriculum(curriculum));
}
return toReturn;
}
/** tries to add all courses to the curriculum
*
* @param coursesIds the ids of the courses to be added
* @param curriculum the curriculum to add the courses to
* @return if the changes were made
*/
public boolean saveAll(Iterable<Long> coursesIds, Curriculum curriculum) {
if (curriculum == null || coursesIds == null)
return false;
ArrayList<Course> toAdd = new ArrayList<>();
for (Long courseId : coursesIds){
Course course = courseRepo.findById((long) courseId);
if (course == null)
return false;
if (!toAdd.contains(course))
toAdd.add(course);
}
for (Course course : toAdd){
curriculumCourseRepo.save(new CurriculumCourse(curriculum,course));
}
return true;
}
}

View File

@ -0,0 +1,24 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Tables.Curriculum;
@Service
public class CurriculumService {
private final CurriculumRepository curriculumRepo;
public CurriculumService(CurriculumRepository curriculumRepo){
this.curriculumRepo = curriculumRepo;
}
public Curriculum save(Curriculum curriculum){
return curriculumRepo.save(curriculum);
}
public Curriculum findById(long id){
return curriculumRepo.findById(id);
}
public void delete(Curriculum curriculum) {
curriculumRepo.delete(curriculum);
}
}

View File

@ -0,0 +1,113 @@
package ovh.herisson.Clyde.Services.Inscription;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.InscriptionRepository;
import ovh.herisson.Clyde.Repositories.Inscription.MinervalRepository;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.ExternalCurriculum;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import ovh.herisson.Clyde.Tables.Inscription.Minerval;
import java.util.ArrayList;
import java.util.Calendar;
@Service
public class InscriptionService {
private final InscriptionRepository inscriptionRepo;
private final UserRepository userRepo;
private final UserCurriculumRepository userCurriculumRepo;
private final CurriculumRepository curriculumRepo;
private final MinervalRepository minervalRepository;
private final ExternalCurriculumRepository externalCurriculumRepository;
private final UserService userService;
public InscriptionService(InscriptionRepository inscriptionRepo, UserRepository userRepo, UserCurriculumRepository userCurriculumRepo, CurriculumRepository curriculumRepo, MinervalRepository minervalRepository, ExternalCurriculumRepository externalCurriculumRepository, UserService userService){
this.inscriptionRepo = inscriptionRepo;
this.userRepo = userRepo;
this.userCurriculumRepo = userCurriculumRepo;
this.curriculumRepo = curriculumRepo;
this.minervalRepository = minervalRepository;
this.externalCurriculumRepository = externalCurriculumRepository;
this.userService = userService;
}
public InscriptionRequest save(InscriptionRequest inscriptionRequest){
return inscriptionRepo.save(inscriptionRequest);
}
public InscriptionRequest getById(long id){
return inscriptionRepo.findById(id);
}
public Iterable<InscriptionRequest> getAll(){
return inscriptionRepo.findAll();
}
public boolean modifyState(long id, RequestState requestState) {
InscriptionRequest inscrRequest = getById(id);
if (inscrRequest == null)
return false;
//If the request is already accepted we just return ok (otherwise we would duplicate the procedure below)
if (inscrRequest.getState() == RequestState.Accepted){
return true;
}
inscrRequest.setState(requestState);
save(inscrRequest);
//saves the user from the request if accepted from teacher and inscription services
if (requestState == RequestState.Accepted && (inscrRequest.getEquivalenceState() == RequestState.Accepted || inscrRequest.getEquivalenceState() == RequestState.Unrequired))
{
return createUser(inscrRequest);
}
return true;
}
public boolean createUser(InscriptionRequest inscrRequest){
//We must send an email here
if (curriculumRepo.findById(inscrRequest.getCurriculumId()) == null)
return false;
User userFromRequest = new User(
inscrRequest.getLastName(),
inscrRequest.getFirstName(),
inscrRequest.getEmail(),
inscrRequest.getAddress(),
inscrRequest.getCountry(),
inscrRequest.getBirthDate(),
inscrRequest.getProfilePicture(),
inscrRequest.getPassword(),
inscrRequest.getIdentityCard()
);
userService.save(userFromRequest);
Calendar c = Calendar.getInstance();
userCurriculumRepo.save(new UserCurriculum(userFromRequest, curriculumRepo.findById(inscrRequest.getCurriculumId()),c.get(Calendar.YEAR), true));
//Create a minerval for the new student
Minerval minerval = new Minerval(userFromRequest.getRegNo(), 0, 852, 2023);
minervalRepository.save(minerval);
//Assign the externals curriculums from the inscription request to newly created student
ArrayList<ExternalCurriculum> extCurrList = externalCurriculumRepository.getExternalCurriculumByInscriptionRequest(inscrRequest);
for (int i = 0; i < extCurrList.size(); i++){
extCurrList.get(i).setUser(userFromRequest);
externalCurriculumRepository.save(extCurrList.get(i));
}
return true;
}
public void delete(InscriptionRequest toDelete) {
inscriptionRepo.delete(toDelete);
}
}

View File

@ -0,0 +1,177 @@
package ovh.herisson.Clyde.Services;
/******************************************************
* @file LeessonRequestService.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Tables.*;
import java.util.Map;
@Service
public class LessonRequestService {
private final LessonChangesRequestRepository lessonChangesRepo;
private final UserRepository userRepo;
private final LessonRepository lessonRepo;
private final LessonService lessonServ;
private final ScheduleLessonRepository scheduleLessonRepo;
private final ScheduleRepository scheduleRepository;
private final ScheduleLessonService scheduleLessonService;
private final UserService userServ;
private final CourseRepository courseRepository;
public LessonRequestService(LessonChangesRequestRepository lessonChangesRepo,
UserRepository userRepo, LessonRepository lessonRepo,
LessonService lessonServ, ScheduleLessonRepository scheduleLessonRepo,
ScheduleRepository scheduleRepository, ScheduleLessonService scheduleLessonService,
UserService userServ, CourseRepository courseRepository) {
this.lessonChangesRepo = lessonChangesRepo;
this.userRepo = userRepo;
this.lessonRepo = lessonRepo;
this.lessonServ = lessonServ;
this.scheduleLessonRepo = scheduleLessonRepo;
this.scheduleRepository = scheduleRepository;
this.scheduleLessonService = scheduleLessonService;
this.userServ = userServ;
this.courseRepository = courseRepository;
}
/**
* Create a new lesson request
*/
public LessonChangesRequest save(LessonChangesRequest lessonRequest){
return lessonChangesRepo.save(lessonRequest);
}
/**
* Find all the requests made by a user
*/
public Iterable<LessonChangesRequest> findOwnRequests(User user){
return lessonChangesRepo.findOwnRequests(user);
}
public LessonChangesRequest findById(long id){
return lessonChangesRepo.findById(id);
}
/**
* Return all the requests
*/
public Iterable<LessonChangesRequest> getAll(){return lessonChangesRepo.findAll();}
/**
* Create a lesson if a request is accepted
*/
public boolean modifyCreateRequestState(LessonChangesRequest lessonRequest, RequestState state, String local ){
if(lessonRequest == null || state == lessonRequest.getState() || state == null){
return false;}
if (state == RequestState.Accepted){
Course course = courseRepository.findById(lessonRequest.getCourse().getCourseID());
if(courseRepository.findById(lessonRequest.getCourse().getCourseID())==null|| local == null){
return false;}
Lesson lesson = new Lesson();
lesson.setCourse(course);
lesson.setLessonStart(lessonRequest.getLessonStart());
lesson.setLessonEnd(lessonRequest.getLessonEnd());
lesson.setColor(lessonRequest.getColor());
lesson.setLocal(local);
lesson.setLessonType(lessonRequest.getLessonType());
lesson = lessonRepo.save(lesson);
scheduleLessonService.saveToAllSchedule(lesson);
}
lessonRequest.setState(state);
save(lessonRequest);
return true;
}
public Iterable<LessonChangesRequest> findRequestByLessonId(long id){
return lessonChangesRepo.findRequestByLessonId(id);
}
/**
* Refuse all the lesson request that depends on a certain lesson
* Used after the deletion of the lesson
*/
public void refuseAllByLessonId(long id){
Iterable<LessonChangesRequest> toRefuse = findRequestByLessonId(id);
for(LessonChangesRequest element : toRefuse)
element.setState(RequestState.Refused);
}
/**
* Modify a lesson if a request is accepted
*/
public boolean modifyChangeRequestState(Map<String, Object> updates, long lessonId,RequestState state){
if(state == RequestState.Accepted){
Lesson lesson = lessonServ.findById(lessonId);
return lessonServ.modifyData(lesson.getLessonID(),updates);
}
return true;
}
/**
* Delete a lesson if a request is accepted
*/
public void modifyDeleteRequest(LessonChangesRequest lessonChangesRequest, RequestState state){
if(state == RequestState.Accepted){
lessonServ.delete(lessonServ.findById(lessonChangesRequest.getLessonId()));
refuseAllByLessonId(lessonChangesRequest.getLessonId());
}
}
/**
* Construct a lesson request
*/
public LessonChangesRequest createLessonRequest(Map<String,Object> lessonInfos) {
LessonChangesRequest target = new LessonChangesRequest();
for (Map.Entry<String, Object> entry : lessonInfos.entrySet()) {
System.out.println(entry.toString());
if(entry.getValue() != null){
switch (entry.getKey()) {
case "requestType":
target.setRequestType((int) entry.getValue());
break;
case "lessonStart":
target.setLessonStart((String) entry.getValue());
break;
case "lessonEnd":
target.setLessonEnd((String) entry.getValue());
break;
case "color":
target.setColor((String) entry.getValue());
break;
case "user":
target.setUser(userServ.getUserById((int) entry.getValue()));
break;
case "lessonType":
target.setLessonType((String) entry.getValue());
break;
case "course":
target.setCourse(courseRepository.findById((int) entry.getValue()));
break;
case "lessonId":
target.setLessonId((int) entry.getValue());
break;
}
}
}
target.setState(RequestState.Pending);
return target;
}
public void delete (LessonChangesRequest toDelete) {
lessonChangesRepo.delete(toDelete);
}
}

View File

@ -0,0 +1,157 @@
package ovh.herisson.Clyde.Services;
/******************************************************
* @file LessonService.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.*;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.Map;
@Service
public class LessonService {
private final LessonRepository lessonRepo;
private final ScheduleLessonRepository scheduleLessonRepo;
private final UserCurriculumRepository userCurriculumRepo;
private final UserService userServ;
private final CourseRepository courseRepo;
private final CurriculumCourseRepository curriculumCourseRepo;
public LessonService(LessonRepository lessonRepo, ScheduleLessonRepository scheduleLessonRepo, UserCurriculumRepository userCurriculumRepo, UserService userServ, CourseRepository courseRepo, CurriculumCourseRepository curriculumCourseRepo){
this.lessonRepo = lessonRepo;
this.scheduleLessonRepo = scheduleLessonRepo;
this.userCurriculumRepo = userCurriculumRepo;
this.userServ = userServ;
this.courseRepo = courseRepo;
this.curriculumCourseRepo = curriculumCourseRepo;
}
/**
* Create a lesson
*/
public Lesson save(Lesson lesson){
return lessonRepo.save(lesson);
}
/**
* Find a lesson by its id
*/
public Lesson findById(long id){
return lessonRepo.findById(id);
}
/**
* Return all the lessons
*/
public Iterable<Lesson> findAll(){return lessonRepo.findAll();}
/**
* Return all a teacher's lessons
*/
public Iterable<Lesson> findAllOwnedLesson(User teacher){
ArrayList<Lesson> toReturn = new ArrayList<>();
ArrayList<Course> coursesOwned = (ArrayList<Course>) courseRepo.findAllOwnedCoures(teacher);
for (Course element : coursesOwned) {
for(Lesson lesson : lessonRepo.findLessonByCourse(element))
toReturn.add(lesson);
}
return toReturn;
}
/**
* Return all a student's lessons
*/
public Iterable<Lesson> findOnesLessons(User student){
ArrayList<Lesson> toReturn = new ArrayList<>();
ArrayList<Course> courses = new ArrayList<>();
ArrayList<UserCurriculum> userCurricula = userCurriculumRepo.findByUserAndActual(student, true);
for (UserCurriculum userCurriculum : userCurricula) {
curriculumCourseRepo.findCoursesByCurriculum(userCurriculum.getCurriculum()).forEach((item) -> {
//We need this to eliminate clones because a course can belong to several curriculums
if (!courses.contains(item)) {
System.out.println(item.getTitle());
courses.add(item);
}
});
}
for (Course element : courses) {
for(Lesson lesson : lessonRepo.findLessonByCourse(element))
toReturn.add(lesson);
}
return toReturn;
}
/**
* Construct a new lesson
*/
public Lesson createLesson(Map<String,Object> lessonInfos) {
Lesson target = new Lesson();
for (Map.Entry<String, Object> entry : lessonInfos.entrySet()) {
switch (entry.getKey()) {
case "lessonStart":
target.setLessonStart((String) entry.getValue());
break;
case "lessonEnd":
target.setLessonEnd((String) entry.getValue());
case "color":
target.setColor((String) entry.getValue());
break;
case "local":
target.setLocal((String) entry.getValue());
break;
case "lessonType":
target.setLessonType((String) entry.getValue());
break;
case "courseID":
target.setCourse(courseRepo.findById((int) entry.getValue()));
break;
}
}
return target;
}
/**
* Modify a lesson
*/
public boolean modifyData(long id, Map<String ,Object> updates){
Lesson target = lessonRepo.findById(id);
if(target == null)
return false;
for (Map.Entry<String , Object> entry: updates.entrySet()){
switch (entry.getKey()){
case "lessonStart":
target.setLessonStart((String) entry.getValue());
break;
case "lessonEnd":
target.setLessonEnd((String) entry.getValue());
break;
case "local":
target.setLocal((String) entry.getValue());
break;
case "lessonType":
target.setLessonType((String) entry.getValue());
break;
}
}
Lesson lesson = lessonRepo.save(target);
ScheduleLesson scheduleLesson = scheduleLessonRepo.findByLesson(lesson);
Iterable<User> users = userCurriculumRepo.findUsersByCurriculum(scheduleLesson.getSchedule().getCurriculum());
for(User user: users){
userServ.Notify(user, new Notification("Course modified in the schedule", "Course Modified " + lesson.getCourse().getTitle() , "/#/schedule"));
}
return true;
}
/**
* Delete a lesson
*/
public void delete(Lesson lesson){
lessonRepo.delete(lesson);
}
}

View File

@ -0,0 +1,64 @@
package ovh.herisson.Clyde.Services.Msg;
import java.util.List;
/******************************************************
* @file DiscussionService.java
* @author Anthony Debucquoy
* @scope Extension messagerie
*
* Various function utilised by the messages application
******************************************************/
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.util.JSONPObject;
import ovh.herisson.Clyde.Repositories.Msg.DiscussionRepository;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Tables.Notification;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Discussion;
import ovh.herisson.Clyde.Tables.Msg.Message;
@Service
public class DiscussionService {
@Autowired
private DiscussionRepository discRepo;
@Autowired
private UserService userServ;
public Discussion create(String name, User author){
return discRepo.save(new Discussion(name, author));
}
/**
* list discussions owned by a certain user
*/
public Iterable<Discussion> getOwned(User author){
return discRepo.findByMembership(author.getRegNo());
}
/**
* Create a message and link it to it's discussion
*/
public Discussion CreateMessage(Discussion disc, Message msg){
for(User u: disc.getMembers()){
userServ.Notify(u, new Notification("msg.notification.new", msg.getContent(), "/#/msg"));
}
disc.addMessage(msg);
return discRepo.save(disc);
}
/**
* Check if a user is in a discussion
*/
public boolean hasDiscussion(User user, long id) {
Discussion disc = discRepo.findById(id).orElse(null);
List<User> members = disc.getMembers();
return members.contains(user);
}
}

View File

@ -0,0 +1,47 @@
package ovh.herisson.Clyde.Services.Msg;
import org.springframework.stereotype.Service;
import lombok.AllArgsConstructor;
import ovh.herisson.Clyde.Repositories.CourseRepository;
import ovh.herisson.Clyde.Repositories.Msg.ForumRepository;
import ovh.herisson.Clyde.Repositories.Msg.TopicRepository;
import ovh.herisson.Clyde.Services.UserService;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Notification;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Answer;
import ovh.herisson.Clyde.Tables.Msg.Forum;
import ovh.herisson.Clyde.Tables.Msg.Topic;
@Service
@AllArgsConstructor
public class ForumService {
private UserService userServ;
private CourseRepository courseRepo;
private ForumRepository forumRepo;
private TopicRepository topicRepo;
public void createForum(Course c, Forum f){
c.addForum(f);
for (User u: f.getRegister()) {
userServ.Notify(u, new Notification("forum.notification.forum.new", f.getName(), "/#/Forum"));
}
courseRepo.save(c);
}
public void createTopic(Forum f, Topic data) {
f.addTopic(data);
for (User u: f.getRegister()) {
userServ.Notify(u, new Notification("forum.notification.topic.new", data.getSubject(), "/#/Forum"));
}
forumRepo.save(f);
}
public void answerTopic(Topic t, Answer data, User u) {
data.setAuthor(u);
t.addAnswer(data);
topicRepo.save(t);
}
}

View File

@ -0,0 +1,9 @@
package ovh.herisson.Clyde.Services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class NotificationService {
}

View File

@ -0,0 +1,161 @@
package ovh.herisson.Clyde.Services;
import ovh.herisson.Clyde.Tables.*;
import ovh.herisson.Clyde.Tables.Inscription.InscriptionRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class ProtectionService {
/** return user's data except password
* @param user the user to return
* @return all the user data without the password
*/
public static HashMap<String,Object> userWithoutPassword(User user){
if (user ==null)
return null;
HashMap<String,Object> toReturn = new HashMap<>();
toReturn.put("regNo",user.getRegNo());
toReturn.put("lastName",user.getLastName());
toReturn.put("firstName",user.getFirstName());
toReturn.put("email", user.getEmail());
toReturn.put("address",user.getAddress());
toReturn.put("birthDate",user.getBirthDate());
toReturn.put("country",user.getCountry());
toReturn.put("profilePictureUrl",user.getProfilePictureUrl());
toReturn.put("role",user.getRole());
toReturn.put("identityCard", user.getIdentityCardUrl());
return toReturn;
}
public static Iterable<HashMap<String ,Object>>usersWithoutPasswords(Iterable<User> users){
ArrayList<HashMap<String,Object>> toReturn = new ArrayList<>();
for (User u : users){
toReturn.add(userWithoutPassword(u));
}
return toReturn;
}
public static HashMap<String,Object> courseWithoutPassword(Course course){
if (course == null)
return null;
HashMap<String ,Object> toReturn = new HashMap<>();
toReturn.put("courseID",course.getCourseID());
toReturn.put("credits",course.getCredits());
toReturn.put("title", course.getTitle());
toReturn.put("owner", userWithoutPassword(course.getOwner()));
return toReturn;
}
public static Iterable<HashMap<String ,Object>> coursesWithoutPasswords(Iterable<Course> courses){
ArrayList<HashMap<String,Object>> toReturn = new ArrayList<>();
for (Course course: courses){
toReturn.add(ProtectionService.courseWithoutPassword(course));
}
return toReturn;
}
public static HashMap<String , Object> lessonWithoutPassword(Lesson lesson){
if(lesson == null)
return null;
HashMap<String, Object> toReturn = new HashMap<>();
toReturn.put("lessonID", lesson.getLessonID());
toReturn.put("lessonStart", lesson.getLessonStart());
toReturn.put("lessonEnd", lesson.getLessonEnd());
toReturn.put("course",courseWithoutPassword(lesson.getCourse()));
toReturn.put("local",lesson.getLocal());
toReturn.put("color", lesson.getColor());
toReturn.put("lessonType",lesson.getLessonType());
return toReturn;
}
public static Iterable<HashMap<String ,Object>> lessonsWithoutPassword(Iterable<Lesson> lessons){
ArrayList<HashMap<String,Object>> toReturn = new ArrayList<>();
for (Lesson l: lessons){
toReturn.add(ProtectionService.lessonWithoutPassword(l));
}
return toReturn;
}
public static Map<String, Object> requestWithoutPassword(InscriptionRequest inscriptionRequest) {
if (inscriptionRequest == null)
return null;
Map<String, Object> toReturn = new HashMap<>();
toReturn.put("id", inscriptionRequest.getId());
toReturn.put("lastName", inscriptionRequest.getLastName());
toReturn.put("firstName", inscriptionRequest.getFirstName());
toReturn.put("address", inscriptionRequest.getAddress());
toReturn.put("email",inscriptionRequest.getEmail());
toReturn.put("birthDate", inscriptionRequest.getBirthDate());
toReturn.put("country", inscriptionRequest.getCountry());
toReturn.put("curriculum", inscriptionRequest.getCurriculumId());
toReturn.put("state", inscriptionRequest.getState());
toReturn.put("profilePictureUrl", inscriptionRequest.getProfilePicture());
toReturn.put("identityCard", inscriptionRequest.getIdentityCard());
toReturn.put("submissionDate", inscriptionRequest.getSubmissionDate());
toReturn.put("equivalenceState", inscriptionRequest.getEquivalenceState());
toReturn.put("admissionDocUrl", inscriptionRequest.getAdmissionDocUrl());
return toReturn;
}
public static Map<String, Object> lessonRequestWithoutPassword(LessonChangesRequest lessonRequest){
if (lessonRequest == null)
return null;
Map<String, Object> toReturn = new HashMap<>();
toReturn.put("id", lessonRequest.getId());
toReturn.put("lessonStart", lessonRequest.getLessonStart());
toReturn.put("lessonEnd", lessonRequest.getLessonEnd());
toReturn.put("lessonType",lessonRequest.getLessonType());
toReturn.put("course", courseWithoutPassword(lessonRequest.getCourse()));
toReturn.put("user", userWithoutPassword(lessonRequest.getUser()));
toReturn.put("requestType", lessonRequest.getRequestType());
toReturn.put("state", lessonRequest.getState());
toReturn.put("lessonId",lessonRequest.getLessonId());
return toReturn;
}
public static Iterable<Map<String, Object>> lessonRequestsWithoutPassword(Iterable<LessonChangesRequest> lessonChangesRequests){
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
for(LessonChangesRequest lessonChangeRequest: lessonChangesRequests){
toReturn.add(lessonRequestWithoutPassword(lessonChangeRequest));
}
return toReturn;
}
public static Iterable<Map<String ,Object>> requestsWithoutPasswords(Iterable<InscriptionRequest> inscriptionRequests){
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
for (InscriptionRequest i:inscriptionRequests){
toReturn.add(requestWithoutPassword(i));
}
return toReturn;
}
}

View File

@ -0,0 +1,105 @@
package ovh.herisson.Clyde.Services;
/******************************************************
* @file ScheduleLessonService.java
* @author William Karpinski
* @scope Extension Horaire
******************************************************/
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.LessonRepository;
import ovh.herisson.Clyde.Repositories.ScheduleLessonRepository;
import ovh.herisson.Clyde.Repositories.ScheduleRepository;
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@Service
public class ScheduleLessonService {
private final ScheduleLessonRepository scheduleLessonRepo;
private final UserCurriculumRepository userCurriculumRepo;
private final UserService userServ;
private final LessonRepository lessonRepo;
private final ScheduleRepository scheduleRepo;
public ScheduleLessonService(ScheduleLessonRepository scheduleLessonRepo, UserCurriculumRepository userCurriculumRepo, UserService userServ, LessonRepository lessonRepo, ScheduleRepository scheduleRepo) {
this.scheduleLessonRepo = scheduleLessonRepo;
this.userCurriculumRepo = userCurriculumRepo;
this.userServ = userServ;
this.lessonRepo = lessonRepo;
this.scheduleRepo = scheduleRepo;
}
public boolean save(ScheduleLesson scheduleLesson){
if(scheduleLesson == null)
return false;
scheduleLessonRepo.save(scheduleLesson);
Iterable<User> users = userCurriculumRepo.findUsersByCurriculum(scheduleLesson.getSchedule().getCurriculum());
for(User user: users){
userServ.Notify(user, new Notification("New course in the schedule", "Course added " + scheduleLesson.getLesson().getCourse().getTitle(), "/#/schedule"));
}
return true;
}
/**
* Save a lesson to all the schedule it is linked
*/
public void saveToAllSchedule(Lesson lesson){
Iterable<Schedule> schedules = scheduleRepo.findAllLessonSchedule(lesson.getCourse());
if(schedules == null)
return;
for (Schedule schedule : schedules){
save(new ScheduleLesson(schedule, lesson));
}
}
/**
* Delete a scheduleLesson via its lesson
*/
public boolean delete(long lessonId){
if(lessonId == 0)
return false;
ScheduleLesson scheduleLesson = scheduleLessonRepo.findByLesson(lessonRepo.findById(lessonId));
Iterable<User> users = userCurriculumRepo.findUsersByCurriculum(scheduleLesson.getSchedule().getCurriculum());
for(User user: users){
userServ.Notify(user, new Notification("Course deleted in the schedule","Course deleted " + scheduleLesson.getLesson().getCourse().getTitle(), "/#/schedule"));
}
scheduleLessonRepo.delete(lessonRepo.findById(lessonId));
return true;
}
public Schedule getScheduleByCurriculum(Curriculum curriculum){
return scheduleLessonRepo.findScheduleByCurriculum(curriculum);
}
/**
* Return a schedule and the list of lessons that corresponds
*/
public Map<String , Object> getDepthScheduleBySchedule(Schedule schedule){
if(schedule == null)
return null;
HashMap<String , Object> toReturn = new HashMap<>();
ArrayList<Map<String, Object>> lessons = new ArrayList<>();
Iterable<Lesson> foundLessons = scheduleLessonRepo.findLessonByCurriculum(schedule.getCurriculum());
for (Lesson l: foundLessons){
lessons.add(ProtectionService.lessonWithoutPassword(l));
}
toReturn.put("lessons",lessons);
toReturn.put("scheduleId" , schedule.getScheduleID());
toReturn.put("curriculum", schedule.getCurriculum());
return toReturn;
}
/**
* Return all the schedules
*/
public Iterable<Map<String,Object>> getAllSchedule(){
ArrayList<Map<String,Object>> toReturn = new ArrayList<>();
for (Schedule schedule: scheduleRepo.findAll()){
toReturn.add(getDepthScheduleBySchedule(schedule));
}
return toReturn;
}
}

View File

@ -0,0 +1,24 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.ScheduleRepository;
import ovh.herisson.Clyde.Tables.Schedule;
@Service
public class ScheduleService {
private final ScheduleRepository scheduleRepo;
public ScheduleService(ScheduleRepository scheduleRepo) {
this.scheduleRepo = scheduleRepo;
}
public Schedule save(Schedule schedule){
return scheduleRepo.save(schedule);
}
public Schedule findById(long id){
return scheduleRepo.getById(id);
}
public void delete(Schedule schedule){
scheduleRepo.delete(schedule);
}
}

View File

@ -0,0 +1,178 @@
package ovh.herisson.Clyde.Services.ScientificPublications;
/******************************************************
* @file ResearchesService.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Service for managing researcher and researches
******************************************************/
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearcherRepository;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.ScientificPublications.*;
import ovh.herisson.Clyde.Tables.User;
import java.util.*;
@Service
@AllArgsConstructor
@SuppressWarnings("unchecked")
public class ResearchesService {
private final ResearcherRepository researcherRepo;
private final ResearchRepository articleRepo;
// researches Part
public Research getResearchById(long id) {
return articleRepo.findById(id);
}
public Research getResearchByUrl(String url) {
return articleRepo.findByPdfLocation(url);
}
public Iterable<Research> getResearchesByAuthor(long authorId){
Researcher researcher = researcherRepo.findById(authorId);
if (researcher == null) return null;
return researcherRepo.findAllByAuthorId(researcher);
}
public Research saveResearch(Research research) {
return articleRepo.save(research);
}
public void modifyResearchData(Research research, Map<String, Object> updates) {
for (Map.Entry<String, Object> entry : updates.entrySet()){
switch (entry.getKey()){
case "title":
research.setTitle((String) entry.getValue());
break;
case "paperType":
research.setPaperType((PaperType) entry.getValue());
break;
case "language":
research.setLanguage((String) entry.getValue());
break;
case "domain":
research.setDomain((String) entry.getValue());
break;
case "summary":
research.setSummary((String) entry.getValue());
break;
case "access":
research.setAccess(Access.valueOf((String) entry.getValue()));
break;
case "coAuthors":
Set<Researcher> set = new HashSet<>();
for (int id : (List<Integer>) entry.getValue()) {
Researcher r = researcherRepo.findById(id);
if (r != null){
set.add(r);
}
}
research.setCoAuthors(set);
break;
}
}
articleRepo.save(research);
}
public void deleteResearch(Research research) {
articleRepo.delete(research);
}
// Researchers Part
public Researcher getResearcherByUser(User user){
return researcherRepo.findByUser(user);
}
public Iterable<Research> getAllResearches() {
return articleRepo.findAll();
}
public Researcher saveResearcher(Researcher researcher) {
if (researcherRepo.findByUser(researcher.getUser()) != null) return null;
return researcherRepo.save(researcher);
}
public Iterable<Researcher> getAllResearchers() {
return researcherRepo.findAll();
}
public Researcher getResearcherById(long id) {
return researcherRepo.findById(id);
}
public void deleteResearcher(Researcher researcher) {
articleRepo.findAll();
for (Research r: articleRepo.findAll())
{
if (r.getCoAuthors().contains(researcher)){
r.getCoAuthors().remove(researcher);
articleRepo.save(r);
}
}
researcherRepo.delete(researcher);
}
public void modifyResearcherData(Researcher researcher, Map<String, Object> updates) {
for (Map.Entry<String, Object> entry : updates.entrySet()){
switch (entry.getKey()){
case "orcidId":
if (entry.getValue() != null)
researcher.setOrcidId((String) entry.getValue());
break;
case "domain":
if (entry.getValue() != null)
researcher.setDomain((String) entry.getValue());
break;
case "site":
if (entry.getValue() != null)
researcher.setSite((String) entry.getValue());
break;
}
}
researcherRepo.save(researcher);
}
// Other stuff
public Research addView(Research research) {
research.setViews(research.getViews()+1);
return articleRepo.save(research);
}
public boolean hasNoAccessTo(Research research, User user){
if (research.getAccess() == Access.OpenSource) return false; // if the access is open source even non-users can see it
if (user == null) return true; // else you need at least to be a user
if (user.getRole() == Role.Admin) return false;
Researcher researcher = getResearcherByUser(user);
if (researcher !=null ){
if (research.getAuthor().getId() == researcher.getId())
return false;
for (Researcher coAuthor: research.getCoAuthors()){
if (coAuthor.getId() == researcher.getId())
return false;
}
}
return research.getAccess() != Access.Restricted || (user.getRole() != Role.Secretary &&
user.getRole() != Role.Teacher && user.getRole() != Role.InscriptionService);
// if the access is restricted only the staff member (above) can access the research
}
}

View File

@ -0,0 +1,50 @@
package ovh.herisson.Clyde.Services.ScientificPublications;
/******************************************************
* @file StatisticsService
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Service for managing statistics
******************************************************/
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.StatsRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.util.*;
@Service
@AllArgsConstructor
public class StatisticsService {
private ResearchRepository articleRepo;
private StatsRepository statsRepo;
public Iterable<Iterable<Map<String, Integer>>> generateStats(Researcher researcher){
Iterable<Research> researches = articleRepo.findByAuthor(researcher);
if (researches == null) return null;
ArrayList<Iterable<Map<String,Integer>>> toReturn = new ArrayList<>();
toReturn.add(statsRepo.viewsByYears());
toReturn.add(statsRepo.viewsByMonths());
toReturn.add(statsRepo.viewsByTopics());
toReturn.add(statsRepo.researchesByYears());
toReturn.add(statsRepo.researchesByMonth());
toReturn.add(statsRepo.researchesByTopics());
toReturn.add(statsRepo.languageByYears());
toReturn.add(statsRepo.languageByMonths());
toReturn.add(statsRepo.languageByTopics());
return toReturn;
}
}

View File

@ -0,0 +1,69 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import ovh.herisson.Clyde.Repositories.FileRepository;
import ovh.herisson.Clyde.Tables.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Objects;
import java.util.UUID;
@Service
public class StorageService {
private final Path rootLocation = Paths.get("cdn/");
private final FileRepository fileRepo;
public StorageService(FileRepository filerepo){
this.fileRepo = filerepo;
if(!Files.exists(rootLocation)){
try {
Files.createDirectories(rootLocation);
} catch(IOException e){
e.printStackTrace();
}
}
}
public StorageFile store(MultipartFile file, FileType fileType) {
if (file == null || file.getOriginalFilename() == null)
return null;
if (file.getOriginalFilename().isEmpty()){return null;}
UUID uuid = UUID.randomUUID();
String stringUuid = uuid + "." + file.getOriginalFilename().split("\\.",2)[1];
try {
if (file.isEmpty()) {
return null;
}
Path destinationFile = this.rootLocation.resolve(Paths.get(stringUuid));
Files.copy(file.getInputStream(), destinationFile,StandardCopyOption.REPLACE_EXISTING);
}
catch (IOException e) {
return null;
}
String url = this.rootLocation.resolve(Paths.get(Objects.requireNonNull(stringUuid)))
.normalize().toString();
return fileRepo.save(new StorageFile(file.getOriginalFilename(),url, fileType));
}
public void delete(StorageFile file) throws SecurityException {
File f = new File(file.getUrl());
f.delete();
//Delete l'entité
fileRepo.delete(file);
}
}

View File

@ -0,0 +1,53 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Controller;
import ovh.herisson.Clyde.Repositories.TeacherCourseRepository;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Tables.Course;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.TeacherCourse;
import ovh.herisson.Clyde.Tables.User;
import java.util.ArrayList;
@Controller
public class TeacherCourseService {
private final TeacherCourseRepository teacherCourseRepo;
private final UserRepository userRepo;
public TeacherCourseService(TeacherCourseRepository teacherCourseRepo, UserRepository userRepo) {
this.teacherCourseRepo = teacherCourseRepo;
this.userRepo = userRepo;
}
public Iterable<User> findCourseAssistants(Course course) {
if (course == null)
return null;
return teacherCourseRepo.findAllAssistantOfCourse(course);
}
public boolean saveAll(Iterable<Long> teacherIds, Course course){
if (course == null || teacherIds == null)
return false;
ArrayList<User> toAdd = new ArrayList<>();
for (Long teacherId : teacherIds){
User teacher = userRepo.findById((long) teacherId);
if ( teacher== null){
return false;
}
if (!toAdd.contains(teacher) && teacher.getRole() == Role.Teacher)
{
toAdd.add(teacher);
}
}
for (User teacher: toAdd){
teacherCourseRepo.save(new TeacherCourse(teacher,course));
}
return true;
}
}

View File

@ -0,0 +1,74 @@
package ovh.herisson.Clyde.Services;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.TokenRepository;
import ovh.herisson.Clyde.Tables.Token;
import ovh.herisson.Clyde.Tables.User;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Calendar;
@Service
public class TokenService {
private final TokenRepository tokenRepo;
public TokenService(TokenRepository tokenRepo){
this.tokenRepo = tokenRepo;
}
public Iterable<Token> getAllTokens() {
return tokenRepo.findAll();
}
public String generateNewToken(){
byte[] bytes = new byte[64];
new SecureRandom().nextBytes(bytes);
for (int i = 0; i < bytes.length; i++) {
bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32));
}
// will never end up in the catch because of the way that SecureRandom.nextBytes is implemented
try {
return new String(Base64.getEncoder().encode(bytes),"ISO_8859_1");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
public User getUserFromToken(String token) {
Token tokenRep = tokenRepo.getByToken(token);
if (tokenRep == null)
return null;
return tokenRep.getUser();
}
public void saveToken(Token token){
//Si l'utilisateur a déja 5 token delete celui qui devait expirer le plus vite
ArrayList<Token> tokenList = tokenRepo.getByUserOrderByExpirationDate(token.getUser());
while(tokenList.size() >= 5){
tokenRepo.delete(tokenList.getFirst());
tokenList.remove(tokenList.getFirst());
}
tokenRepo.save(token);
}
//Tous les jours a minuit
@Scheduled(cron = "0 0 0 * * ?")
public void autoDeleteToken() {
for (Token t: tokenRepo.findAll()){
Calendar cal = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
cal2.setTime(t.getExpirationDate());
if (cal.compareTo(cal2) >= 0){
tokenRepo.delete(t);
}
}
}
}

View File

@ -0,0 +1,55 @@
package ovh.herisson.Clyde.Services;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.CurriculumRepository;
import ovh.herisson.Clyde.Repositories.Inscription.ExternalCurriculumRepository;
import ovh.herisson.Clyde.Repositories.UserCurriculumRepository;
import ovh.herisson.Clyde.Tables.*;
import java.util.ArrayList;
import java.util.HashMap;
@Service
public class UserCurriculumService {
private final UserCurriculumRepository userCurriculumRepository;
private final CurriculumRepository curriculumRepo;
private final ExternalCurriculumRepository externalCurriculumRepo;
public UserCurriculumService(UserCurriculumRepository userCurriculumRepository, CurriculumRepository curriculumRepo, ExternalCurriculumRepository externalCurriculumRepo) {
this.userCurriculumRepository = userCurriculumRepository;
this.curriculumRepo = curriculumRepo;
this.externalCurriculumRepo = externalCurriculumRepo;
}
public Curriculum findByUser(User student){
return userCurriculumRepository.findByUser(student);
}
public HashMap<String,Object> findAllCurriculumByStudent(User student) {
ArrayList<UserCurriculum> list = userCurriculumRepository.findByUserOrderByCurriculum(student);
ArrayList<HashMap<String, Object>> curriculumlist = new ArrayList<HashMap<String, Object>>();
for (int i = 0; i < list.size(); i++) {
HashMap<String, Object> element = new HashMap<>();
Curriculum c = list.get(i).getCurriculum();
element.put("curriculumId", c.getCurriculumId());
element.put("year", c.getYear());
element.put("option", c.getOption());
element.put("dateyear", list.get(i).getYear());
element.put("actual", list.get(i).isActual());
curriculumlist.add(element);
}
HashMap<String, Object> toReturn = new HashMap<String, Object>();
toReturn.put("curriculumList", curriculumlist);
return toReturn;
}
public ArrayList<UserCurriculum> findByStudentAndActual(User u, boolean actual){
return userCurriculumRepository.findByUserAndActual(u, actual);
}
}

View File

@ -0,0 +1,142 @@
package ovh.herisson.Clyde.Services;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Tables.RegNoGenerator;
import ovh.herisson.Clyde.Repositories.UserRepository;
import ovh.herisson.Clyde.Tables.Notification;
import ovh.herisson.Clyde.Tables.Role;
import ovh.herisson.Clyde.Tables.User;
import java.util.*;
@Service
public class UserService {
private final UserRepository userRepo;
private final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
public UserService(UserRepository userRepo){
this.userRepo = userRepo;
}
/** return the user identified by th identifier
*
* @param identifier can be an email or the RegNo
* @return the identified user
*/
public User getUser(String identifier){
if (identifier == null)
return null;
try {
int id = Integer.parseInt(identifier);
return userRepo.findById(id);
}
catch (NumberFormatException nfe){
return userRepo.findByEmail(identifier);
}
}
/** modify the target data
* verify the permission of modifying from the poster
*
* @param poster the user wanting to modify target's data
* @param updates the changes to be made
* @param targetId the id of the user to update
* @return if the changes were done or not
*/
public User modifyData(long targetId, Map<String ,Object> updates, User poster){
User target = userRepo.findById(targetId);
if (target == null)
return null;
if (!target.getRegNo().equals(poster.getRegNo()) && !(poster.getRole() == Role.Secretary) &&
!(poster.getRole() == Role.Admin))
return null;
for (Map.Entry<String, Object> entry : updates.entrySet()){
System.out.println(entry.getValue());
switch (entry.getKey()){
case "firstName":
target.setFirstName((String) entry.getValue());
break;
case "lastName":
target.setLastName((String) entry.getValue());
break;
case "email":
target.setEmail((String) entry.getValue());
break;
case "address":
target.setAddress((String) entry.getValue());
break;
case "country":
target.setCountry((String) entry.getValue());
break;
case "birthDate":
target.setBirthDate((Date) entry.getValue());
break;
case "profilePictureUrl":
target.setProfilePictureUrl((String) entry.getValue());
break;
case "password":
target.setPassword((String) entry.getValue());
break;
case "role":
//a user can't change his own role
if (poster.getRole()==Role.Secretary || poster.getRole() == Role.Admin){
Role wanted = Role.valueOf((String) entry.getValue());
if (wanted == Role.Admin && poster.getRole() != Role.Admin)
return null;
target.setRole(wanted);
}
}
}
userRepo.save(target);
return target;
}
public boolean checkPassword(User user, String tryingPassword){
return passwordEncoder.matches(tryingPassword, user.getPassword());
}
public User save(User user){
RegNoGenerator.resetCount();
return userRepo.save(user);
}
public void saveAll(ArrayList<User> list){
//S'assure que le compteur est bien a 0
RegNoGenerator.resetCount();
userRepo.saveAll(list);
}
public Iterable<User> getAll(){
return userRepo.findAll();
}
public Iterable<User> getAllExceptAdmins(){
return userRepo.findAllExceptAdmins();
}
public Iterable<User> getAllTeachers (){return userRepo.findAllTeachers();}
public Iterable<User> getAllStudents(){return userRepo.findAllStudents();}
public User getUserById(long id) {
return userRepo.findById(id);
}
public void delete(User user) {
userRepo.delete(user);
}
public void Notify(User u, Notification n){
n.setUser(u);
u.getNotifications().add(n);
userRepo.save(u);
}
}

Some files were not shown because too many files have changed in this diff Show More