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

This commit is contained in:
Debucquoy Anthony 2024-04-21 23:25:03 +02:00
parent 32810a9b01
commit 8ac1f7ed8b
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
3 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,7 @@ 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.User;
import ovh.herisson.Clyde.Tables.Msg.Answer;
@ -16,17 +17,24 @@ import ovh.herisson.Clyde.Tables.Msg.Topic;
@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", data.getSubject(), "/#/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);
}

View File

@ -125,6 +125,8 @@ msg.notification.new=You have a new message
forum.create=Create forum
forum.create.name=New forum's name
forum.post.create.name=New post's title
forum.notification.topic.new=New topic created
forum.notification.forum.new=New Forum created
firstname/name=Firstname/Name
regNo=regNo
From=From

View File

@ -125,6 +125,8 @@ msg.notification.new=Vous avez un nouveau message!
forum.create=Créer un forum
forum.create.name=Nom du forum
forum.post.create.name=Titre du post
forum.notification.topic.new=Nouveau Topic crée
forum.notification.forum.new=Nouveau forum crée
firstname/name=Prénom/Nom
regNo=Matricule
From=De