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/347] 모임 일정 친구 초대 기능 구현 #365

Open
wants to merge 38 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8649648
🎨 Design: 모임 일정 생성 UI 수정
nahy-512 Dec 9, 2024
146b48f
✨ Feat: 친구 초대 화면 친구 조회 API 호출
nahy-512 Jan 7, 2025
4caa8fe
🎨 Design: 친구 초대 화면 수정
nahy-512 Jan 8, 2025
8fae907
✨ Feat: 초대할 친구 기능 구현
nahy-512 Jan 8, 2025
7e90edc
🐛 Fix: 초대할 친구 아이템 x 버튼 클릭 시 모든 친구 목록에서의 해당 친구 체크 해제
nahy-512 Jan 8, 2025
9de9293
✨ Feat: 친구 초대 전체 선택 취소 기능 구현
nahy-512 Jan 8, 2025
4d7f297
✨ Feat: 친구 초대 API 연동
nahy-512 Jan 8, 2025
f0b101a
🎨 Style: 함수, 변수명 오타 수정
nahy-512 Jan 8, 2025
419f332
✨ Feat: 보관함 캘린더 현재 달에 따라 텍스트 색 변경 구현
edv-Shin Dec 15, 2024
048b60b
✨ Feat: 보관함 캘린더 기록 아이콘 변경
edv-Shin Dec 15, 2024
98a3e79
✨ Feat: 보관함 캘린더 현재 달 스낵바 복구
edv-Shin Dec 16, 2024
561692d
🔧 Chore: 불필요한 상수 삭제
edv-Shin Dec 17, 2024
907410f
🐛 Fix: 날짜 선택 텍스트가 중복적용되는 버그 수정
edv-Shin Dec 18, 2024
0d25a92
🐛 Fix: notifyItemChanged로 인한 애니메이션 오류 수정
edv-Shin Dec 24, 2024
47b7096
♻️ Refactor: 불필요한 코드 리팩토링
edv-Shin Dec 25, 2024
8a63066
🎨Design: 모임 초대 알림 화면 삭제
nahy-512 Jan 16, 2025
0ce26dd
✨ Feat: 보관함 필터 없음 오류 처리
edv-Shin Jan 20, 2025
59df710
🐛 Fix: 보관함 키워드 줄바꿈 수정
edv-Shin Jan 20, 2025
29cf8dc
♻️ Refactor: 카테고리 UI 및 화면 이동 방식 변경
nahy-512 Jan 25, 2025
1d6004c
♻️ Refactor: 카테고리 화면 진입 과정 간소화로 인한 불필요한 파일 삭제
nahy-512 Jan 25, 2025
100805c
✨Feat: 카테고리 생성/수정/삭제 API v2 변경사항 대응
nahy-512 Jan 29, 2025
f2fa113
✨ Feat: 기본 카테고리 삭제 불가 로직 추가
nahy-512 Feb 5, 2025
caa4530
🐛 Fix: 카테고리 생성/수정/삭제 후 업데이트 이슈 해결
nahy-512 Feb 6, 2025
6a042ed
✨ Feat: 색상 선택 예외 처리
nahy-512 Feb 8, 2025
a6a6611
🐛 Fix: 카테고리 공유 설정 오류 해결
nahy-512 Feb 8, 2025
e6298b8
🐛 Fix: 일정 다이얼로그 상단 휴지통 버튼 노출여부 설정
nahy-512 Feb 8, 2025
116af79
Merge remote-tracking branch 'origin/dev' into feat/moim-friend-invit…
nahy-512 Feb 9, 2025
237442d
Merge remote-tracking branch 'origin/dev' into feat/moim-friend-invit…
nahy-512 Feb 9, 2025
c05b21c
✨ Feat: 모임 일정 편집 -> 친구 초대 화면 이동 시 이미 초대된 친구 표시해 주기
nahy-512 Feb 14, 2025
0bf6b90
✨ Feat: 친구 초대 화면 뒤로가기 다이얼로그 추가
nahy-512 Feb 14, 2025
6d73b5d
🎨 Design: 모임 일정 참석자 x 표시 삭제
nahy-512 Feb 14, 2025
19ddc29
Merge remote-tracking branch 'origin/dev' into feat/moim-friend-invit…
nahy-512 Feb 15, 2025
9088ca9
🐛 Fix: 모임 생성 후 친구 초대 팝업 표시 안 되던 오류 수정
nahy-512 Feb 15, 2025
869a54f
♻️ Refactor: getMoimResultData 초기화 코드 함수로 분리
nahy-512 Feb 16, 2025
04162a8
🐛 Fix: 모임 일정 편집 모드 참석자 선택 후 업데이트 이슈 확인
nahy-512 Feb 16, 2025
5eed8c6
🎨 Design: 초대된 친구 없을 경우 텍스트 표시
nahy-512 Feb 16, 2025
f8a8d79
🐛 Fix: 친구가 아예 없을 경우 emptyView만 표시
nahy-512 Feb 16, 2025
1feb4b1
✨ Feat: 친구 초대 화면 초대된 친구 접기/펼치기 기능 구현
nahy-512 Feb 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
android:name=".presentation.ui.home.diary.PersonalDiaryDetailActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".presentation.ui.community.alert.CommunityAlertActivity"/>
<activity android:name=".presentation.ui.community.alert.FriendAlertActivity"/>
<activity android:name=".presentation.ui.community.moim.schedule.FriendInviteActivity"/>
<activity android:name=".presentation.ui.setting.profile.ProfileEditActivity"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.mongmong.namo.data.dto.GetMoimCalendarResponse
import com.mongmong.namo.data.dto.GetMoimDetailResponse
import com.mongmong.namo.data.dto.GetMoimDetailResult
import com.mongmong.namo.data.dto.GetMoimResponse
import com.mongmong.namo.data.dto.InviteMoimParticipantRequestBody
import com.mongmong.namo.data.dto.MoimBaseResponse
import com.mongmong.namo.data.dto.MoimScheduleRequestBody
import com.mongmong.namo.data.dto.PostMoimScheduleResponse
Expand Down Expand Up @@ -278,6 +279,25 @@ class RemoteScheduleDataSource @Inject constructor(
return scheduleResponse
}

