Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refac] 프로젝트 패키징 개선 #152

Merged
merged 6 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.kkumulkkum.server.controller;
package org.kkumulkkum.server.api.auth.controller;

import com.google.firebase.database.annotations.Nullable;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import org.kkumulkkum.server.annotation.UserId;
import org.kkumulkkum.server.constant.AuthConstant;
import org.kkumulkkum.server.dto.auth.request.UserLoginDto;
import org.kkumulkkum.server.dto.auth.response.JwtTokenDto;
import org.kkumulkkum.server.dto.auth.response.UserTokenDto;
import org.kkumulkkum.server.service.auth.AuthService;
import org.kkumulkkum.server.common.auth.annotation.UserId;
import org.kkumulkkum.server.common.auth.constant.AuthConstant;
import org.kkumulkkum.server.api.auth.dto.request.UserLoginDto;
import org.kkumulkkum.server.api.auth.dto.response.JwtTokenDto;
import org.kkumulkkum.server.api.auth.dto.response.UserTokenDto;
import org.kkumulkkum.server.api.auth.service.AuthService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.auth.openfeign.kakao.dto;
package org.kkumulkkum.server.api.auth.dto;

public record SocialUserDto(String platformId, String email) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.kkumulkkum.server.dto.auth.request;
package org.kkumulkkum.server.api.auth.dto.request;

import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import org.kkumulkkum.server.domain.enums.Provider;
import org.kkumulkkum.server.domain.user.Provider;

