Skip to content

Commit

Permalink
refactor: package 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
BGuga committed Sep 14, 2023
1 parent aaa4ad5 commit 1801641
Show file tree
Hide file tree
Showing 154 changed files with 450 additions and 438 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.festago.zadmin.application;
package com.festago.admin.application;

import com.festago.dto.AdminFestivalResponse;
import com.festago.dto.AdminResponse;
import com.festago.dto.AdminStageResponse;
import com.festago.dto.AdminTicketResponse;
import com.festago.admin.dto.AdminFestivalResponse;
import com.festago.admin.dto.AdminResponse;
import com.festago.admin.dto.AdminStageResponse;
import com.festago.admin.dto.AdminTicketResponse;
import com.festago.festival.domain.Festival;
import com.festago.festival.repository.FestivalRepository;
import com.festago.stage.domain.Stage;
import com.festago.stage.repository.StageRepository;
import com.festago.ticket.domain.Ticket;
import com.festago.ticket.domain.TicketAmount;
import com.festago.ticket.domain.TicketEntryTime;
import com.festago.ticket.repository.TicketRepository;
import com.festago.zfestival.domain.Festival;
import com.festago.zfestival.repository.FestivalRepository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.zadmin.domain;
package com.festago.admin.domain;

import com.festago.domain.BaseTimeEntity;
import com.festago.common.domain.BaseTimeEntity;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.dto;
package com.festago.admin.dto;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.dto;
package com.festago.admin.dto;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.dto;
package com.festago.admin.dto;

import java.time.LocalDateTime;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.dto;
package com.festago.admin.dto;

import com.festago.ticket.domain.TicketType;
import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.zadmin.repository;
package com.festago.admin.repository;

import com.festago.zadmin.domain.Admin;
import com.festago.admin.domain.Admin;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package com.festago.auth.application;

import com.festago.admin.domain.Admin;
import com.festago.admin.repository.AdminRepository;
import com.festago.auth.domain.AuthPayload;
import com.festago.auth.domain.AuthProvider;
import com.festago.auth.domain.Role;
import com.festago.auth.dto.AdminLoginRequest;
import com.festago.auth.dto.AdminSignupRequest;
import com.festago.auth.dto.AdminSignupResponse;
import com.festago.exception.BadRequestException;
import com.festago.exception.ErrorCode;
import com.festago.exception.ForbiddenException;
import com.festago.exception.UnauthorizedException;
import com.festago.zadmin.domain.Admin;
import com.festago.zadmin.repository.AdminRepository;
import com.festago.common.exception.BadRequestException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.ForbiddenException;
import com.festago.common.exception.UnauthorizedException;
import java.util.Objects;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.festago.auth.application;

import com.festago.auth.domain.AuthPayload;

