Skip to content

Commit

Permalink
updated: update entities and create file for enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Oct 24, 2024
1 parent f62e089 commit 0fee8f9
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/chat/yourway/ChatYourWayApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chat.yourway.config.redis;

import com.chat.yourway.model.token.Token;
import com.chat.yourway.model.redis.Token;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chat.yourway.dto.common;

import com.chat.yourway.model.email.EmailMessageType;
import com.chat.yourway.model.enums.EmailMessageType;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.chat.yourway.dto.response;

import com.chat.yourway.dto.response.notification.LastMessageResponseDto;
import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/chat/yourway/model/Contact.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.chat.yourway.model;

import com.chat.yourway.model.enums.Role;
import jakarta.persistence.*;
import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chat.yourway.model.email;
package com.chat.yourway.model;

import com.chat.yourway.model.Contact;
import com.chat.yourway.model.enums.EmailMessageType;
import jakarta.persistence.*;
import lombok.*;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/chat/yourway/model/Topic.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.chat.yourway.model;

import com.chat.yourway.model.enums.TopicScope;
import jakarta.persistence.*;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chat.yourway.model.email;
package com.chat.yourway.model.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chat.yourway.model;
package com.chat.yourway.model.enums;

import org.springframework.security.core.GrantedAuthority;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chat.yourway.model;
package com.chat.yourway.model.enums;

public enum TopicScope {
PUBLIC,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.chat.yourway.model.token;
package com.chat.yourway.model.redis;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chat.yourway.repository.jpa;

import com.chat.yourway.model.email.EmailToken;
import com.chat.yourway.model.EmailToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.chat.yourway.repository.jpa;

import com.chat.yourway.dto.response.notification.LastMessageResponseDto;
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.Message;

import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Optional;
import java.util.UUID;

import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.chat.yourway.repository.redis;

import com.chat.yourway.model.token.Token;
import com.chat.yourway.model.redis.Token;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chat/yourway/security/TokenService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.chat.yourway.exception.TokenNotFoundException;
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.token.Token;
import com.chat.yourway.model.redis.Token;
import com.chat.yourway.repository.redis.TokenRedisRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.chat.yourway.dto.common.EmailMessageInfoDto;
import com.chat.yourway.exception.EmailTokenNotFoundException;
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.email.EmailToken;
import com.chat.yourway.model.EmailToken;
import com.chat.yourway.repository.jpa.EmailTokenRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -12,7 +12,7 @@

import java.util.UUID;

import static com.chat.yourway.model.email.EmailMessageType.ACTIVATE;
import static com.chat.yourway.model.enums.EmailMessageType.ACTIVATE;

@Service
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.chat.yourway.dto.response.RegistrationResponseDto;
import com.chat.yourway.exception.InvalidCredentialsException;
import com.chat.yourway.exception.InvalidTokenException;
import com.chat.yourway.model.token.Token;
import com.chat.yourway.model.redis.Token;
import com.chat.yourway.security.JwtService;
import com.chat.yourway.security.LogoutService;
import com.chat.yourway.security.TokenService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.chat.yourway.dto.request.RestorePasswordDto;
import com.chat.yourway.exception.EmailTokenNotFoundException;
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.email.EmailMessageType;
import com.chat.yourway.model.email.EmailToken;
import com.chat.yourway.model.enums.EmailMessageType;
import com.chat.yourway.model.EmailToken;
import com.chat.yourway.repository.jpa.EmailTokenRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chat/yourway/service/ContactService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.UUID;

import static com.chat.yourway.model.Role.USER;
import static com.chat.yourway.model.enums.Role.USER;

@Service
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.chat.yourway.dto.common.EmailMessageDto;
import com.chat.yourway.dto.common.EmailMessageInfoDto;
import com.chat.yourway.model.email.EmailMessageType;
import com.chat.yourway.model.enums.EmailMessageType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.chat.yourway.service;

import com.chat.yourway.dto.response.notification.LastMessageResponseDto;
import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import com.chat.yourway.repository.jpa.MessageRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chat/yourway/service/MessageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.Message;
import com.chat.yourway.model.Topic;
import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import com.chat.yourway.repository.jpa.MessageRepository;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.Message;
import com.chat.yourway.model.Topic;
import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import com.chat.yourway.model.redis.ContactOnline;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chat/yourway/service/TopicService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.chat.yourway.model.Contact;
import com.chat.yourway.model.Tag;
import com.chat.yourway.model.Topic;
import com.chat.yourway.model.TopicScope;
import com.chat.yourway.model.enums.TopicScope;
import com.chat.yourway.repository.jpa.TagRepository;
import com.chat.yourway.repository.jpa.TopicRepository;
import lombok.extern.slf4j.Slf4j;
Expand Down

0 comments on commit 0fee8f9

Please sign in to comment.