Imports cleanup

This commit is contained in:
Rohan Sircar 2020-05-27 16:58:52 +05:30
parent 90ed86400b
commit 7ff31c45ee
4 changed files with 7 additions and 14 deletions

View File

@ -2,9 +2,6 @@ package org.ros.chatto.controller;
import java.security.Principal; import java.security.Principal;
import java.time.Instant; import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -93,9 +90,8 @@ public class ChatMessageController {
@PathVariable final String userName, @PathVariable final String userName,
@PathVariable final Instant lastMessageTime, @PathVariable final Instant lastMessageTime,
final Principal principal) { final Principal principal) {
final List<ChatMessageDTO> chatMessageDTOs = chatService final List<ChatMessageDTO> chatMessageDTOs = chatService.getNewMessages(
.getNewMessages(principal.getName(), userName, principal.getName(), userName, Date.from(lastMessageTime));
Date.from(lastMessageTime));
return chatMessageDTOs; return chatMessageDTOs;
} }

View File

@ -13,8 +13,6 @@ import javax.validation.Valid;
import org.ros.chatto.dto.UserRegistrationDTO; import org.ros.chatto.dto.UserRegistrationDTO;
import org.ros.chatto.service.CaptchaService; import org.ros.chatto.service.CaptchaService;
import org.ros.chatto.service.UserService; import org.ros.chatto.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -1,7 +1,6 @@
package org.ros.chatto.model; package org.ros.chatto.model;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Set; import java.util.Set;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
@ -50,14 +49,15 @@ public class ChatUser {
@ToString.Exclude @ToString.Exclude
@EqualsAndHashCode.Exclude @EqualsAndHashCode.Exclude
@OneToMany(mappedBy = "user", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, @OneToMany(mappedBy = "user", cascade = { CascadeType.PERSIST,
CascadeType.REFRESH }) CascadeType.MERGE, CascadeType.DETACH, CascadeType.REFRESH })
@JsonBackReference @JsonBackReference
private Set<UserRole> userRoles; private Set<UserRole> userRoles;
// @ToString.Exclude // @ToString.Exclude
// @EqualsAndHashCode.Exclude // @EqualsAndHashCode.Exclude
// @OneToMany(mappedBy = "fromUser", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, // @OneToMany(mappedBy = "fromUser", cascade = { CascadeType.PERSIST,
// CascadeType.MERGE, CascadeType.DETACH,
// CascadeType.REFRESH }) // CascadeType.REFRESH })
// private List<ChatMessage> chatMessages; // private List<ChatMessage> chatMessages;
} }

View File

@ -4,7 +4,6 @@ import java.io.IOException;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
import javax.servlet.ServletException; import javax.servlet.ServletException;