diff --git a/server/src/main/java/com/yogit/server/user/controller/UserController.java b/server/src/main/java/com/yogit/server/user/controller/UserController.java index 0afac9c..7d7a074 100644 --- a/server/src/main/java/com/yogit/server/user/controller/UserController.java +++ b/server/src/main/java/com/yogit/server/user/controller/UserController.java @@ -37,8 +37,7 @@ public class UserController { @ApiImplicitParam(name = "userName", dataTypeClass = String.class, example = "강신현"), @ApiImplicitParam(name = "userAge", dataTypeClass = int.class, example = "25"), @ApiImplicitParam(name = "gender", dataTypeClass = Gender.class, example = "FEMALE"), - @ApiImplicitParam(name = "nationality", dataTypeClass = Nationality.class, example = "Korea"), - @ApiImplicitParam(name = "phoneNum", dataTypeClass = String.class, example = "01012345678") + @ApiImplicitParam(name = "nationality", dataTypeClass = Nationality.class, example = "Korea") }) @PatchMapping("/essential-profile") public ApplicationResponse enterEssentialProfile(@ModelAttribute CreateUserEssentialProfileReq createUserEssentialProfileReq){ @@ -83,7 +82,13 @@ public ApplicationResponse enterUserImage(@ModelAttribute CreateU * @author 강신현 */ @ApiOperation(value = "유저 추가 정보 입력") - @ApiImplicitParam(name = "userId", required = true, dataTypeClass = Long.class, example = "0") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", required = true, dataTypeClass = Long.class, example = "1"), + @ApiImplicitParam(name = "latitude", dataTypeClass = Float.class, example = "10.23"), + @ApiImplicitParam(name = "longitude", dataTypeClass = Float.class, example = "10.23"), + @ApiImplicitParam(name = "aboutMe", dataTypeClass = String.class, example = "캠핑 모임에 관심이 많습니다."), + @ApiImplicitParam(name = "city", dataTypeClass = Nationality.class, example = "SEOUL") + }) @PatchMapping("/additional-profile") public ApplicationResponse enterAdditionalProfile(@ModelAttribute AddUserAdditionalProfileReq addUserAdditionalProfileReq){ return userService.enterAdditionalProfile(addUserAdditionalProfileReq); @@ -93,7 +98,10 @@ public ApplicationResponse enterAdditionalProfile(@Mod * 유저 회원가입 (일반) */ @ApiOperation(value = "유저 회원가입", notes = "sms 인증이 완료되어야 회원가입이 가능합니다.") - @ApiImplicitParam(name = "loginId", required = true, dataTypeClass = String.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "loginId", required = true, dataTypeClass = String.class, example = "kang123"), + @ApiImplicitParam(name = "phoneNum", required = true, dataTypeClass = String.class, example = "01012345678") + }) @PostMapping("/join") public ApplicationResponse createUser(@ModelAttribute CreateUserReq createUserReq){ return userService.createUser(createUserReq); diff --git a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserEssentialProfileReq.java b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserEssentialProfileReq.java index f8c00b5..6a7319e 100644 --- a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserEssentialProfileReq.java +++ b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserEssentialProfileReq.java @@ -19,7 +19,6 @@ public class CreateUserEssentialProfileReq { int userAge; Gender gender; Nationality nationality; - String phoneNum; List languageNames; List languageLevels; diff --git a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserReq.java b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserReq.java index 853c756..40de766 100644 --- a/server/src/main/java/com/yogit/server/user/dto/request/CreateUserReq.java +++ b/server/src/main/java/com/yogit/server/user/dto/request/CreateUserReq.java @@ -11,10 +11,12 @@ public class CreateUserReq { String loginId; + String phoneNum; public static User toEntityUser(CreateUserReq createUserReq){ return User.builder() .loginId(createUserReq.getLoginId()) + .phoneNum(createUserReq.getPhoneNum()) .build(); } } diff --git a/server/src/main/java/com/yogit/server/user/entity/User.java b/server/src/main/java/com/yogit/server/user/entity/User.java index 7449d69..610a886 100644 --- a/server/src/main/java/com/yogit/server/user/entity/User.java +++ b/server/src/main/java/com/yogit/server/user/entity/User.java @@ -74,20 +74,20 @@ public class User extends BaseEntity { private List userImages = new ArrayList<>(); @Builder - public User (String loginId){ + public User (String loginId, String phoneNum){ this.loginId = loginId; + this.phoneNum = phoneNum; } public void addLanguage(Language language){ this.languages.add(language); } - public void changeUserInfo(String userName, Integer userAge, Gender gender, Nationality nationality, String phoneNum){ + public void changeUserInfo(String userName, Integer userAge, Gender gender, Nationality nationality){ if(userName != null) this.name = userName; if(userAge != 0) this.age = userAge; if(gender != null) this.gender = gender; if(nationality != null) this.nationality = nationality; - if(phoneNum != null) this.phoneNum = phoneNum; } public void delUser(){ diff --git a/server/src/main/java/com/yogit/server/user/service/UserServiceImpl.java b/server/src/main/java/com/yogit/server/user/service/UserServiceImpl.java index bd8297f..14b8ba2 100644 --- a/server/src/main/java/com/yogit/server/user/service/UserServiceImpl.java +++ b/server/src/main/java/com/yogit/server/user/service/UserServiceImpl.java @@ -39,7 +39,7 @@ public class UserServiceImpl implements UserService { public ApplicationResponse enterEssentialProfile(CreateUserEssentialProfileReq createUserEssentialProfileReq){ User user = userRepository.findById(createUserEssentialProfileReq.getUserId()).orElseThrow(NotFoundUserException::new); - user.changeUserInfo(createUserEssentialProfileReq.getUserName(), createUserEssentialProfileReq.getUserAge(), createUserEssentialProfileReq.getGender(), createUserEssentialProfileReq.getNationality(), createUserEssentialProfileReq.getPhoneNum()); + user.changeUserInfo(createUserEssentialProfileReq.getUserName(), createUserEssentialProfileReq.getUserAge(), createUserEssentialProfileReq.getGender(), createUserEssentialProfileReq.getNationality()); UserEssentialProfileRes userEssentialProfileRes = UserEssentialProfileRes.create(createUserEssentialProfileReq.getUserId(), createUserEssentialProfileReq.getUserName(), createUserEssentialProfileReq.getUserAge(), createUserEssentialProfileReq.getGender(), createUserEssentialProfileReq.getNationality());