Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserCocktail service, controller를 구현한다. #265

Merged
merged 16 commits into from
Feb 25, 2021
Merged

UserCocktail service, controller를 구현한다. #265

merged 16 commits into from
Feb 25, 2021

Conversation

KimGyeong
Copy link
Collaborator

#262
현재 생성, 단일 조회, 전체 조회까지 마쳤습니다.
만들고보니 완성된 아이템의 색상을 만드는 로직이 어디서 들어가야 할 지 논의를 해봐야겠단 생각이 드네요.
오늘 업데이트와 삭제가 완료될 예정입니다.

@KimGyeong KimGyeong requested a review from toneyparky February 22, 2021 23:58
Copy link
Collaborator

@toneyparky toneyparky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했습니다~

몇가지 코멘트 남겼는데 이야기 나눠보아용~

Comment on lines 16 to 21
public class UserCocktailResponse {
private String name;
private String description;
private List<UserRecipeItemResponse> userRecipeItemResponses;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id 값도 넣어서 보내주는건 어떨까용?

전체조회에서 element를 클릭할 경우 상세조회를 할 경우에 필요할듯하네요~

Comment on lines 50 to 58
fieldWithPath("userCocktailResponses").type(JsonFieldType.ARRAY).description("나만의 레시피 목록"),
fieldWithPath("userCocktailResponses.[].name").type(JsonFieldType.STRING).description("나만의 레시피 이름"),
fieldWithPath("userCocktailResponses.[].description").type(JsonFieldType.STRING)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 ID가 들어가겠죠?

import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@NoArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)

access를 달아줄까용?

public List<UserRecipeItem> toUserRecipeItems(List<Ingredient> ingredients) {
List<UserRecipeItem> userRecipeItems = new ArrayList<>();
for (int i = 0; i < ingredients.size(); i++) {
userRecipeItems.add(userRecipeItemRequests.get(i).toUserRecipeItem(ingredients.get(i)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
userRecipeItems.add(userRecipeItemRequests.get(i).toUserRecipeItem(ingredients.get(i)));
UserRecipeItem item = userRecipeItemRequests.get(i).toUserRecipeItem(ingredients.get(i))
userRecipeItems.add(item);

요정도로 수정해서 가독성을 높혀도 좋을듯해요

import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@NoArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)

😊

import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@NoArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)

🙂

}
}

public UserCocktailResponse findUserCocktail(Long id) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@transactional(readOnly = true)
붙여주죠!

.orElseThrow(() -> new EntityNotFoundException(ErrorCode.USERCOCKTAIL_NOT_FOUND));
}

public UserCocktailResponses findUserCocktails() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도!

@KimGyeong
Copy link
Collaborator Author

resolve: #262
피드백 반영 후, 나머지 API를 구현해서 바로 푸쉬했습니다.

@KimGyeong KimGyeong changed the title UserCocktail service, controller를 구현한다. (미완성) UserCocktail service, controller를 구현한다. Feb 23, 2021
Copy link
Collaborator

@toneyparky toneyparky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고했습니다.
프론트에서 컴포넌트명 수정하는건 내가 할게용

void updateUserCocktail() throws Exception {
UserCocktailRequest userCocktailupdateRequest = UserCocktailRequest.builder()
.name("updateUserCocktail")
.description("해피해킹 없이는 살 수 없는 몸이 돼었어")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

들켰군

.andExpect(status().isNoContent())
.andDo(print())
.andDo(UserCocktailDocumentation.deleteUserCocktail());

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

공백이 있는데 내가 수정할겡

@toneyparky toneyparky merged commit 7b192be into dev Feb 25, 2021
@KimGyeong KimGyeong deleted the feat/262 branch March 22, 2021 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants