Skip to content

Commit

Permalink
Merge branch 'dev' into feat/#849
Browse files Browse the repository at this point in the history
# Conflicts:
#	backend/src/main/java/com/festago/artist/domain/Artist.java
  • Loading branch information
seokjin8678 committed Apr 11, 2024
2 parents 7e5ff28 + c66566a commit 3a5d1d9
Show file tree
Hide file tree
Showing 55 changed files with 480 additions and 990 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/cd-back-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ jobs:
username: ${{ vars.DOCKER_HUB_DEV_USERNAME }}
password: ${{ secrets.DOCKER_HUB_DEV_LOGIN_TOKEN }}

- name: Build Docker images
run: docker build -t ${{ vars.DOCKER_DEV_TAG }} .

- name: Push Docker images
run: docker push ${{ vars.DOCKER_DEV_TAG }}
- name: Build And Push docker image
run: docker build --platform linux/arm64/v8 --push --tag ${{ vars.DOCKER_DEV_TAG }} .

- name: run application use ssh
uses: appleboy/ssh-action@master
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.festago.festago.presentation.ui.schooldetail

sealed interface SchoolDetailEvent {
class ShowArtistDetail(val artistId: Long) : SchoolDetailEvent

class ShowFestivalDetail(val festivalId: Long) : SchoolDetailEvent
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.festago.festago.presentation.databinding.FragmentSchoolDetailBinding
import com.festago.festago.presentation.databinding.ItemMediaBinding
Expand Down Expand Up @@ -50,6 +51,11 @@ class SchoolDetailFragment : Fragment() {
updateUi(it)
}
}
repeatOnStarted(viewLifecycleOwner) {
vm.event.collect {
handleEvent(it)
}
}
}

private fun initView(schoolId: Long) {
Expand Down Expand Up @@ -89,6 +95,24 @@ class SchoolDetailFragment : Fragment() {
}
}

private fun handleEvent(event: SchoolDetailEvent) = when (event) {
is SchoolDetailEvent.ShowArtistDetail -> {
findNavController().navigate(
SchoolDetailFragmentDirections.actionSchoolDetailFragmentToArtistDetailFragment(
event.artistId
)
)
}

is SchoolDetailEvent.ShowFestivalDetail -> {
findNavController().navigate(
SchoolDetailFragmentDirections.actionSchoolDetailFragmentToFestivalDetailFragment(
event.festivalId
)
)
}
}

private fun startBrowser(url: String) {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import com.festago.festago.presentation.ui.schooldetail.uistate.FestivalItemUiSt
import com.festago.festago.presentation.ui.schooldetail.uistate.SchoolDetailUiState
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject
Expand All @@ -26,6 +29,9 @@ class SchoolDetailViewModel @Inject constructor(
private val _uiState = MutableStateFlow<SchoolDetailUiState>(SchoolDetailUiState.Loading)
val uiState: StateFlow<SchoolDetailUiState> = _uiState.asStateFlow()

private val _event: MutableSharedFlow<SchoolDetailEvent> = MutableSharedFlow()
val event: SharedFlow<SchoolDetailEvent> = _event.asSharedFlow()

fun loadSchoolDetail(schoolId: Long) {
viewModelScope.launch {
val deferredSchoolInfo = async { schoolRepository.loadSchoolInfo(schoolId) }
Expand Down Expand Up @@ -57,8 +63,22 @@ class SchoolDetailViewModel @Inject constructor(
endDate = endDate,
imageUrl = imageUrl,
artists = artists.map { artist ->
ArtistUiState(artist.id, artist.name, artist.imageUrl)
ArtistUiState(
id = artist.id,
name = artist.name,
imageUrl = artist.imageUrl,
onArtistDetailClick = { id ->
viewModelScope.launch {
_event.emit(SchoolDetailEvent.ShowArtistDetail(id))
}
}
)
},
onFestivalDetailClick = { id ->
viewModelScope.launch {
_event.emit(SchoolDetailEvent.ShowFestivalDetail(id))
}
}
)

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ data class ArtistUiState(
val id: Long,
val name: String,
val imageUrl: String,
val onArtistDetailClick: (Long) -> Unit,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ data class FestivalItemUiState(
val endDate: LocalDate,
val imageUrl: String,
val artists: List<ArtistUiState>,
val onFestivalDetailClick: (Long) -> Unit,
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</data>

<androidx.constraintlayout.widget.ConstraintLayout
onSingleClick="@{()->artist.onArtistDetailClick.invoke(artist.id)}"
android:layout_width="66dp"
android:layout_height="66dp">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</data>

<androidx.constraintlayout.widget.ConstraintLayout
onSingleClick="@{() -> item.onFestivalDetailClick.invoke(item.id)}"
android:layout_width="match_parent"
android:layout_height="132dp"
android:layout_marginHorizontal="16dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<argument
android:name="schoolId"
app:argType="long" />
<action
android:id="@+id/action_schoolDetailFragment_to_festivalDetailFragment"
app:destination="@id/festivalDetailFragment"
app:enterAnim="@android:anim/slide_in_left"
app:popExitAnim="@android:anim/slide_out_right" />

</fragment>
<fragment
android:id="@+id/festivalDetailFragment"
Expand Down
2 changes: 2 additions & 0 deletions backend/src/main/java/com/festago/artist/domain/Artist.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.festago.artist.domain;

import com.festago.common.domain.BaseTimeEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
Expand All @@ -20,6 +21,7 @@ public class Artist extends BaseTimeEntity {

private String name;

@Column(name = "profile_image_url")
private String profileImage;

private String backgroundImageUrl;
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions backend/src/main/java/com/festago/auth/dto/AdminLoginRequest.java

This file was deleted.

13 changes: 0 additions & 13 deletions backend/src/main/java/com/festago/auth/dto/AdminSignupRequest.java

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(
name = "bookmark",
uniqueConstraints = {
@UniqueConstraint(
name = "UNIQUE_BOOKMARK_TYPE_RESOURCE_ID_MEMBER_ID",
columnNames = {"bookmark_type", "resource_id", "member_id"}
)
}
Expand Down
Loading

0 comments on commit 3a5d1d9

Please sign in to comment.