diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/user/controller/UserController.java b/src/main/java/com/modernfarmer/farmusspring/domain/user/controller/UserController.java index 7d004273..aeddf9f2 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/user/controller/UserController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/user/controller/UserController.java @@ -48,4 +48,10 @@ public BaseResponseDto settingProfile( return userService.settingProfile(user.getUserId(), file, nickname); } + @PostMapping("/init/{userId}") + public void initUser( + @PathVariable Long userId + ) { + userService.initUser(userId); + } } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/user/entity/User.java b/src/main/java/com/modernfarmer/farmusspring/domain/user/entity/User.java index 16cb2306..fc0d6003 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/user/entity/User.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/user/entity/User.java @@ -121,5 +121,7 @@ public void addMissionPostLike(MissionPostLike missionPostLike) { missionPostLikes.add(missionPostLike); } - + public void initUser() { + this.early = true; + } } \ No newline at end of file diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/user/service/UserService.java b/src/main/java/com/modernfarmer/farmusspring/domain/user/service/UserService.java index b1419d27..59c763ca 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/user/service/UserService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/user/service/UserService.java @@ -78,6 +78,12 @@ public void checkUserData(User user){ } } + @Transactional + public void initUser(Long userId) { + User user = userRepository.findUserById(userId); + user.initUser(); + } + private void updateUserProfileAccordingToProfileImage(MultipartFile multipartFile, String nickName, Long userId) throws IOException { if(multipartFile.isEmpty()){