1
0
forked from PGL/Clyde

Adding the discussion architectures and creating new discussions

This commit is contained in:
2024-03-25 00:08:44 +01:00
parent 7b9f021c24
commit 66e7fa24a1
8 changed files with 172 additions and 21 deletions

View File

@ -0,0 +1,24 @@
package ovh.herisson.Clyde.Services.Msg;
import org.springframework.stereotype.Service;
import lombok.AllArgsConstructor;
import ovh.herisson.Clyde.Repositories.Msg.DiscussionRepository;
import ovh.herisson.Clyde.Tables.User;
import ovh.herisson.Clyde.Tables.Msg.Discussion;
@Service
@AllArgsConstructor
public class DiscussionService {
private DiscussionRepository discRepo;
public Discussion create(String name, User author){
return discRepo.save(new Discussion(name, author));
}
public Iterable<Discussion> getOwned(User author){
return discRepo.findByMembership(author.getRegNo());
}
}