Skip to content

Commit

Permalink
Merge pull request #44 from PawWithU/feature/organization_management
Browse files Browse the repository at this point in the history
Feature/organization management: 봉사관리 완료
  • Loading branch information
mjkim1019 authored Nov 22, 2023
2 parents daba4ec + e271dc0 commit 3d10c55
Show file tree
Hide file tree
Showing 1,255 changed files with 1,157 additions and 39,421 deletions.
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/ic_logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher_round.xml

This file was deleted.

Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Binary file not shown.
4 changes: 4 additions & 0 deletions app/src/main/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFAC60</color>
</resources>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.kusitms.connectdog.core.data.api

import com.kusitms.connectdog.core.data.api.model.AnnouncementHomeResponseItem
import com.kusitms.connectdog.core.data.api.model.AnnouncementSearchResponseItem
import com.kusitms.connectdog.core.data.api.model.ApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.ApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.ApplicationWaitingResponseItem
import com.kusitms.connectdog.core.data.api.model.ReviewResponseItem
import com.kusitms.connectdog.core.data.api.model.VolunteerResponse
import com.kusitms.connectdog.core.data.api.model.volunteer.AnnouncementHomeResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.AnnouncementSearchResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.volunteer.ApplicationWaitingResponseItem
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.kusitms.connectdog.core.data.api

import com.kusitms.connectdog.core.data.api.model.VolunteerResponse
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationRecruitingResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationWaitingResponseItem
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

