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

[FEAT/#79] 탐색 기본 뷰 / 조회수 많은 공고 통신 #89

Merged
merged 16 commits into from
Jul 16, 2024

Conversation

arinming
Copy link
Contributor

@arinming arinming commented Jul 15, 2024

⛳️ Work Description

  • data, domain 설계
  • viewModel 설계
  • 이미지 매핑 구현
  • 빈 검색어 입력 시 검색 안되도록 구현

📸 Screenshot

79.mp4

📢 To Reviewers

  • 난 너를 사랗해 ㅋ

@arinming arinming added FEAT ✨ 새로운 기능 구현 아린💛 아린 labels Jul 15, 2024
@arinming arinming self-assigned this Jul 15, 2024
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

state랑 sideEffect 관리 넘넘 잘해줘서 보는 내내 행복,,,,, 진짜 성장해가는 게 보여요,,,,,최고💚💚

Comment on lines 4 to 7

interface SearchViewsDataSource {
suspend fun getSearchViews(): SearchViewsResponseDto
}
Copy link
Member

Choose a reason for hiding this comment

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

SearchDataSource로 파일명을 해준 다음에 그 다음에 서치 관련 함수들을 넣어주면 코드 관리하기 편할 것 같아용!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

개큰박수..

Comment on lines 7 to 15
@Serializable
data class SearchViewsResponseDto(
@SerialName("status")
val status: Int,
@SerialName("message")
val message: String,
@SerialName("result")
val result: Result,
) {
Copy link
Member

Choose a reason for hiding this comment

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

BaseResponse 사용해주면 이 부분 쓸 필요가 없어진답니당!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

스껄허게 고쳤읍니다

Comment on lines 19 to 20
class SearchViewModel @Inject constructor(
private val searchViewsRepository: SearchViewsRepository,
Copy link
Member

Choose a reason for hiding this comment

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

여기두 네이밍을 바꾼다면 SearchRepository로 바꿀 수 있을 것 같네용

Comment on lines 45 to 46
_sideEffect.emit(SearchViewsSideEffect.Toast(R.string.server_success))
}.onFailure {
Copy link
Member

Choose a reason for hiding this comment

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

서버통신에 성공했을 때는 따로 토스트 안 띄워줘도 될 것 같아용

Comment on lines 6 to 8
data class SearchViewsState(
var searchViewsList: UiState<List<SearchViewsResponseModel>> = UiState.Loading,
)
Copy link
Member

Choose a reason for hiding this comment

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

완벽함니다!!

Comment on lines 13 to 19
status = 200,
message = "탐색 > 조회수 많은 공고를 조회하는데 성공했습니다",
result = SearchViewsResponseDto.Result(
accountments = listOf(
SearchViewsResponseDto.SearchViewsData(
internshipAnnouncementId = 23L,
companyImage = "https://image.dongascience.com/Photo/2019/09/d2468576cecf1313437de5a883bfa2ed.jpg",
Copy link
Member

Choose a reason for hiding this comment

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

더미 데이터는 지워주는 게 좋을 것 같아용!!

Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

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

아린씨 정말 최고야,,, 특히 sideEffect 쓰는거랑 state 관리하는 부분 정말 많이 배워갑니다!! 개큰박수!!👏🏻👏🏻👏🏻👏🏻👏🏻

keyboardController?.hide()
focusManager.clearFocus()
onDoneAction?.invoke()
if (value.isNotEmpty() && value.isNotBlank()) {
Copy link
Member

Choose a reason for hiding this comment

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

isNotEmpty와 isNotBlank를 함께 사용하신 이유가 궁금해요!! 저는 isNotBlank가 isNotEmpty를 포함하고 있는 개념이라고 이해하고 있었거든요🥹

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉 예리하다 ㅜㅜ! 맞아요 isNotBlank 안에 isNotEmpty 개념이 포함되어서 isNotBlank만 써줘도 될 것 같습니닷

if (value.isNotEmpty() && value.isNotBlank()) {
keyboardController?.hide()
focusManager.clearFocus()
onDoneAction?.invoke()
Copy link
Member

Choose a reason for hiding this comment

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

invoke()함수 사용하지 않아도 괜찮을 것 같다는 생각이 살짝쿵 드네요..!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

null 체크를 if문으로 하는 것으로 수정했습니다!

private val searchService: SearchService
): SearchViewsDataSource {
override suspend fun getSearchViews(): SearchViewsResponseDto {
return SearchViewsResponseDto(
Copy link
Member

Choose a reason for hiding this comment

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

오,, 이렇게 하는 방법이 있네요..!!

Comment on lines 9 to 14
@SerialName("status")
val status: Int,
@SerialName("message")
val message: String,
@SerialName("result")
val result: Result,
Copy link
Member

Choose a reason for hiding this comment

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

이부분 BaseResponse 사용하면 좋을 것 같아요!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넹!

viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle)
.collect { sideEffect ->
when (sideEffect) {
is SearchViewsSideEffect.Toast -> {}
Copy link
Member

Choose a reason for hiding this comment

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

여기서 toast 확장함수 써주면 좋을 것 같아요!! sideEffect.message 쓰면 toast를 띄울 수 있다고 합니다(샤라웃 투 이유빈❤️)

Comment on lines 36 to 40
SearchViewsResponseModel(
title = entity.title,
companyImage = entity.companyImage,
announcementId = entity.announcementId
)
Copy link
Member

Choose a reason for hiding this comment

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

DTO쪽에서 매핑해주면 더 깔끔할 것 같아요!!

Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

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

역시 깔끔하네요!! 네이밍만 잘 맞춰가면 좋을 것 같아요~~

Copy link
Member

Choose a reason for hiding this comment

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

엔티티 네이밍에선 요청 응답 관련한 정보는 필요 없을 것 같다고 생각됩니다!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

앗 InternshipAnnouncement으로 통일하겠씁니다!

@arinming arinming merged commit fd5dd93 into develop Jul 16, 2024
1 check passed
@leeeyubin leeeyubin changed the title [Feat/#79] 탐색 기본 뷰 / 조회수 많은 공고 통신 [FEAT/#79] 탐색 기본 뷰 / 조회수 많은 공고 통신 Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 아린💛 아린
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 탐색 기본 뷰 / 조회수 많은 공고 통신
4 participants