Skip to content

Commit

Permalink
refactor: 페키지구조 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
masiljangajji committed Dec 3, 2024
1 parent 3837ccf commit 45f8add
Show file tree
Hide file tree
Showing 29 changed files with 65 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import my.music.note.back.data.dto.request.gpt.ChatCompletionDto;
import my.music.note.back.data.dto.gpt.request.ChatCompletionDto;
import my.music.note.back.service.ChatGPTService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/my/music/note/back/controller/DiaryController.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package my.music.note.back.controller;

import lombok.RequiredArgsConstructor;
import my.music.note.back.data.dto.request.diary.DiaryCreateRequest;
import my.music.note.back.data.dto.request.diary.DiaryDeleteRequest;
import my.music.note.back.data.dto.request.diary.DiaryModifyRequest;
import my.music.note.back.data.dto.response.diary.FindDiaryResponse;
import my.music.note.back.data.dto.diary.request.DiaryCreateRequest;
import my.music.note.back.data.dto.diary.request.DiaryDeleteRequest;
import my.music.note.back.data.dto.diary.request.DiaryModifyRequest;
import my.music.note.back.data.dto.diary.response.FindDiaryResponse;
import my.music.note.back.service.DiaryService;
import my.music.note.back.service.TokenService;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -34,8 +34,8 @@ public void deleteDiary(@RequestBody DiaryDeleteRequest request) {
}

@PutMapping
@ResponseStatus(HttpStatus.OK)
public void modifyDiary(@RequestBody DiaryModifyRequest request) {

diaryService.modifyDiary(request);
}

Expand All @@ -44,7 +44,6 @@ public ResponseEntity<FindDiaryResponse> FindDiaryResponse(@PathVariable Long di

FindDiaryResponse response = diaryService.findDiary(diaryId);
return new ResponseEntity<>(response, HttpStatus.OK);

}

@GetMapping
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/my/music/note/back/controller/UserController.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package my.music.note.back.controller;

import lombok.RequiredArgsConstructor;
import my.music.note.back.data.dto.response.jwt.TokenCreateResponse;
import my.music.note.back.service.TokenService;
import my.music.note.back.data.dto.request.user.DeleteAccountRequest;
import my.music.note.back.data.dto.request.user.FindUserRequest;
import my.music.note.back.data.dto.request.user.LoginOrRegisterRequest;
import my.music.note.back.data.dto.request.user.ModifyNameRequest;
import my.music.note.back.data.dto.response.user.FindUserResponse;
import my.music.note.back.data.dto.jwt.response.TokenCreateResponse;
import my.music.note.back.data.dto.user.request.DeleteAccountRequest;
import my.music.note.back.data.dto.user.request.FindUserRequest;
import my.music.note.back.data.dto.user.request.LoginOrRegisterRequest;
import my.music.note.back.data.dto.user.request.ModifyNameRequest;
import my.music.note.back.data.dto.user.response.FindUserResponse;
import my.music.note.back.data.entity.User;
import my.music.note.back.service.TokenService;
import my.music.note.back.service.UserService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -31,7 +31,6 @@ public ResponseEntity<TokenCreateResponse> loginOrRegister(@RequestBody LoginOrR
return new ResponseEntity<>(response, HttpStatus.OK);
}


@DeleteMapping
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteAccount(@RequestHeader("Authorization") String token) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.diary;
package my.music.note.back.data.dto.diary.request;

public record DiaryCreateRequest(String content,Boolean isLongEntry) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.diary;
package my.music.note.back.data.dto.diary.request;

public record DiaryDeleteRequest(Long diaryId) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.diary;
package my.music.note.back.data.dto.diary.request;

public record DiaryModifyRequest(Long id,String content) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.response.diary;
package my.music.note.back.data.dto.diary.response;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.gpt;
package my.music.note.back.data.dto.gpt.request;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.gpt;
package my.music.note.back.data.dto.gpt.request;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.jwt;
package my.music.note.back.data.dto.jwt.request;

public record TokenCreateRequest(String providerId, boolean isAdmin) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.response.jwt;
package my.music.note.back.data.dto.jwt.response;

