-
Notifications
You must be signed in to change notification settings - Fork 2
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 #86 from kakao-tech-campus-2nd-step3/Develop
[Integrate] Weekly8 과제 제출합니다.
- Loading branch information
Showing
85 changed files
with
1,693 additions
and
700 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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<network-security-config> | ||
<domain-config cleartextTrafficPermitted="true"> | ||
<domain includeSubdomains="true">121.183.242.176</domain> | ||
</domain-config> | ||
</network-security-config> |
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
14 changes: 14 additions & 0 deletions
14
core/data/src/main/java/com/iguana/data/di/AuthInterceptor.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.iguana.data.di | ||
|
||
import okhttp3.Interceptor | ||
import okhttp3.Response | ||
|
||
class AuthInterceptor(private val tokenProvider: () -> String) : Interceptor { | ||
override fun intercept(chain: Interceptor.Chain): Response { | ||
val token = tokenProvider() | ||
val request = chain.request().newBuilder() | ||
.addHeader("Authorization", "Bearer $token") | ||
.build() | ||
return chain.proceed(request) | ||
} | ||
} |
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
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
55 changes: 55 additions & 0 deletions
55
core/data/src/main/java/com/iguana/data/mapper/SummarizeMapper.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,55 @@ | ||
package com.iguana.data.mapper | ||
|
||
import com.iguana.data.remote.model.* | ||
import com.iguana.domain.model.ai.AIResult | ||
import com.iguana.domain.model.ai.AIStatusResult | ||
import com.iguana.domain.model.ai.AIStatusResultByPage | ||
import com.iguana.domain.model.ai.SummarizationStatus | ||
|
||
// 요약 결과 매퍼 | ||
fun SummarizeResultsResponseDto.toDomain(): List<AIResult> { | ||
return results.map { pageResult -> | ||
AIResult( | ||
documentId = this.documentId, | ||
pageNumber = pageResult.pageNumber, | ||
summary = pageResult.content.summary, | ||
problem = pageResult.content.problem | ||
) | ||
} | ||
} | ||
|
||
// 상태 체크 응답 매퍼 | ||
fun StatusCheckResponseDto.toDomain(): AIStatusResult { | ||
return AIStatusResult( | ||
documentId = this.documentId, | ||
overallStatus = when (this.overallStatus) { | ||
"IN_PROGRESS" -> SummarizationStatus.IN_PROGRESS | ||
"COMPLETED" -> SummarizationStatus.COMPLETED | ||
else -> SummarizationStatus.FAILED | ||
}, | ||
totalPages = this.totalPages, | ||
completedPages = this.completedPages | ||
) | ||
} | ||
|
||
// 상태 체크 응답 (페이지별) 매퍼 | ||
fun StatusCheckByPageResponseDto.toDomain(): AIStatusResultByPage { | ||
return AIStatusResultByPage( | ||
status = when (this.status) { | ||
"IN_PROGRESS" -> SummarizationStatus.IN_PROGRESS | ||
"COMPLETED" -> SummarizationStatus.COMPLETED | ||
"NOT_REQUESTED" -> SummarizationStatus.NOT_REQUESTED | ||
else -> SummarizationStatus.FAILED | ||
} | ||
) | ||
} | ||
|
||
// 요약 결과 (페이지별) 매퍼 | ||
fun SummarizeResultsByPageResponseDto.toDomain(documentId:Long, pageNumber: Int): AIResult { | ||
return AIResult( | ||
documentId = documentId, | ||
pageNumber = pageNumber, | ||
summary = this.summary, | ||
problem = this.problem | ||
) | ||
} |
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
Oops, something went wrong.