-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 feat: 유저 프로필 조회 API - 유저 필수 및 추가 정보 통합 조회 & 추후 City, administrativ…
…eArea 추가 필요
- Loading branch information
Showing
5 changed files
with
99 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 51 additions & 15 deletions
66
server/src/main/java/com/yogit/server/user/dto/response/UserProfileRes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,78 @@ | ||
package com.yogit.server.user.dto.response; | ||
|
||
import com.yogit.server.user.entity.Gender; | ||
import com.yogit.server.user.entity.Nationality; | ||
import com.yogit.server.user.entity.User; | ||
import com.yogit.server.user.entity.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class UserProfileRes { | ||
String about_me; | ||
String about_me_interest; | ||
String about_me_job; | ||
|
||
int age; | ||
Long userId; | ||
|
||
// 유저 필수 정보 | ||
Integer age; | ||
String name; | ||
Gender gender; // Prefer not to say, male, female 중 하나 | ||
float member_temp; | ||
Gender gender; | ||
float memberTemp; | ||
Nationality nationality; | ||
String profile_img; // 대표 프로필 이미지 | ||
String profileImg; // 대표 프로필 이미지 | ||
String aboutMe; | ||
String login_id; | ||
UserStatus userStatus; | ||
String phone; | ||
|
||
List<String> languageNames = new ArrayList<>(); | ||
List<String> languageLevels = new ArrayList<>(); | ||
|
||
// String login_id; //TODO | ||
// String pass_word; //TODO | ||
// 유저 추가 정보 | ||
String administrativeArea; | ||
float longtitude; | ||
float latitude; | ||
|
||
CityName city; | ||
|
||
List<String> interests = new ArrayList<>(); | ||
|
||
public static UserProfileRes create(User user){ | ||
UserProfileRes userProfileRes = new UserProfileRes(); | ||
|
||
userProfileRes.about_me = user.getAboutMe(); | ||
userProfileRes.userId = user.getId(); | ||
|
||
// 유저 필수 정보 | ||
userProfileRes.age = user.getAge(); | ||
userProfileRes.name = user.getName(); | ||
userProfileRes.gender = user.getGender(); | ||
userProfileRes.member_temp = user.getMemberTemp(); | ||
userProfileRes.nationality = user.getNationality(); | ||
userProfileRes.profile_img = user.getProfileImg(); | ||
userProfileRes.profileImg = user.getProfileImg(); | ||
userProfileRes.aboutMe = user.getAboutMe(); | ||
userProfileRes.login_id = user.getLoginId(); | ||
userProfileRes.userStatus = user.getUserStatus(); | ||
userProfileRes.phone = user.getPhone(); | ||
|
||
// 유저 추가 정보 | ||
userProfileRes.administrativeArea = user.getAdministrativeArea(); | ||
userProfileRes.longtitude = user.getLongtitude(); | ||
userProfileRes.latitude = user.getLatitude(); | ||
|
||
return userProfileRes; | ||
} | ||
|
||
public void addCity(CityName city){ | ||
this.city = city; | ||
} | ||
|
||
public void addLanguage(String languageName, String languageLevel){ | ||
this.languageNames.add(languageName); | ||
this.languageLevels.add(languageLevel); | ||
} | ||
|
||
public void addInterest(String interest){ | ||
this.interests.add(interest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
server/src/main/java/com/yogit/server/user/service/UserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters