feat(stream): add streaming endpoint and indicator
This commit is contained in:
@@ -85,9 +85,14 @@ public class StreamService {
|
||||
streamRepository.saveAndFlush(stream);
|
||||
}
|
||||
|
||||
public Optional<Stream> getActiveStream(String streamKey) {
|
||||
User user = resolveUser(streamKey);
|
||||
return streamRepository.findByUserAndEndDateIsNull(user);
|
||||
public Optional<Stream> getActiveStream() {
|
||||
Optional<User> user = userService.getLoggedInUser();
|
||||
|
||||
if (user.isEmpty()) {
|
||||
throw new NotAuthenticated("Log in to see user streams");
|
||||
}
|
||||
|
||||
return streamRepository.findByUserAndEndDateIsNull(user.get());
|
||||
}
|
||||
|
||||
public List<Stream> getStreamHistory(Long userId) {
|
||||
|
||||
@@ -28,7 +28,6 @@ public class UserService {
|
||||
private final UserRepository userRepository;
|
||||
private final JwtService jwtService;
|
||||
|
||||
|
||||
public UserService(UserRepository userRepository,
|
||||
JwtService jwtService,
|
||||
@Value("${google.client.id}") String googleClientId) {
|
||||
|
||||
Reference in New Issue
Block a user