Skip to content

Commit

Permalink
Merge branch 'develop' into release/fairer2.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/com/depromeet/housekeeper/di/NetworkModule.kt
  • Loading branch information
wjdwns committed Jun 26, 2023
2 parents e170995 + a9d8250 commit 83389a0
Show file tree
Hide file tree
Showing 111 changed files with 4,171 additions and 199 deletions.
60 changes: 34 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,38 @@
> 집안일 분담 서비스
- 개발 기간 : 2022.03.19 ~ ing
- Team
- Android 개발자 <img src="https://img.shields.io/badge/Android-3DDC84?style=for-the-badge&logo=Android&logoColor=white"> <img src="https://img.shields.io/badge/Kotlin-7F52FF?style=for-the-badge&logo=Kotlin&logoColor=white">
- Android 개발자 : <img src="https://img.shields.io/badge/Android-3DDC84?style=for-the-badge&logo=Android&logoColor=white"> <img src="https://img.shields.io/badge/Kotlin-7F52FF?style=for-the-badge&logo=Kotlin&logoColor=white">

|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176230637-57e8041f-4a38-4ea3-a6f4-970f7bbf02c2.jpeg"/>|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176229713-86711288-ac57-4dd5-bf5d-f2ffc4889303.png"/>|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176229740-b23830e0-7bba-4966-bca4-c570a971d4d7.jpg"/>|<img width="200" height="200" src="https://user-images.githubusercontent.com/50831854/210321806-8ea1cf79-c758-44c4-900c-7138d1407c78.jpg"/>|
|:------:|:---:|:---:|:---:|
|[김수연](https://github.com/onemask)|[임수진](https://github.com/sujin-kk)|[박정준](https://github.com/wjdwns) | [김민주](https://github.com/kimchuu) |

|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176230637-57e8041f-4a38-4ea3-a6f4-970f7bbf02c2.jpeg"/>|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176229713-86711288-ac57-4dd5-bf5d-f2ffc4889303.png"/>|<img width="200" height="200" src="https://user-images.githubusercontent.com/85485290/176229740-b23830e0-7bba-4966-bca4-c570a971d4d7.jpg"/>|
|:------:|:---:|:---:|
|[김수연](https://github.com/onemask)|[임수진](https://github.com/sujin-kk)|[박정준](https://github.com/wjdwns) |

# About

**Features**
### Features
- 0. 구글 로그인
- 1. 집안일 생성
- 2. 집안일 조회
- 3. 집안일 삭제
- 4. 그룹 생성 , 카카오톡 초대 , 딥링크
- 5. 프로필 수정
- 6. 집안일 규칙 추가
- 7. 푸쉬 알림
- 8. 네트워크 연결 감지


**Technology Stack**
- Tools : Android Studio Bublebee
### Technology Stack
- Tools : Android Studio Dolphin
- Language : Kotlin
- Architecture Pattern : MVVM Pattern
- Android Architecture Components(AAC)
- Flow
- ViewModel
- Coroutine
- Data Binding
- Hilt
- Naivgation Conponponent
- FirebaseMessagingService
- OKHTTP
- RETROFIT
- MOSHI
Expand All @@ -49,32 +52,37 @@
- FIREBASK_BOM
- TIMBER

**Foldering**
### Foldering
```
.
├── adapter
├── local
├── base
├── data
│ ├── dataSource
│ ├── repository
│ └── ApiService
├── di
│ ├── NetworkModule
│ └── RepositoryModule
├── model
│   └── enums
├── network
│   └── remote
│   ├── api
│   ├── model
│   └── repository
├── ui
│   └── custom
│   ├── dialog
│   └── timepicker
│ ├── enums
│ ├── request
│   └── response
├── service
│ ├── FairerFirebaseMessagingService
│ └── InternetService
├── ui (for features)
└── util
```

# ToDo
- 메인 화면 개편
- 네트워크 상태 개선

# WireFrame
<img width="400" alt="스크린샷 2022-06-29 오전 12 58 34" src="https://user-images.githubusercontent.com/27774564/176225988-3c2a3b19-53a0-4627-89c8-1e808e2ec43b.png">
<img width="400" alt="스크린샷 2022-06-29 오전 12 58 42" src="https://user-images.githubusercontent.com/27774564/176226010-fd300d9c-30dd-4da1-b278-7354ecffb6e4.png">
<img width="400" alt="스크린샷 2022-06-29 오전 12 59 24" src="https://user-images.githubusercontent.com/27774564/176226122-5eb5603a-cfec-40e4-bed2-cd2d0c2167a4.png">
<img width="400" alt="스크린샷 2022-06-29 오전 12 59 38" src="https://user-images.githubusercontent.com/27774564/176226168-12852d78-4506-4f09-9ef2-830a3ade38c4.png">


# ToDo
- 메인 화면 개편
- 룰렛 기능
- 통계 기능

5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ android {
dataBinding {
enabled true
}
buildFeatures{
dataBinding = true
}
lintOptions {
abortOnError false
}
Expand Down Expand Up @@ -134,4 +137,6 @@ dependencies {
implementation Dependencies.hilt
kapt Dependencies.hiltCompiler

implementation Dependencies.flexbox
implementation Dependencies.roulette
}
8 changes: 8 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
"certificate_hash": "20813f399ae68f7232ac15be26e0353d720b5dfd"
}
},
{
"client_id": "940546044137-t8l1aib3ni7t8auqhpf1mqn1f8qhbqqp.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.depromeet.housekeeper",
"certificate_hash": "611c9ae53a20ca55c7aa70cd3cd27a9ecf101830"
}
},
{
"client_id": "940546044137-u481k2bgop3vkm173ufufdscgntvgd1f.apps.googleusercontent.com",
"client_type": 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.depromeet.housekeeper

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import org.junit.Assert.*
Expand Down
34 changes: 32 additions & 2 deletions app/src/main/java/com/depromeet/housekeeper/data/ApiService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ interface ApiService {
@GET("/api/houseworks/{houseWorkId}/detail")
suspend fun getDetailHouseWork(@Path("houseWorkId") houseWorkId: Int): HouseWork

@GET("/api/houseworks/list/member/{teamMemberId}/query")
@GET("/api/houseworks/list/member/{teamMemberId}/query/v2")
suspend fun getPeriodHouseWorkListOfMember(
@Path("teamMemberId") teamMemberId: Int,
@Query("fromDate") fromDate: String,
@Query("toDate") toDate: String,
): Map<String, HouseWorks> // ex) key: 2022-08-14

@GET("/api/houseworks/list/query")
@GET("/api/houseworks/list/query/v2")
suspend fun getDateHouseWorkList(
@Query("fromDate") fromDate: String,
@Query("toDate") toDate: String
Expand Down Expand Up @@ -99,6 +99,17 @@ interface ApiService {
@DELETE("/api/rules/{ruleId}")
suspend fun deleteRule(@Path("ruleId") ruleId: Int): Response

/**
* statistics 집안일 통계 API
*/
@GET("/api/statistics") // yearMonth: yyyy-MM
suspend fun getStatisticsList(@Query("yearMonth") yearMonth: String): StatsListResponse

@GET("/api/statistics/ranking")
suspend fun getStatisticsLanking(@Query("month") yearMonth: String): HouseWorkStatsResponse

@GET("/api/statistics/team-member")
suspend fun getHouseWorkStatistics(@Query("houseWorkName") houseWorkName: String, @Query("month") month: String): HouseWorkStatsResponse

/**
* teams
Expand Down Expand Up @@ -131,4 +142,23 @@ interface ApiService {
@POST("/api/fcm/message")
suspend fun sendMessage(@Body message: Message): Message


/**
feedback
*/

@POST("/api/feedback")
suspend fun createFeedback(@Body feedbackModel : CreateFeedbackModel)

@PATCH("/api/feedback/{houseworkCompleteId}")
suspend fun updateFeedback(@Path("houseworkCompleteId") houseworkCompleteId:Int, @Body comment: Comment)

@GET("/api/feedback/houseworks/{houseWorkCompleteId}")
suspend fun getFeedbackList(@Path("houseWorkCompleteId") houseWorkCompleteId:Int): FeedbackListModel

@POST("/api/fcm/hurry")
suspend fun urgeHousework(@Body urgeModel: UrgeModel)

@DELETE("/api/feedback/{feedbackId}")
suspend fun deleteFeedback(@Path("feedbackId") feedbackId:Int)
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ interface RemoteDataSource {
suspend fun getRules(): Flow<ApiResult<RuleResponses>>
suspend fun deleteRule(ruleId: Int): Flow<ApiResult<Response>>

/**
* statistics
*/
suspend fun getStatsList(yearMonth: String): Flow<ApiResult<StatsListResponse>>
suspend fun getStatsRanking(yearMonth: String): Flow<ApiResult<HouseWorkStatsResponse>>
suspend fun getHouseWorkStats(houseWorkName: String, month: String): Flow<ApiResult<HouseWorkStatsResponse>>

/**
* teams
*/
Expand All @@ -78,4 +85,18 @@ interface RemoteDataSource {
suspend fun saveToken(token: Token): Flow<ApiResult<Unit>>
suspend fun sendMessage(message: Message): Flow<ApiResult<Message>>

/**
feedback
*/

suspend fun createFeedback(feedbackModel : CreateFeedbackModel):Flow<ApiResult<Unit>>

suspend fun updateFeedback(houseworkCompleteId:Int,comment:String):Flow<ApiResult<Unit>>

suspend fun getFeedbackList(houseWorkCompleteId:Int): Flow<ApiResult<FeedbackListModel>>

suspend fun urgeHousework(urgeModel: UrgeModel): Flow<ApiResult<Unit>>

suspend fun deleteFeedback(feedbackId:Int): Flow<ApiResult<Unit>>

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.depromeet.housekeeper.model.request.*
import com.depromeet.housekeeper.model.response.*
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

Expand Down Expand Up @@ -138,6 +137,27 @@ class RemoteDataSourceImpl @Inject constructor(
}.flowOn(ioDispatcher)


/**
* statistics
*/
override suspend fun getStatsList(yearMonth: String): Flow<ApiResult<StatsListResponse>> =
safeFlow {
apiService.getStatisticsList(yearMonth)
}.flowOn(ioDispatcher)

override suspend fun getStatsRanking(yearMonth: String): Flow<ApiResult<HouseWorkStatsResponse>> =
safeFlow {
apiService.getStatisticsLanking(yearMonth)
}.flowOn(ioDispatcher)

override suspend fun getHouseWorkStats(
houseWorkName: String,
month: String
): Flow<ApiResult<HouseWorkStatsResponse>> = safeFlow {
apiService.getHouseWorkStatistics(houseWorkName, month)
}.flowOn(ioDispatcher)


/**
* teams
*/
Expand Down Expand Up @@ -181,4 +201,26 @@ class RemoteDataSourceImpl @Inject constructor(
apiService.sendMessage(message = message)
}.flowOn(ioDispatcher)

/**
feedback
*/
override suspend fun createFeedback(feedbackModel: CreateFeedbackModel): Flow<ApiResult<Unit>> =safeFlow {
apiService.createFeedback(feedbackModel = feedbackModel)
}.flowOn(ioDispatcher)

override suspend fun updateFeedback(houseworkCompleteId: Int,comment:String): Flow<ApiResult<Unit>> = safeFlow{
apiService.updateFeedback(houseworkCompleteId = houseworkCompleteId,comment=Comment(comment))
}.flowOn(ioDispatcher)

override suspend fun getFeedbackList(houseWorkCompleteId: Int): Flow<ApiResult<FeedbackListModel>> = safeFlow{
apiService.getFeedbackList(houseWorkCompleteId = houseWorkCompleteId)
}.flowOn(ioDispatcher)

override suspend fun urgeHousework(urgeModel: UrgeModel): Flow<ApiResult<Unit>> = safeFlow{
apiService.urgeHousework(urgeModel)
}.flowOn(ioDispatcher)

override suspend fun deleteFeedback(feedbackId:Int): Flow<ApiResult<Unit>> = safeFlow{
apiService.deleteFeedback(feedbackId)
}.flowOn(ioDispatcher)
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,21 @@ class MainRepository @Inject constructor(
suspend fun deleteRule(ruleId: Int): Flow<ApiResult<Response>> =
remoteDataSource.deleteRule(ruleId)

/**
* feedback
*/
suspend fun createFeedback(feedbackModel : CreateFeedbackModel):Flow<ApiResult<Unit>> =
remoteDataSource.createFeedback(feedbackModel)

suspend fun updateFeedback(houseworkCompleteId:Int,comment:String):Flow<ApiResult<Unit>> =
remoteDataSource.updateFeedback(houseworkCompleteId,comment)

suspend fun getFeedbackList(houseWorkCompleteId:Int): Flow<ApiResult<FeedbackListModel>> =
remoteDataSource.getFeedbackList(houseWorkCompleteId)

suspend fun urgeHousework(urgeModel: UrgeModel):Flow<ApiResult<Unit>> =
remoteDataSource.urgeHousework(urgeModel)

suspend fun deleteFeedback(feedbackId:Int):Flow<ApiResult<Unit>> =
remoteDataSource.deleteFeedback(feedbackId)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.depromeet.housekeeper.data.repository

import com.depromeet.housekeeper.data.dataSource.RemoteDataSourceImpl
import com.depromeet.housekeeper.model.response.ApiResult
import com.depromeet.housekeeper.model.response.HouseWorkStatsResponse
import com.depromeet.housekeeper.model.response.StatsListResponse
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow

class StatisticsRepository constructor(
private val remoteDataSource: RemoteDataSourceImpl,
private val externalScope: CoroutineScope? = null
) {
suspend fun getStatistics(yearMonth: String): Flow<ApiResult<StatsListResponse>> =
remoteDataSource.getStatsList(yearMonth)

suspend fun getStatisticsRanking(yearMonth: String): Flow<ApiResult<HouseWorkStatsResponse>> =
remoteDataSource.getStatsRanking(yearMonth)

suspend fun getHoseWorkStatistics(
houseWorkName: String,
month: String
): Flow<ApiResult<HouseWorkStatsResponse>> =
remoteDataSource.getHouseWorkStats(houseWorkName, month)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
class NetworkModule {
private val DEBUG_URL =
"http://ec2-3-39-60-64.ap-northeast-2.compute.amazonaws.com:8080"
"http://fairer-dev-env.eba-yzy7enxi.ap-northeast-2.elasticbeanstalk.com"

private val RELEASE_URL =
"https://fairer-env.eba-synb99hd.ap-northeast-2.elasticbeanstalk.com"
"http://fairer-env.eba-w7ubjjfy.ap-northeast-2.elasticbeanstalk.com"
private val BASE_URL: String = if(BuildConfig.DEBUG) DEBUG_URL else RELEASE_URL

private val networkInterceptor: Interceptor = Interceptor { chain ->
Expand Down Expand Up @@ -99,4 +100,4 @@ class NetworkModule {
fun provideRemoteDataSource(apiService: ApiService): RemoteDataSourceImpl {
return RemoteDataSourceImpl(apiService, Dispatchers.IO)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.depromeet.housekeeper.di

import com.depromeet.housekeeper.data.dataSource.RemoteDataSourceImpl
import com.depromeet.housekeeper.data.repository.MainRepository
import com.depromeet.housekeeper.data.repository.StatisticsRepository
import com.depromeet.housekeeper.data.repository.UserRepository
import dagger.Module
import dagger.Provides
Expand All @@ -25,4 +26,10 @@ class RepositoryModule {
return MainRepository(remoteDataSourceImpl)
}

@Provides
@ViewModelScoped
fun provideStatisticsRepository(remoteDataSourceImpl: RemoteDataSourceImpl): StatisticsRepository {
return StatisticsRepository(remoteDataSourceImpl)
}

}
Loading

0 comments on commit 83389a0

Please sign in to comment.