-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
150 additions
and
14 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
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
31 changes: 27 additions & 4 deletions
31
core-module/src/main/java/com/foodgo/coremodule/user/dto/request/UserRegisterRequest.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
11 changes: 10 additions & 1 deletion
11
core-module/src/main/java/com/foodgo/coremodule/user/dto/request/UserUpdateRequest.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,4 +1,13 @@ | ||
package com.foodgo.coremodule.user.dto.request; | ||
|
||
public record UserUpdateRequest() { | ||
import com.foodgo.coremodule.user.enums.DiseaseType; | ||
import com.foodgo.coremodule.user.enums.UsageType; | ||
|
||
public record UserUpdateRequest( | ||
String nickname, | ||
UsageType usageType, | ||
DiseaseType diseaseType, | ||
String lifeStyle, | ||
String allergy | ||
) { | ||
} |
12 changes: 11 additions & 1 deletion
12
core-module/src/main/java/com/foodgo/coremodule/user/dto/response/UserDetailGetResponse.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,21 +1,31 @@ | ||
package com.foodgo.coremodule.user.dto.response; | ||
|
||
import com.foodgo.coremodule.user.domain.User; | ||
import com.foodgo.coremodule.user.enums.DiseaseType; | ||
import com.foodgo.coremodule.user.enums.UsageType; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record UserDetailGetResponse( | ||
Long id, | ||
String username, | ||
String imageUrl | ||
String imageUrl, | ||
UsageType usageType, | ||
DiseaseType diseaseType, | ||
String lifeStyle, | ||
String allergy | ||
) { | ||
|
||
public static UserDetailGetResponse from(User user) { | ||
return UserDetailGetResponse.builder() | ||
.id(user.getId()) | ||
.username(user.getUsername()) | ||
.imageUrl(user.getImageUrl()) | ||
.usageType(user.getUsageType()) | ||
.diseaseType(user.getDiseaseType()) | ||
.lifeStyle(user.getLifeStyle()) | ||
.allergy(user.getAllergy()) | ||
.build(); | ||
} | ||
} |
16 changes: 15 additions & 1 deletion
16
core-module/src/main/java/com/foodgo/coremodule/user/dto/response/UserRegisterResponse.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,19 +1,33 @@ | ||
package com.foodgo.coremodule.user.dto.response; | ||
|
||
import com.foodgo.coremodule.user.domain.User; | ||
import com.foodgo.coremodule.user.enums.DiseaseType; | ||
import com.foodgo.coremodule.user.enums.UsageType; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record UserRegisterResponse( | ||
Long id, | ||
String username | ||
String username, | ||
String nickname, | ||
String imageUrl, | ||
UsageType usageType, | ||
DiseaseType diseaseType, | ||
String lifeStyle, | ||
String allergy | ||
) { | ||
|
||
public static UserRegisterResponse from(User user) { | ||
return UserRegisterResponse.builder() | ||
.id(user.getId()) | ||
.username(user.getUsername()) | ||
.nickname(user.getNickname()) | ||
.imageUrl(user.getImageUrl()) | ||
.usageType(user.getUsageType()) | ||
.diseaseType(user.getDiseaseType()) | ||
.lifeStyle(user.getLifeStyle()) | ||
.allergy(user.getAllergy()) | ||
.build(); | ||
} | ||
} |
15 changes: 14 additions & 1 deletion
15
core-module/src/main/java/com/foodgo/coremodule/user/dto/response/UserUpdateResponse.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,18 +1,31 @@ | ||
package com.foodgo.coremodule.user.dto.response; | ||
|
||
import com.foodgo.coremodule.user.domain.User; | ||
import com.foodgo.coremodule.user.enums.DiseaseType; | ||
import com.foodgo.coremodule.user.enums.UsageType; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record UserUpdateResponse( | ||
String username, | ||
String imageUrl | ||
String nickname, | ||
String imageUrl, | ||
UsageType usageType, | ||
DiseaseType diseaseType, | ||
String lifeStyle, | ||
String allergy | ||
) { | ||
|
||
public static UserUpdateResponse from(User user) { | ||
return UserUpdateResponse.builder() | ||
.username(user.getUsername()) | ||
.nickname(user.getNickname()) | ||
.imageUrl(user.getImageUrl()) | ||
.usageType(user.getUsageType()) | ||
.diseaseType(user.getDiseaseType()) | ||
.lifeStyle(user.getLifeStyle()) | ||
.allergy(user.getAllergy()) | ||
.build(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core-module/src/main/java/com/foodgo/coremodule/user/enums/DiseaseType.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.foodgo.coremodule.user.enums; | ||
|
||
public enum DiseaseType { | ||
DIABETES, HYPERLIPIDEMIA, GOUT | ||
} |
5 changes: 5 additions & 0 deletions
5
core-module/src/main/java/com/foodgo/coremodule/user/enums/UsageType.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.foodgo.coremodule.user.enums; | ||
|
||
public enum UsageType { | ||
INGREDIENT, RECIPE, DIARY, CHALLENGE | ||
} |
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
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