public record TokenCreateResponse(String token) {
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package my.music.note.back.data.dto.user.request;

public record DeleteAccountRequest(Long id) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package my.music.note.back.data.dto.user.request;

public record FindUserRequest(Long id) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.user;
package my.music.note.back.data.dto.user.request;

public record LoginOrRegisterRequest(String name, String email, String provider, String providerId) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.request.user;
package my.music.note.back.data.dto.user.request;

public record ModifyNameRequest(String name) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package my.music.note.back.data.dto.response.user;
package my.music.note.back.data.dto.user.response;

public record FindUserResponse(String name, String email, Boolean isAdmin) {
}
6 changes: 3 additions & 3 deletions src/main/java/my/music/note/back/data/entity/Diary.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import jakarta.persistence.*;
import lombok.NoArgsConstructor;
import my.music.note.back.data.dto.request.diary.DiaryCreateRequest;
import my.music.note.back.data.dto.request.diary.DiaryModifyRequest;
import my.music.note.back.data.dto.response.diary.FindDiaryResponse;
import my.music.note.back.data.dto.diary.request.DiaryCreateRequest;
import my.music.note.back.data.dto.diary.request.DiaryModifyRequest;
import my.music.note.back.data.dto.diary.response.FindDiaryResponse;

import java.time.LocalDateTime;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/my/music/note/back/data/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import jakarta.persistence.*;
import lombok.NoArgsConstructor;
import my.music.note.back.data.dto.request.user.LoginOrRegisterRequest;
import my.music.note.back.data.dto.request.user.ModifyNameRequest;
import my.music.note.back.data.dto.response.user.FindUserResponse;
import my.music.note.back.data.dto.user.request.LoginOrRegisterRequest;
import my.music.note.back.data.dto.user.request.ModifyNameRequest;
import my.music.note.back.data.dto.user.response.FindUserResponse;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package my.music.note.back.data.repository;

import my.music.note.back.data.dto.response.diary.FindDiaryResponse;
import my.music.note.back.data.dto.diary.response.FindDiaryResponse;
import my.music.note.back.data.entity.Diary;
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 lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import my.music.note.back.config.ChatGPTConfig;
import my.music.note.back.data.dto.request.gpt.ChatCompletionDto;
import my.music.note.back.data.dto.gpt.request.ChatCompletionDto;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/my/music/note/back/service/DiaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import my.music.note.back.data.dto.request.diary.DiaryCreateRequest;
import my.music.note.back.data.dto.request.diary.DiaryDeleteRequest;
import my.music.note.back.data.dto.request.diary.DiaryModifyRequest;
import my.music.note.back.data.dto.response.diary.FindDiaryResponse;
import my.music.note.back.data.dto.diary.request.DiaryCreateRequest;
import my.music.note.back.data.dto.diary.request.DiaryDeleteRequest;
import my.music.note.back.data.dto.diary.request.DiaryModifyRequest;
import my.music.note.back.data.dto.diary.response.FindDiaryResponse;
import my.music.note.back.data.entity.Diary;
import my.music.note.back.data.repository.DiaryRepository;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/my/music/note/back/service/TokenService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.auth0.jwt.interfaces.DecodedJWT;
import lombok.RequiredArgsConstructor;
import my.music.note.back.config.TokenConfig;
import my.music.note.back.data.dto.response.jwt.TokenCreateResponse;
import my.music.note.back.data.dto.jwt.response.TokenCreateResponse;
import my.music.note.back.validator.TokenValidator;
import org.springframework.stereotype.Service;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/my/music/note/back/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import jakarta.transaction.Transactional;
import lombok.AllArgsConstructor;
import my.music.note.back.data.dto.request.user.DeleteAccountRequest;
import my.music.note.back.data.dto.request.user.FindUserRequest;
import my.music.note.back.data.dto.request.user.LoginOrRegisterRequest;
import my.music.note.back.data.dto.request.user.ModifyNameRequest;
import my.music.note.back.data.dto.response.user.FindUserResponse;
import my.music.note.back.data.dto.user.request.DeleteAccountRequest;
import my.music.note.back.data.dto.user.request.FindUserRequest;
import my.music.note.back.data.dto.user.request.LoginOrRegisterRequest;
import my.music.note.back.data.dto.user.request.ModifyNameRequest;
import my.music.note.back.data.dto.user.response.FindUserResponse;
import my.music.note.back.data.entity.User;
import my.music.note.back.data.repository.UserRepository;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import my.music.note.back.controller.ChatGPTController;
import my.music.note.back.data.dto.request.gpt.ChatCompletionDto;
import my.music.note.back.data.dto.request.gpt.ChatRequestMsgDto;
import my.music.note.back.data.dto.gpt.request.ChatCompletionDto;
import my.music.note.back.data.dto.gpt.request.ChatRequestMsgDto;
import my.music.note.back.service.ChatGPTService;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package my.music.note.back.gpt.service;

import my.music.note.back.config.ChatGPTConfig;
import my.music.note.back.data.dto.request.gpt.ChatCompletionDto;
import my.music.note.back.data.dto.request.gpt.ChatRequestMsgDto;
import my.music.note.back.data.dto.gpt.request.ChatCompletionDto;
import my.music.note.back.data.dto.gpt.request.ChatRequestMsgDto;
import my.music.note.back.service.ChatGPTService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import my.music.note.back.controller.UserController;
import my.music.note.back.data.dto.request.user.DeleteAccountRequest;
import my.music.note.back.data.dto.request.user.FindUserRequest;
import my.music.note.back.data.dto.request.user.LoginOrRegisterRequest;
import my.music.note.back.data.dto.request.user.ModifyNameRequest;
import my.music.note.back.data.dto.response.jwt.TokenCreateResponse;
import my.music.note.back.data.dto.response.user.FindUserResponse;
import my.music.note.back.data.dto.jwt.response.TokenCreateResponse;
import my.music.note.back.data.dto.user.request.DeleteAccountRequest;
import my.music.note.back.data.dto.user.request.FindUserRequest;
import my.music.note.back.data.dto.user.request.LoginOrRegisterRequest;
import my.music.note.back.data.dto.user.request.ModifyNameRequest;
import my.music.note.back.data.dto.user.response.FindUserResponse;
import my.music.note.back.data.entity.User;
import my.music.note.back.service.TokenService;
import my.music.note.back.service.UserService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package my.music.note.back.user.service;

import my.music.note.back.data.dto.request.user.DeleteAccountRequest;
import my.music.note.back.data.dto.request.user.FindUserRequest;
import my.music.note.back.data.dto.request.user.LoginOrRegisterRequest;
import my.music.note.back.data.dto.request.user.ModifyNameRequest;
import my.music.note.back.data.dto.response.user.FindUserResponse;
import my.music.note.back.data.dto.user.request.DeleteAccountRequest;
import my.music.note.back.data.dto.user.request.FindUserRequest;
import my.music.note.back.data.dto.user.request.LoginOrRegisterRequest;
import my.music.note.back.data.dto.user.request.ModifyNameRequest;
import my.music.note.back.data.dto.user.response.FindUserResponse;
import my.music.note.back.data.entity.User;
import my.music.note.back.data.repository.UserRepository;
import my.music.note.back.service.UserService;
Expand Down

0 comments on commit 45f8add

Please sign in to comment.