diff --git a/src/main/java/com/aisip/OnO/backend/Dto/Problem/ProblemResponseDto.java b/src/main/java/com/aisip/OnO/backend/Dto/Problem/ProblemResponseDto.java index 2abe37f..8cf2e3e 100644 --- a/src/main/java/com/aisip/OnO/backend/Dto/Problem/ProblemResponseDto.java +++ b/src/main/java/com/aisip/OnO/backend/Dto/Problem/ProblemResponseDto.java @@ -1,12 +1,10 @@ package com.aisip.OnO.backend.Dto.Problem; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; import java.time.LocalDateTime; +@Builder @Getter @Setter @NoArgsConstructor diff --git a/src/main/java/com/aisip/OnO/backend/Dto/User/UserResponseDto.java b/src/main/java/com/aisip/OnO/backend/Dto/User/UserResponseDto.java index 0d6e759..002fbe9 100644 --- a/src/main/java/com/aisip/OnO/backend/Dto/User/UserResponseDto.java +++ b/src/main/java/com/aisip/OnO/backend/Dto/User/UserResponseDto.java @@ -1,11 +1,9 @@ package com.aisip.OnO.backend.Dto.User; import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; +@Builder @Getter @Setter @NoArgsConstructor @@ -15,10 +13,6 @@ public class UserResponseDto { private Long userId; - private String socialId; - - private String socialLoginType; - private String userName; private String userEmail; diff --git a/src/main/java/com/aisip/OnO/backend/controller/UserController.java b/src/main/java/com/aisip/OnO/backend/controller/UserController.java index dafcb5c..0302f17 100644 --- a/src/main/java/com/aisip/OnO/backend/controller/UserController.java +++ b/src/main/java/com/aisip/OnO/backend/controller/UserController.java @@ -1,5 +1,6 @@ package com.aisip.OnO.backend.controller; +import com.aisip.OnO.backend.Dto.User.UserResponseDto; import com.aisip.OnO.backend.service.AuthService; import com.aisip.OnO.backend.entity.User; import org.springframework.beans.factory.annotation.Autowired; @@ -19,9 +20,9 @@ public class UserController { @GetMapping("/info") public ResponseEntity getUserInfo(Authentication authentication) { Long userId = (Long) authentication.getPrincipal(); - User user = authService.getUserById(userId); - if (user != null) { - return ResponseEntity.ok(user); + UserResponseDto userResponseDto = authService.getUserById(userId); + if (userResponseDto != null) { + return ResponseEntity.ok(userResponseDto); } else { return ResponseEntity.status(404).body(new ErrorResponse("User not found")); } diff --git a/src/main/java/com/aisip/OnO/backend/converter/ProblemConverter.java b/src/main/java/com/aisip/OnO/backend/converter/ProblemConverter.java index 0efe8c1..5433167 100644 --- a/src/main/java/com/aisip/OnO/backend/converter/ProblemConverter.java +++ b/src/main/java/com/aisip/OnO/backend/converter/ProblemConverter.java @@ -1,5 +1,6 @@ package com.aisip.OnO.backend.converter; +import com.aisip.OnO.backend.Dto.Problem.ProblemRegisterDto; import com.aisip.OnO.backend.Dto.Problem.ProblemResponseDto; import com.aisip.OnO.backend.entity.Image.ImageData; import com.aisip.OnO.backend.entity.Problem; @@ -13,30 +14,31 @@ public static ProblemResponseDto convertToResponseDto(Problem problem, List