generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from School-of-Company/feature/#234_apply_cha…
…nged_or_added_api 🔀 :: (#234) - Apply changed or added api
- Loading branch information
Showing
55 changed files
with
508 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
core/data/src/main/java/com/msg/data/mapper/club/PatchClubMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.msg.data.mapper.club | ||
|
||
import com.msg.model.param.club.PatchClubParam | ||
import com.msg.network.request.club.PatchClubRequest | ||
|
||
fun PatchClubParam.toRequest() = PatchClubRequest( | ||
clubName = clubName, | ||
field = field, | ||
schoolId = schoolId | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
core/data/src/main/java/com/msg/data/mapper/map/GetLocationMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.msg.data.mapper.map | ||
|
||
import com.msg.model.entity.map.GetLocationEntity | ||
import com.msg.network.response.map.GetLocationResponse | ||
|
||
fun GetLocationResponse.toEntity() = GetLocationEntity( | ||
x = x, | ||
y = y | ||
) |
8 changes: 8 additions & 0 deletions
8
core/data/src/main/java/com/msg/data/mapper/school/GetSchoolListMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.msg.data.mapper.school | ||
|
||
import com.msg.model.entity.school.GetSchoolListEntity | ||
import com.msg.network.response.school.GetSchoolListResponse | ||
|
||
fun GetSchoolListResponse.toEntity() = GetSchoolListEntity( | ||
schools = schools | ||
) |
11 changes: 11 additions & 0 deletions
11
core/data/src/main/java/com/msg/data/mapper/school/PostSchoolMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.msg.data.mapper.school | ||
|
||
import com.msg.model.param.school.PostSchoolParam | ||
import com.msg.network.request.school.PostSchoolRequest | ||
|
||
fun PostSchoolParam.toRequest() = PostSchoolRequest( | ||
schoolName = schoolName, | ||
line = line, | ||
department = department, | ||
logoImage = logoImage | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
core/data/src/main/java/com/msg/data/repository/map/MapRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.msg.data.repository.map | ||
|
||
import com.msg.model.entity.map.GetLocationEntity | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface MapRepository { | ||
fun getLocation(address: String): Flow<GetLocationEntity> | ||
} |
18 changes: 18 additions & 0 deletions
18
core/data/src/main/java/com/msg/data/repository/map/MapRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.msg.data.repository.map | ||
|
||
import com.msg.data.mapper.map.toEntity | ||
import com.msg.model.entity.map.GetLocationEntity | ||
import com.msg.network.datasource.map.MapDataSource | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.transform | ||
import javax.inject.Inject | ||
|
||
class MapRepositoryImpl @Inject constructor( | ||
private val mapDataSource: MapDataSource | ||
) : MapRepository { | ||
override fun getLocation(address: String): Flow<GetLocationEntity> { | ||
return mapDataSource.getLocation(address = address).transform { | ||
it.toEntity() | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/data/src/main/java/com/msg/data/repository/school/SchoolRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.msg.data.repository.school | ||
|
||
import com.msg.model.entity.school.GetSchoolListEntity | ||
import com.msg.model.param.school.PostSchoolParam | ||
import com.msg.network.request.school.PostSchoolRequest | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface SchoolRepository { | ||
fun getSchoolList(): Flow<GetSchoolListEntity> | ||
fun getSchoolName(): Flow<List<String>> | ||
fun postSchool(body: PostSchoolParam): Flow<Unit> | ||
} |
28 changes: 28 additions & 0 deletions
28
core/data/src/main/java/com/msg/data/repository/school/SchoolRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.msg.data.repository.school | ||
|
||
import com.msg.data.mapper.school.toEntity | ||
import com.msg.data.mapper.school.toRequest | ||
import com.msg.model.entity.school.GetSchoolListEntity | ||
import com.msg.model.param.school.PostSchoolParam | ||
import com.msg.network.datasource.school.SchoolDataSource | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.transform | ||
import javax.inject.Inject | ||
|
||
class SchoolRepositoryImpl @Inject constructor( | ||
private val schoolDataSource: SchoolDataSource | ||
) : SchoolRepository { | ||
override fun getSchoolList(): Flow<GetSchoolListEntity> { | ||
return schoolDataSource.getSchoolList().transform { response -> | ||
response.toEntity() | ||
} | ||
} | ||
|
||
override fun getSchoolName(): Flow<List<String>> { | ||
return schoolDataSource.getSchoolName() | ||
} | ||
|
||
override fun postSchool(body: PostSchoolParam): Flow<Unit> { | ||
return schoolDataSource.postSchool(body = body.toRequest()) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/usecase/club/DeleteClubUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.msg.domain.usecase.club | ||
|
||
import com.msg.data.repository.club.ClubRepository | ||
import javax.inject.Inject | ||
|
||
class DeleteClubUseCase @Inject constructor( | ||
private val clubRepository: ClubRepository | ||
){ | ||
operator fun invoke(id: Long) = runCatching { | ||
clubRepository.deleteClub(id = id) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/msg/domain/usecase/club/PatchClubUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.msg.domain.usecase.club | ||
|
||
import com.msg.data.repository.club.ClubRepository | ||
import com.msg.model.param.club.PatchClubParam | ||
import javax.inject.Inject | ||
|
||
class PatchClubUseCase @Inject constructor( | ||
private val clubRepository: ClubRepository | ||
){ | ||
operator fun invoke(id: Long, body: PatchClubParam) = runCatching { | ||
clubRepository.patchClub(id = id, body = body) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
core/domain/src/main/java/com/msg/domain/usecase/lecture/PatchLecture.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.msg.domain.usecase.lecture | ||
|
||
import com.msg.data.repository.lecture.LectureRepository | ||
import com.msg.model.param.lecture.OpenLectureParam | ||
import java.util.UUID | ||
import javax.inject.Inject | ||
|
||
class PatchLecture @Inject constructor( | ||
private val lectureRepository: LectureRepository | ||
) { | ||
operator fun invoke(id: UUID, body: OpenLectureParam) = runCatching { | ||
lectureRepository.patchLecture(id = id, body = body) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/usecase/map/GetLocationUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.msg.domain.usecase.map | ||
|
||
import com.msg.data.repository.map.MapRepository | ||
import javax.inject.Inject | ||
|
||
class GetLocationUseCase @Inject constructor( | ||
private val mapRepository: MapRepository | ||
) { | ||
operator fun invoke(address: String) = runCatching { | ||
mapRepository.getLocation(address = address) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/usecase/school/GetSchoolListUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.msg.domain.usecase.school | ||
|
||
import com.msg.data.repository.school.SchoolRepository | ||
import javax.inject.Inject | ||
|
||
class GetSchoolListUseCase @Inject constructor( | ||
private val schoolRepository: SchoolRepository | ||
) { | ||
operator fun invoke() = runCatching { | ||
schoolRepository.getSchoolList() | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/usecase/school/GetSchoolNameUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.msg.domain.usecase.school | ||
|
||
import com.msg.data.repository.school.SchoolRepository | ||
import javax.inject.Inject | ||
|
||
class GetSchoolNameUseCase @Inject constructor( | ||
private val schoolRepository: SchoolRepository | ||
) { | ||
operator fun invoke() = runCatching { | ||
schoolRepository.getSchoolName() | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/msg/domain/usecase/school/PostSchoolUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.msg.domain.usecase.school | ||
|
||
import com.msg.data.repository.school.SchoolRepository | ||
import com.msg.model.param.school.PostSchoolParam | ||
import javax.inject.Inject | ||
|
||
class PostSchoolUseCase @Inject constructor( | ||
private val schoolRepository: SchoolRepository | ||
) { | ||
operator fun invoke(body: PostSchoolParam) = runCatching { | ||
schoolRepository.postSchool(body = body) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ plugins { | |
} | ||
|
||
dependencies { | ||
implementation(libs.okhttp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
core/model/src/main/java/com/msg/model/entity/map/GetLocationEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.msg.model.entity.map | ||
|
||
data class GetLocationEntity( | ||
val x: String, | ||
val y: String | ||
) |
7 changes: 7 additions & 0 deletions
7
core/model/src/main/java/com/msg/model/entity/school/GetSchoolListEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.msg.model.entity.school | ||
|
||
import com.msg.model.model.school.SchoolModel | ||
|
||
data class GetSchoolListEntity( | ||
val schools: List<SchoolModel> | ||
) |
Oops, something went wrong.