public record UserLoginDto(
@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.auth.response;
package org.kkumulkkum.server.api.auth.dto.response;

import lombok.AccessLevel;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kkumulkkum.server.dto.auth.response;
package org.kkumulkkum.server.api.auth.dto.response;

import org.kkumulkkum.server.domain.UserInfo;
import org.kkumulkkum.server.domain.userinfo.UserInfo;

public record UserTokenDto(
String name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.auth.openfeign.apple.dto;
package org.kkumulkkum.server.api.auth.dto.verify;

public record ApplePublicKey(
String kty, String kid, String use, String alg, String n, String e, String email
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.kkumulkkum.server.auth.openfeign.apple.dto;
package org.kkumulkkum.server.api.auth.dto.verify;

import org.kkumulkkum.server.exception.AuthException;
import org.kkumulkkum.server.exception.code.AuthErrorCode;
import org.kkumulkkum.server.common.exception.AuthException;
import org.kkumulkkum.server.common.exception.code.AuthErrorCode;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package org.kkumulkkum.server.auth.openfeign.apple.service;
package org.kkumulkkum.server.api.auth.service;

import io.jsonwebtoken.Claims;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.kkumulkkum.server.auth.openfeign.apple.AppleFeignClient;
import org.kkumulkkum.server.auth.openfeign.apple.dto.ApplePublicKeys;
import org.kkumulkkum.server.auth.openfeign.apple.dto.AppleTokenDto;
import org.kkumulkkum.server.auth.openfeign.apple.verify.AppleClientSecretGenerator;
import org.kkumulkkum.server.auth.openfeign.apple.verify.AppleJwtParser;
import org.kkumulkkum.server.auth.openfeign.apple.verify.PublicKeyGenerator;
import org.kkumulkkum.server.auth.openfeign.kakao.dto.SocialUserDto;
import org.kkumulkkum.server.exception.AuthException;
import org.kkumulkkum.server.exception.BusinessException;
import org.kkumulkkum.server.exception.code.AuthErrorCode;
import org.kkumulkkum.server.exception.code.BusinessErrorCode;
import org.kkumulkkum.server.external.service.apple.AppleFeignClient;
import org.kkumulkkum.server.api.auth.dto.verify.ApplePublicKeys;
import org.kkumulkkum.server.external.service.apple.dto.AppleTokenDto;
import org.kkumulkkum.server.api.auth.service.verify.AppleClientSecretGenerator;
import org.kkumulkkum.server.api.auth.service.verify.AppleJwtParser;
import org.kkumulkkum.server.api.auth.service.verify.PublicKeyGenerator;
import org.kkumulkkum.server.api.auth.dto.SocialUserDto;
import org.kkumulkkum.server.common.exception.AuthException;
import org.kkumulkkum.server.common.exception.BusinessException;
import org.kkumulkkum.server.common.exception.code.AuthErrorCode;
import org.kkumulkkum.server.common.exception.code.BusinessErrorCode;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.MissingRequestHeaderException;

import java.security.PublicKey;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
package org.kkumulkkum.server.service.auth;
package org.kkumulkkum.server.api.auth.service;

import lombok.RequiredArgsConstructor;
import org.kkumulkkum.server.auth.jwt.JwtTokenProvider;
import org.kkumulkkum.server.auth.openfeign.kakao.dto.SocialUserDto;
import org.kkumulkkum.server.auth.openfeign.apple.service.AppleService;
import org.kkumulkkum.server.auth.openfeign.kakao.service.KakaoService;
import org.kkumulkkum.server.domain.Member;
import org.kkumulkkum.server.domain.Token;
import org.kkumulkkum.server.domain.User;
import org.kkumulkkum.server.domain.UserInfo;
import org.kkumulkkum.server.domain.enums.Provider;
import org.kkumulkkum.server.domain.enums.Role;
import org.kkumulkkum.server.dto.auth.request.UserLoginDto;
import org.kkumulkkum.server.dto.auth.response.JwtTokenDto;
import org.kkumulkkum.server.dto.auth.response.UserTokenDto;
import org.kkumulkkum.server.exception.AuthException;
import org.kkumulkkum.server.exception.code.AuthErrorCode;
import org.kkumulkkum.server.service.member.MemberRemover;
import org.kkumulkkum.server.service.member.MemberRetreiver;
import org.kkumulkkum.server.service.participant.ParticipantRemover;
import org.kkumulkkum.server.service.participant.ParticipantRetriever;
import org.kkumulkkum.server.service.promise.PromiseRemover;
import org.kkumulkkum.server.service.promise.PromiseRetriever;
import org.kkumulkkum.server.service.user.UserRemover;
import org.kkumulkkum.server.service.user.UserRetriever;
import org.kkumulkkum.server.service.user.UserSaver;
import org.kkumulkkum.server.service.userInfo.UserInfoRemover;
import org.kkumulkkum.server.service.userInfo.UserInfoRetriever;
import org.kkumulkkum.server.service.userInfo.UserInfoSaver;
import org.kkumulkkum.server.domain.user.manager.TokenRemover;
import org.kkumulkkum.server.domain.user.manager.TokenRetriever;
import org.kkumulkkum.server.domain.user.manager.TokenSaver;
import org.kkumulkkum.server.domain.member.manager.MemberRetreiver;
import org.kkumulkkum.server.domain.participant.manager.ParticipantRemover;
import org.kkumulkkum.server.domain.participant.manager.ParticipantRetriever;
import org.kkumulkkum.server.domain.promise.manager.PromiseRemover;
import org.kkumulkkum.server.domain.promise.manager.PromiseRetriever;
import org.kkumulkkum.server.domain.user.manager.UserRemover;
import org.kkumulkkum.server.domain.user.manager.UserRetriever;
import org.kkumulkkum.server.domain.userinfo.manager.UserInfoRemover;
import org.kkumulkkum.server.domain.userinfo.manager.UserInfoRetriever;
import org.kkumulkkum.server.domain.userinfo.manager.UserInfoSaver;
import org.kkumulkkum.server.common.auth.jwt.JwtTokenProvider;
import org.kkumulkkum.server.api.auth.dto.SocialUserDto;
import org.kkumulkkum.server.domain.member.Member;
import org.kkumulkkum.server.domain.user.Token;
import org.kkumulkkum.server.domain.user.User;
import org.kkumulkkum.server.domain.userinfo.UserInfo;
import org.kkumulkkum.server.domain.user.Provider;
import org.kkumulkkum.server.domain.user.Role;
import org.kkumulkkum.server.api.auth.dto.request.UserLoginDto;
import org.kkumulkkum.server.api.auth.dto.response.JwtTokenDto;
import org.kkumulkkum.server.api.auth.dto.response.UserTokenDto;
import org.kkumulkkum.server.common.exception.AuthException;
import org.kkumulkkum.server.common.exception.code.AuthErrorCode;
import org.kkumulkkum.server.domain.member.manager.MemberRemover;
import org.kkumulkkum.server.domain.user.manager.UserSaver;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.kkumulkkum.server.auth.openfeign.kakao.service;
package org.kkumulkkum.server.api.auth.service;

import lombok.RequiredArgsConstructor;
import org.kkumulkkum.server.auth.openfeign.kakao.KakaoFeignClient;
import org.kkumulkkum.server.auth.openfeign.kakao.dto.KakaoUserDto;
import org.kkumulkkum.server.auth.openfeign.kakao.dto.SocialUserDto;
import org.kkumulkkum.server.constant.AuthConstant;
import org.kkumulkkum.server.external.service.kakao.KakaoFeignClient;
import org.kkumulkkum.server.external.service.kakao.dto.KakaoUserDto;
import org.kkumulkkum.server.api.auth.dto.SocialUserDto;
import org.kkumulkkum.server.common.auth.constant.AuthConstant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.auth.openfeign.apple.verify;
package org.kkumulkkum.server.api.auth.service.verify;

import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.kkumulkkum.server.auth.openfeign.apple.verify;
package org.kkumulkkum.server.api.auth.service.verify;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.jsonwebtoken.*;
import lombok.extern.slf4j.Slf4j;
import org.kkumulkkum.server.exception.AuthException;
import org.kkumulkkum.server.exception.code.AuthErrorCode;
import org.kkumulkkum.server.common.exception.AuthException;
import org.kkumulkkum.server.common.exception.code.AuthErrorCode;
import org.springframework.stereotype.Component;

import java.security.PublicKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.kkumulkkum.server.auth.openfeign.apple.verify;
package org.kkumulkkum.server.api.auth.service.verify;

import org.kkumulkkum.server.auth.openfeign.apple.dto.ApplePublicKey;
import org.kkumulkkum.server.auth.openfeign.apple.dto.ApplePublicKeys;
import org.kkumulkkum.server.exception.AuthException;
import org.kkumulkkum.server.exception.code.AuthErrorCode;
import org.kkumulkkum.server.api.auth.dto.verify.ApplePublicKey;
import org.kkumulkkum.server.api.auth.dto.verify.ApplePublicKeys;
import org.kkumulkkum.server.common.exception.AuthException;
import org.kkumulkkum.server.common.exception.code.AuthErrorCode;
import org.springframework.stereotype.Component;

import java.math.BigInteger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package org.kkumulkkum.server.controller;
package org.kkumulkkum.server.api.common;

import lombok.RequiredArgsConstructor;
import org.kkumulkkum.server.auth.jwt.JwtTokenProvider;
import org.kkumulkkum.server.dto.auth.response.JwtTokenDto;
import org.kkumulkkum.server.dto.test.TestDto;
import org.kkumulkkum.server.exception.BusinessException;
import org.kkumulkkum.server.exception.code.BusinessErrorCode;
import org.kkumulkkum.server.common.auth.jwt.JwtTokenProvider;
import org.kkumulkkum.server.api.auth.dto.response.JwtTokenDto;
import org.kkumulkkum.server.common.exception.BusinessException;
import org.kkumulkkum.server.common.exception.code.BusinessErrorCode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
Expand All @@ -18,11 +16,6 @@ public class TestController {

private final JwtTokenProvider jwtTokenProvider;

@GetMapping("/v1/test/dto")
public ResponseEntity<TestDto> testDto() {
return ResponseEntity.ok(new TestDto("test"));
}

@GetMapping("/v1/test/default")
public ResponseEntity<Void> testDefault() {
throw new RuntimeException();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.common;
package org.kkumulkkum.server.api.common.dto;

public record ErrorDto(
int code,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kkumulkkum.server.dto.common;
package org.kkumulkkum.server.api.common.dto;

import org.kkumulkkum.server.exception.code.DefaultErrorCode;
import org.kkumulkkum.server.common.exception.code.DefaultErrorCode;

public record ResponseDto<T> (
boolean success,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package org.kkumulkkum.server.controller;
package org.kkumulkkum.server.api.meeting.controller;

import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.kkumulkkum.server.annotation.IsMemberByMeetingId;
import org.kkumulkkum.server.annotation.UserId;
import org.kkumulkkum.server.dto.meeting.request.MeetingCreateDto;
import org.kkumulkkum.server.dto.meeting.request.MeetingRegisterDto;
import org.kkumulkkum.server.dto.meeting.response.CreatedMeetingDto;
import org.kkumulkkum.server.dto.meeting.response.MeetingDto;
import org.kkumulkkum.server.dto.meeting.response.MeetingIdDto;
import org.kkumulkkum.server.dto.meeting.response.MeetingsDto;
import org.kkumulkkum.server.dto.member.response.MembersDto;
import org.kkumulkkum.server.service.meeting.MeetingService;
import org.kkumulkkum.server.common.auth.annotation.IsMemberByMeetingId;
import org.kkumulkkum.server.common.auth.annotation.UserId;
import org.kkumulkkum.server.api.meeting.dto.request.MeetingCreateDto;
import org.kkumulkkum.server.api.meeting.dto.request.MeetingRegisterDto;
import org.kkumulkkum.server.api.meeting.dto.response.CreatedMeetingDto;
import org.kkumulkkum.server.api.meeting.dto.response.MeetingDto;
import org.kkumulkkum.server.api.meeting.dto.response.MeetingIdDto;
import org.kkumulkkum.server.api.meeting.dto.response.MeetingsDto;
import org.kkumulkkum.server.api.meeting.dto.response.MembersDto;
import org.kkumulkkum.server.api.meeting.service.MeetingService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.kkumulkkum.server.api.meeting.dto;

import org.kkumulkkum.server.domain.meeting.Meeting;

public record MeetingMetCountDto (
Meeting meeting,
Long metCount
) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.meeting.request;
package org.kkumulkkum.server.api.meeting.dto.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.meeting.request;
package org.kkumulkkum.server.api.meeting.dto.request;

public record MeetingRegisterDto (
String invitationCode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.meeting.response;
package org.kkumulkkum.server.api.meeting.dto.response;

public record CreatedMeetingDto(
Long meetingId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.kkumulkkum.server.dto.meeting.response;
package org.kkumulkkum.server.api.meeting.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.kkumulkkum.server.domain.Meeting;
import org.kkumulkkum.server.domain.meeting.Meeting;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kkumulkkum.server.dto.meeting.response;
package org.kkumulkkum.server.api.meeting.dto.response;

import org.kkumulkkum.server.domain.Meeting;
import org.kkumulkkum.server.domain.meeting.Meeting;

public record MeetingIdDto(
Long meetingId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kkumulkkum.server.dto.meeting.response;
package org.kkumulkkum.server.api.meeting.dto.response;

import org.kkumulkkum.server.domain.Meeting;
import org.kkumulkkum.server.domain.meeting.Meeting;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.member.response;
package org.kkumulkkum.server.api.meeting.dto.response;

public record MemberDto(
Long memberId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.kkumulkkum.server.dto.member.response;
package org.kkumulkkum.server.api.meeting.dto.response;

import java.util.List;

Expand Down
Loading
Loading