internal interface InterApiService {
/**
* 봉사관리
*/
@GET("/intermediaries/posts/recruiting")
suspend fun getApplicationRecruiting(
@Query("page") page: Int?,
@Query("size") size: Int?
): List<InterApplicationRecruitingResponseItem>

@GET("/intermediaries/applications/waiting")
suspend fun getApplicationWaiting(
@Query("page") page: Int?,
@Query("size") size: Int?
): List<InterApplicationWaitingResponseItem>

@GET("/intermediaries/applications/progressing")
suspend fun getApplicationProgressing(
@Query("page") page: Int?,
@Query("size") size: Int?
): List<InterApplicationInProgressResponseItem>

@GET("/intermediaries/applications/completed")
suspend fun getApplicationCompleted(
@Query("page") page: Int?,
@Query("size") size: Int?
): List<InterApplicationCompletedResponseItem>

@GET("/intermediaries/applications/{applicationId}")
suspend fun getApplicationVolunteer(
@Path("applicationId") applicationId: Long
): VolunteerResponse
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class InterApplicationCompletedResponseItem(
val applicationId: Long,
val arrivalLoc: String,
val departureLoc: String,
val dogName: String,
val endDate: String,
val mainImage: String,
val postId: Long,
val reviewId: Long?,
val dogStatusId: Long?,
val startDate: String,
val volunteerName: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class InterApplicationInProgressResponseItem(
val postId: Long,
val applicationId: Long,
val arrivalLoc: String,
val departureLoc: String,
val dogName: String,
val endDate: String,
val mainImage: String,
val startDate: String,
val volunteerName: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class InterApplicationRecruitingResponseItem(
val postId: Long,
val arrivalLoc: String,
val departureLoc: String,
val dogName: String,
val endDate: String,
val mainImage: String,
val postStatus: String,
val startDate: String,
val volunteerName: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.kusitms.connectdog.core.data.api.model.intermediator

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class InterApplicationWaitingResponseItem(
val applicationId: Long,
val postId: Long,
val applicationTime: String,
val arrivalLoc: String,
val departureLoc: String,
val dogName: String,
val endDate: String,
val mainImage: String,
val startDate: String,
val volunteerName: String
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kusitms.connectdog.core.data.api.model
package com.kusitms.connectdog.core.data.api.model.volunteer

import com.squareup.moshi.JsonClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kusitms.connectdog.core.data.api.model
package com.kusitms.connectdog.core.data.api.model.volunteer

import com.squareup.moshi.JsonClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kusitms.connectdog.core.data.api.model
package com.kusitms.connectdog.core.data.api.model.volunteer

import com.squareup.moshi.JsonClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kusitms.connectdog.core.data.api.model
package com.kusitms.connectdog.core.data.api.model.volunteer

import com.squareup.moshi.JsonClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kusitms.connectdog.core.data.api.model
package com.kusitms.connectdog.core.data.api.model.volunteer

import com.squareup.moshi.JsonClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kusitms.connectdog.core.data.di

import com.kusitms.connectdog.core.data.api.ApiService
import com.kusitms.connectdog.core.data.api.InterApiService
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import dagger.Module
Expand All @@ -26,13 +27,14 @@ internal object ApiModule {

private val networkInterceptor: Interceptor = Interceptor { chain ->
val request = chain.request()
val jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBY2Nlc3NUb2tlbiIsInJvbGVOYW1lIjoiVk9MVU5URUVSIiwiaWQiOjEsImV4cCI6MTcwMTY4OTU0NX0.Icz7auxDCkiUSaCaEQYzMibizObIrOniP5WmjX8cn54T56kA_i2bfG9IxUne3exWdFGq7DPWp7i-prpq5LgfXw"
val jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBY2Nlc3NUb2tlbiIsInJvbGVOYW1lIjoiVk9MVU5URUVSIiwiaWQiOjEsImV4cCI6MTcwMTc4MDEwNX0.wRNKOcfnFxvXmsGFXPZ3aSsGcOXxbUXczsjC_BRtHmhGmKJalOE4P7rcY_eAdOIKldtX3xE6Gdb3DYkLGEPP5A"
val interJwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBY2Nlc3NUb2tlbiIsInJvbGVOYW1lIjoiSU5URVJNRURJQVJZIiwiaWQiOjEsImV4cCI6MTcwMTc4MDA4OX0.IxtBsu26aVswZpyfXBEYcpyLIb_IxAgFkCQTkJfG2QCeU29VfwO7ixBNACcDlvdPp2nR1PD8T6STPZKfpDW_Gw"
try {
chain.proceed(
request.newBuilder()
.addHeader(
"Authorization",
"Bearer $jwt"
"Bearer $interJwt"
) // todo
.build()
)
Expand Down Expand Up @@ -84,6 +86,19 @@ internal object ApiModule {
.create(ApiService::class.java)
}

@Provides
@Singleton
fun provideIntermediatorApiService(
okHttpClient: OkHttpClient,
moshi: Moshi
): InterApiService {
return Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.client(okHttpClient).build()
.create(InterApiService::class.java)
}

@Provides
@Singleton
fun provideJson(): Json =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.kusitms.connectdog.core.data.di

import com.kusitms.connectdog.core.data.api.InterApiService
import com.kusitms.connectdog.core.data.repository.InterManagementRepository
import com.kusitms.connectdog.core.data.repository.InterManagementRepositoryImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
internal class InterDataModule {

@Provides
@Singleton
fun provideInterManagementRepository(apiService: InterApiService): InterManagementRepository {
return InterManagementRepositoryImpl(apiService)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import javax.inject.Singleton

@InstallIn(SingletonComponent::class)
@Module
internal class DataModule {
internal class VolunteerDataModule {

@Provides
@Singleton
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.kusitms.connectdog.core.data.mapper.intermediator

import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationCompletedResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationInProgressResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationRecruitingResponseItem
import com.kusitms.connectdog.core.data.api.model.intermediator.InterApplicationWaitingResponseItem
import com.kusitms.connectdog.core.model.InterApplication
import com.kusitms.connectdog.core.util.dateRangeFormat

internal fun InterApplicationRecruitingResponseItem.toData(): InterApplication =
InterApplication(
imageUrl = mainImage,
dogName = dogName,
location = "${this.departureLoc}${this.arrivalLoc}",
date = dateRangeFormat(startDate, endDate),
volunteerName = volunteerName ?: "-",
postId = postId,
postStatus = postStatus
)

internal fun InterApplicationWaitingResponseItem.toData(): InterApplication =
InterApplication(
imageUrl = mainImage,
dogName = dogName,
location = "${this.departureLoc}${this.arrivalLoc}",
date = dateRangeFormat(startDate, endDate),
volunteerName = volunteerName,
postId = postId,
applicationTime = applicationTime,
applicationId = applicationId
)

internal fun InterApplicationInProgressResponseItem.toData(): InterApplication =
InterApplication(
imageUrl = mainImage,
dogName = dogName,
location = "${this.departureLoc}${this.arrivalLoc}",
date = dateRangeFormat(startDate, endDate),
volunteerName = volunteerName,
postId = postId,
applicationId = applicationId
)

internal fun InterApplicationCompletedResponseItem.toData(): InterApplication =
InterApplication(
imageUrl = mainImage,
dogName = dogName,
location = "${this.departureLoc}${this.arrivalLoc}",
date = dateRangeFormat(startDate, endDate),
volunteerName = volunteerName,
postId = postId,
applicationId = applicationId,
reviewId = reviewId,
dogStatusId = dogStatusId
)
Loading

0 comments on commit 3d10c55

Please sign in to comment.