public interface AuthExtractor {

AuthPayload extract(String token);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.festago.auth.application;

import com.festago.auth.domain.AuthPayload;
import com.festago.auth.domain.AuthProvider;
import com.festago.auth.domain.OAuth2Client;
import com.festago.auth.domain.OAuth2Clients;
import com.festago.auth.domain.Role;
import com.festago.auth.domain.UserInfo;
import com.festago.auth.dto.LoginMemberDto;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.festago.auth.application;

import com.festago.auth.domain.AuthPayload;

public interface AuthProvider {

String provide(AuthPayload authPayload);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.festago.auth.domain.UserInfo;
import com.festago.auth.dto.LoginMemberDto;
import com.festago.exception.ErrorCode;
import com.festago.exception.NotFoundException;
import com.festago.zmember.domain.Member;
import com.festago.zmember.repository.MemberRepository;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.NotFoundException;
import com.festago.member.domain.Member;
import com.festago.member.repository.MemberRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.festago.auth.application;

import com.festago.auth.domain.SocialType;
import com.festago.auth.domain.UserInfo;

public interface OAuth2Client {

UserInfo getUserInfo(String accessToken);

SocialType getSocialType();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.festago.auth.domain;
package com.festago.auth.application;

import com.festago.exception.BadRequestException;
import com.festago.exception.ErrorCode;
import com.festago.exception.InternalServerException;
import com.festago.auth.domain.SocialType;
import com.festago.common.exception.BadRequestException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.InternalServerException;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.auth.domain;
package com.festago.auth.application;

import jakarta.servlet.http.HttpServletRequest;
import java.util.Optional;
Expand Down
8 changes: 4 additions & 4 deletions backend/src/main/java/com/festago/auth/config/AuthConfig.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.festago.auth.config;

import com.festago.auth.domain.AuthExtractor;
import com.festago.auth.domain.AuthProvider;
import com.festago.auth.domain.OAuth2Client;
import com.festago.auth.domain.OAuth2Clients;
import com.festago.auth.application.AuthExtractor;
import com.festago.auth.application.AuthProvider;
import com.festago.auth.application.OAuth2Client;
import com.festago.auth.application.OAuth2Clients;
import com.festago.auth.infrastructure.JwtAuthExtractor;
import com.festago.auth.infrastructure.JwtAuthProvider;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.festago.auth.config;

import com.festago.auth.domain.AuthExtractor;
import com.festago.auth.application.AuthExtractor;
import com.festago.auth.domain.Role;
import com.festago.auth.infrastructure.CookieTokenExtractor;
import com.festago.auth.infrastructure.HeaderTokenExtractor;
import com.festago.auth.presentation.AuthInterceptor;
import com.festago.auth.presentation.AuthenticateContext;
import com.festago.auth.presentation.RoleArgumentResolver;
import com.festago.presentation.auth.AuthInterceptor;
import com.festago.presentation.auth.AuthenticateContext;
import com.festago.presentation.auth.RoleArgumentResolver;
import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.festago.auth.domain;

import com.festago.exception.ErrorCode;
import com.festago.exception.InternalServerException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.InternalServerException;

public class AuthPayload {

Expand Down

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions backend/src/main/java/com/festago/auth/domain/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.festago.auth.annotation.Admin;
import com.festago.auth.annotation.Anonymous;
import com.festago.auth.annotation.Member;
import com.festago.exception.ErrorCode;
import com.festago.exception.InternalServerException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.InternalServerException;
import java.lang.annotation.Annotation;

public enum Role {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.auth.domain;

import com.festago.zmember.domain.Member;
import com.festago.member.domain.Member;

public record UserInfo(
String socialId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.auth.dto;

import com.festago.zmember.domain.Member;
import com.festago.member.domain.Member;

public record LoginMemberDto(
boolean isNew,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.auth.infrastructure;

import com.festago.auth.domain.TokenExtractor;
import com.festago.auth.application.TokenExtractor;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.festago.auth.infrastructure;

import com.festago.auth.domain.OAuth2Client;
import com.festago.auth.application.OAuth2Client;
import com.festago.auth.domain.SocialType;
import com.festago.auth.domain.UserInfo;
import com.festago.exception.BadRequestException;
import com.festago.exception.ErrorCode;
import com.festago.common.exception.BadRequestException;
import com.festago.common.exception.ErrorCode;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.festago.auth.infrastructure;

import com.festago.auth.domain.TokenExtractor;
import com.festago.exception.ErrorCode;
import com.festago.exception.UnauthorizedException;
import com.festago.auth.application.TokenExtractor;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.UnauthorizedException;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Optional;
import org.springframework.http.HttpHeaders;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.festago.auth.infrastructure;

import com.festago.auth.domain.AuthExtractor;
import com.festago.auth.application.AuthExtractor;
import com.festago.auth.domain.AuthPayload;
import com.festago.auth.domain.Role;
import com.festago.exception.ErrorCode;
import com.festago.exception.UnauthorizedException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.UnauthorizedException;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.JwtException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.festago.auth.infrastructure;

import com.festago.auth.application.AuthProvider;
import com.festago.auth.domain.AuthPayload;
import com.festago.auth.domain.AuthProvider;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.festago.auth.infrastructure;

import com.festago.auth.domain.OAuth2Client;
import com.festago.auth.application.OAuth2Client;
import com.festago.auth.domain.SocialType;
import com.festago.auth.domain.UserInfo;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.festago.auth.infrastructure;

import com.festago.exception.BadRequestException;
import com.festago.exception.ErrorCode;
import com.festago.exception.InternalServerException;
import com.festago.common.exception.BadRequestException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.InternalServerException;
import java.io.IOException;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.client.ClientHttpResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.aop;
package com.festago.common.aop;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.festago.aop;
package com.festago.common.aop;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.festago.exception.ErrorCode;
import com.festago.exception.InternalServerException;
import com.festago.common.exception.ErrorCode;
import com.festago.common.exception.InternalServerException;
import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.domain;
package com.festago.common.domain;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public class BadRequestException extends FestaGoException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public enum ErrorCode {
// 400
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

import org.springframework.core.NestedRuntimeException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public class ForbiddenException extends FestaGoException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public class InternalServerException extends FestaGoException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public class NotFoundException extends FestaGoException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.festago.exception;
package com.festago.common.exception;

public class UnauthorizedException extends FestaGoException {

Expand Down
Loading

0 comments on commit 1801641

Please sign in to comment.