// 모임 일정 참석자 초대
suspend fun inviteMoimParticipant(
moimScheduleId: Long,
request: InviteMoimParticipantRequestBody
): BaseResponse {
var scheduleResponse = BaseResponse()
withContext(Dispatchers.IO) {
runCatching {
moimApiService.inviteMoimParticipants(moimScheduleId, request)
}.onSuccess {
scheduleResponse = it
Log.d("RemoteScheduleDataSource", "inviteMoimParticipant Success $it")
}.onFailure {
Log.d("RemoteScheduleDataSource", "inviteMoimParticipant Failure $it")
}
}
return scheduleResponse
}

// 게스트 초대용 링크 조회
suspend fun getGuestInvitationLink(
moimScheduleId: Long
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/mongmong/namo/data/dto/MoimDTO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,9 @@ data class EditMoimScheduleRequestBody(
data class EditMoimScheduleProfileRequestBody(
var title: String = "",
var imageUrl: String = ""
)

/** 모임 일정 참석자 초대 */
data class InviteMoimParticipantRequestBody(
var memberIds: List<Long>
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.mongmong.namo.data.dto.EditMoimScheduleRequestBody
import com.mongmong.namo.data.dto.GetMoimCalendarResponse
import com.mongmong.namo.data.dto.GetMoimDetailResponse
import com.mongmong.namo.data.dto.GetMoimResponse
import com.mongmong.namo.data.dto.InviteMoimParticipantRequestBody
import com.mongmong.namo.data.dto.MoimBaseResponse
import com.mongmong.namo.data.dto.MoimScheduleRequestBody
import com.mongmong.namo.data.dto.PostMoimScheduleResponse
Expand Down Expand Up @@ -62,6 +63,13 @@ interface MoimApiService {
@Body body: EditMoimScheduleProfileRequestBody
): BaseResponse

// 모임 일정 참석자 초대
@POST("schedules/meeting/{meetingScheduleId}/invitations")
suspend fun inviteMoimParticipants(
@Path("meetingScheduleId") moimScheduleId: Long,
@Body body: InviteMoimParticipantRequestBody
): BaseResponse

// 게스트 초대용 링크 조회
@GET("schedules/meeting/{meetingScheduleId}/invitations")
suspend fun getGuestInvitationLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.mongmong.namo.data.repositoriyImpl
import android.util.Log
import com.mongmong.namo.data.datasource.schedule.RemoteScheduleDataSource
import com.mongmong.namo.data.dto.EditMoimScheduleProfileRequestBody
import com.mongmong.namo.data.dto.InviteMoimParticipantRequestBody
import com.mongmong.namo.domain.model.Schedule
import com.mongmong.namo.data.remote.NetworkChecker
import com.mongmong.namo.data.dto.PatchMoimScheduleAlarmRequestBody
Expand Down Expand Up @@ -77,8 +78,8 @@ class ScheduleRepositoryImpl @Inject constructor(
}
}

override suspend fun addMoimSchedule(moimSchedule: MoimScheduleDetail): Boolean {
return remoteScheduleDataSource.addMoimSchedule(moimSchedule.toDTO()).code == SUCCESS_CODE
override suspend fun addMoimSchedule(moimSchedule: MoimScheduleDetail): Long {
return remoteScheduleDataSource.addMoimSchedule(moimSchedule.toDTO()).result
}

override suspend fun editMoimSchedule(
Expand Down Expand Up @@ -107,7 +108,17 @@ class ScheduleRepositoryImpl @Inject constructor(
).isSuccess
}

override suspend fun getGuestInvitaionLink(moimScheduleId: Long): String {
override suspend fun inviteMoimParticipant(
moimScheduleId: Long,
memberIdsToInvite: List<Long>
): Boolean {
return remoteScheduleDataSource.inviteMoimParticipant(
moimScheduleId,
InviteMoimParticipantRequestBody(memberIdsToInvite)
).isSuccess
}

override suspend fun getGuestInvitationLink(moimScheduleId: Long): String {
return remoteScheduleDataSource.getGuestInvitationLink(moimScheduleId).result
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.mongmong.namo.presentation.utils.converter.ScheduleDateConverter
object FriendMapper {
fun FriendDTO.toModel(): Friend {
return Friend(
userid = this.memberId,
userId = this.memberId,
profileUrl = this.profileImage,
nickname = this.nickname,
name = this.nickname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.joda.time.LocalDateTime
import java.io.Serializable

data class Friend(
val userid: Long,
val userId: Long,
val profileUrl: String?,
val nickname: String,
val tag: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@ data class Moim(
)
}
}
}
}

data class MoimCreateInfo(
val moimId: Long = 0L,
val title: String = ""
): Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface ScheduleRepository {

suspend fun addMoimSchedule(
moimSchedule: MoimScheduleDetail
): Boolean
): Long

suspend fun editMoimSchedule(
moimSchedule: MoimScheduleDetail,
Expand All @@ -65,7 +65,12 @@ interface ScheduleRepository {
imageUrl: String
): Boolean

suspend fun getGuestInvitaionLink(
suspend fun inviteMoimParticipant(
moimScheduleId: Long,
memberIdsToInvite: List<Long>
): Boolean

suspend fun getGuestInvitationLink(
moimScheduleId: Long
): String
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.mongmong.namo.R
import com.mongmong.namo.databinding.DialogConfirmBinding

class ConfirmDialog(
confirmDialogInterface: ConfirmDialogInterface,
title: String, content: String?, buttonText: String, id: Int
title: String, content: String?, buttonText: String?, id: Int
) : DialogFragment() {

interface ConfirmDialogInterface {
Expand Down Expand Up @@ -57,7 +58,9 @@ class ConfirmDialog(
binding.dialogDescTv.text = content
}
// 확인 버튼 텍스트
binding.dialogYesBtn.text = buttonText
if (buttonText != null) {
binding.dialogYesBtn.text = buttonText
}

// 취소 버튼이 없는 다이얼로그는 id를 -1로 넘겨줌
if (id == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import com.mongmong.namo.R
import com.mongmong.namo.databinding.FragmentCommunityBinding
import com.mongmong.namo.presentation.config.BaseFragment
import com.mongmong.namo.presentation.ui.community.alert.CommunityAlertActivity
import com.mongmong.namo.presentation.ui.community.alert.FriendAlertActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -20,7 +20,7 @@ class CommunityFragment : BaseFragment<FragmentCommunityBinding>(R.layout.fragme

private fun initClickListeners() {
binding.communityAlertIv.setOnClickListener {
startActivity(Intent(requireActivity(), CommunityAlertActivity::class.java))
startActivity(Intent(requireActivity(), FriendAlertActivity::class.java))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.mongmong.namo.domain.model.FriendRequest
import com.mongmong.namo.domain.model.Moim
import com.mongmong.namo.domain.model.Participant
import com.mongmong.namo.domain.repositories.FriendRepository
import com.mongmong.namo.domain.usecases.friend.AcceptFriendRequestUseCase
import com.mongmong.namo.domain.usecases.friend.DenyFriendRequestUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import org.joda.time.LocalDateTime
import javax.inject.Inject

@HiltViewModel
Expand All @@ -21,8 +18,6 @@ class AlertViewModel @Inject constructor(
private val acceptFriendRequestUseCase: AcceptFriendRequestUseCase,
private val denyFriendRequestUseCase: DenyFriendRequestUseCase
): ViewModel() {
private val _moimRequestList = MutableLiveData<List<Moim>>(emptyList())
val moimRequestList: LiveData<List<Moim>> = _moimRequestList

private val _friendRequestList = MutableLiveData<List<FriendRequest>>(emptyList())
val friendRequestList: LiveData<List<FriendRequest>> = _friendRequestList
Expand All @@ -31,13 +26,6 @@ class AlertViewModel @Inject constructor(
val isComplete: LiveData<Boolean> = _isComplete

init {
_moimRequestList.value = listOf(
Moim(
1, LocalDateTime.now(), "", "나모 모임 일정", "강남역",
listOf(
Participant(participantId = 3, nickname = "코코아", colorId = 4)
))
)
getFriendRequests()
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package com.mongmong.namo.presentation.ui.community.alert

import androidx.fragment.app.activityViewModels
import androidx.activity.viewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.mongmong.namo.R
import com.mongmong.namo.databinding.FragmentFriendAlertBinding
import com.mongmong.namo.presentation.config.BaseFragment
import com.mongmong.namo.presentation.config.BaseActivity
import com.mongmong.namo.presentation.ui.community.alert.adapter.FriendAlertRVAdapter
import com.mongmong.namo.presentation.ui.community.friend.FriendInfoDialog
import com.mongmong.namo.presentation.ui.community.friend.OnFriendInfoChangedListener
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class FriendAlertFragment : BaseFragment<FragmentFriendAlertBinding>(R.layout.fragment_friend_alert), OnFriendInfoChangedListener {
class FriendAlertActivity : BaseActivity<FragmentFriendAlertBinding>(R.layout.fragment_friend_alert), OnFriendInfoChangedListener {

private val viewModel: AlertViewModel by activityViewModels()
private val viewModel: AlertViewModel by viewModels()

private lateinit var friendAdapter: FriendAlertRVAdapter

override fun setup() {
binding.viewModel = this@FriendAlertFragment.viewModel
binding.viewModel = this@FriendAlertActivity.viewModel

setAdapter()
initObserve()
Expand All @@ -33,7 +33,7 @@ class FriendAlertFragment : BaseFragment<FragmentFriendAlertBinding>(R.layout.fr
friendAdapter.setItemClickListener(object : FriendAlertRVAdapter.MyItemClickListener {
override fun onFriendInfoClick(position: Int) {
// 친구 정보 화면으로 이동
FriendInfoDialog(null, viewModel.friendRequestList.value!![position], true, this@FriendAlertFragment).show(parentFragmentManager, "FriendInfoDialog")
FriendInfoDialog(null, viewModel.friendRequestList.value!![position], true, this@FriendAlertActivity).show(this@FriendAlertActivity.supportFragmentManager, "FiendDialog")
}

override fun onAcceptBtnClick(position: Int) {
Expand All @@ -49,7 +49,7 @@ class FriendAlertFragment : BaseFragment<FragmentFriendAlertBinding>(R.layout.fr
}

private fun initObserve() {
viewModel.friendRequestList.observe(viewLifecycleOwner) { friendRequestList ->
viewModel.friendRequestList.observe(this) { friendRequestList ->
if (friendRequestList.isNotEmpty()) {
friendAdapter.addRequest(friendRequestList)
}
Expand Down

This file was deleted.

Loading