Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ data class MissingPersonDetailResponse(
"OTHER" -> "기타"
else -> "알 수 없음"
}

val nationalityLabel: String
get() = when (nationality) {
"DOMESTIC" -> "내국인"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ data class ReportRequest(
val surroundingImageUrls: List<String>? = emptyList(),
val additionalReport: String? = null
)

enum class ReportGender(val label: String) { // 성별
MALE("남자"),
FEMALE("여자")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import retrofit2.http.POST
import retrofit2.http.Path

interface ApiService {

@POST("/reports")
suspend fun createReport(@Body reportRequest: ReportRequest): Response<Unit>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@ object NetworkClient {
return retrofit.create(ReportApi::class.java)
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query


interface MissingPersonApi {
@GET("/api/missing_person")
suspend fun getMissingPersons(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import com.mobile.reconnect.data.network.ApiService
import retrofit2.Response
import javax.inject.Inject


class ReportApi @Inject constructor(private val apiService: ApiService) {

suspend fun createReport(reportRequest: ReportRequest): Response<Unit> {
return apiService.createReport(reportRequest)
}

suspend fun updateGender(missingPersonId: Long, gender: ReportGender): Response<Unit> {
return apiService.updateGender(missingPersonId, mapOf("gender" to gender))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class MissingPersonRepository @Inject constructor(
suspend fun getMissingPersons(sortBy: String, latitude: Double, longitude: Double): List<MissingPersonListResponse> {
return missingPersonApi.getMissingPersons(sortBy, latitude, longitude)
}

suspend fun getMissingPersonDetails(id: Long): MissingPersonDetailResponse {
return missingPersonApi.getMissingPersonDetails(id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class ReportRepository @Inject constructor(private val api: ReportApi) {
null // 네트워크 에러 처리
}
}

suspend fun updateGender(missingPersonId: Long, gender: com.mobile.reconnect.data.model.ReportGender): Response<Unit>? {
return try {
api.updateGender(missingPersonId, gender)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ReportDetailFragment : BaseFragment<FragmentReportDetailBinding>(R.layout.
}

private fun setupObservers() {
// 실종자 상세 정보 관찰
// 실종자 상세 정보
viewModel.missingPersonDetail.observe(viewLifecycleOwner) { detail ->
if (detail != null) {
binding.missingPerson = detail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ReportFragment : BaseFragment<FragmentReportBinding>(R.layout.fragment_rep
binding.lifecycleOwner = viewLifecycleOwner
binding.viewModel = viewModel


// RecyclerView 설정
setupRecyclerView()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ReportRegistrationFragment : Fragment(R.layout.fragment_report_registratio
super.onViewCreated(view, savedInstanceState)
_binding = FragmentReportRegistrationBinding.bind(view)


// reportbtn 클릭 시 MyReportFragment로 이동
binding.reportbtn.setOnClickListener {
findNavController().navigate(R.id.action_reportRegistrationFragment_to_myReportFragment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class MissingPersonAdapter(
binding.root.setOnClickListener { onClick(item, it) }
}
}

companion object DiffCallback : DiffUtil.ItemCallback<MissingPersonListResponse>() {
override fun areItemsTheSame(
oldItem: MissingPersonListResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class MissingPersonViewModel @Inject constructor(
}
}
}

private fun updateCurrentTime() {
viewModelScope.launch {
while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ReportRegistrationViewModel @Inject constructor(
}
}
}

fun updateGender(
missingPersonId: Long,
gender: com.mobile.reconnect.data.model.ReportGender, // 올바른 타입
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
tools:layout_editor_absoluteX="22dp"
tools:layout_editor_absoluteY="12dp" />
</androidx.appcompat.widget.Toolbar>

<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="0dp"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_report_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>


<Button
android:id="@+id/reportbtn"
style="@style/SemiBoldFontKr.16"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_report_registration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
type="com.mobile.reconnect.data.model.report.MissingPersonListResponse" />
</data>


<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/item_missing_person.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="0dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/item_report_missing_person.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
name="missingPerson"
type="com.mobile.reconnect.data.model.report.MissingPersonListResponse" />
</data>

<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
app:destination="@id/fragment_report_registration" />
</fragment>

<!-- 제보 등록 -->
<!-- 제보 등록 -->
<fragment
android:id="@+id/fragment_report_registration"
android:name="com.mobile.reconnect.ui.report.ReportRegistrationFragment"
Expand Down