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 6a7319e..f8c00b5 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,6 +19,7 @@ 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/entity/User.java b/server/src/main/java/com/yogit/server/user/entity/User.java index 75a9f05..7449d69 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 @@ -50,7 +50,7 @@ public class User extends BaseEntity { private Integer age; private float memberTemp; - private String phone; + private String phoneNum; @Enumerated(EnumType.STRING) private UserStatus userStatus; @@ -82,11 +82,12 @@ public void addLanguage(Language language){ this.languages.add(language); } - public void changeUserInfo(String userName, Integer userAge, Gender gender, Nationality nationality){ + public void changeUserInfo(String userName, Integer userAge, Gender gender, Nationality nationality, String phoneNum){ 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(){ @@ -116,4 +117,8 @@ public void addAdditionalProfile(float latitude, float longitude, String aboutMe public void addCity(City city){ this.city = city; } + + public void addPhoneNum(String phoneNum){ + this.phoneNum = phoneNum; + } } 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 14b8ba2..bd8297f 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()); + user.changeUserInfo(createUserEssentialProfileReq.getUserName(), createUserEssentialProfileReq.getUserAge(), createUserEssentialProfileReq.getGender(), createUserEssentialProfileReq.getNationality(), createUserEssentialProfileReq.getPhoneNum()); UserEssentialProfileRes userEssentialProfileRes = UserEssentialProfileRes.create(createUserEssentialProfileReq.getUserId(), createUserEssentialProfileReq.getUserName(), createUserEssentialProfileReq.getUserAge(), createUserEssentialProfileReq.getGender(), createUserEssentialProfileReq.getNationality());