generated from DO-SOPT-ANDROID/do-sopt-android-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/week4_advanced' into develop
- Loading branch information
Showing
58 changed files
with
447 additions
and
218 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
2 changes: 1 addition & 1 deletion
2
...dosopttemplate/ExampleInstrumentedTest.kt → ...osoptkwanheejo/ExampleInstrumentedTest.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
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: 3 additions & 3 deletions
6
...osopttemplate/adapter/user/UserAdapter.kt → ...soptkwanheejo/adapter/user/UserAdapter.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
9 changes: 4 additions & 5 deletions
9
...pttemplate/adapter/user/UserViewHolder.kt → ...tkwanheejo/adapter/user/UserViewHolder.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
8 changes: 4 additions & 4 deletions
8
...va/org/sopt/dosopttemplate/api/AuthAPI.kt → ...a/org/sopt/dosoptkwanheejo/api/AuthAPI.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
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/sopt/dosoptkwanheejo/api/NaverAPI.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,17 @@ | ||
package org.sopt.dosoptkwanheejo.api | ||
|
||
import org.sopt.dosoptkwanheejo.model.dto.resp.NaverPapagoResp | ||
import retrofit2.Call | ||
import retrofit2.http.Field | ||
import retrofit2.http.FormUrlEncoded | ||
import retrofit2.http.POST | ||
|
||
interface NaverAPI { | ||
@FormUrlEncoded | ||
@POST("v1/papago/n2mt") | ||
fun getTranslatedTextToPapago( | ||
@Field("source") source: String, | ||
@Field("target") target: String, | ||
@Field("text") text: String | ||
): Call<NaverPapagoResp> | ||
} |
4 changes: 2 additions & 2 deletions
4
...va/org/sopt/dosopttemplate/api/UserAPI.kt → ...a/org/sopt/dosoptkwanheejo/api/UserAPI.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
3 changes: 1 addition & 2 deletions
3
.../sopt/dosopttemplate/base/BaseActivity.kt → ...sopt/dosoptkwanheejo/base/BaseActivity.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
6 changes: 1 addition & 5 deletions
6
...dosopttemplate/base/BaseDialogFragment.kt → ...osoptkwanheejo/base/BaseDialogFragment.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
2 changes: 1 addition & 1 deletion
2
.../sopt/dosopttemplate/base/BaseFragment.kt → ...sopt/dosoptkwanheejo/base/BaseFragment.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
5 changes: 2 additions & 3 deletions
5
...opttemplate/db/local/PreferenceManager.kt → ...ptkwanheejo/db/local/PreferenceManager.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
21 changes: 10 additions & 11 deletions
21
...dosopttemplate/db/remote/AuthApiHelper.kt → ...osoptkwanheejo/db/remote/AuthApiHelper.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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/org/sopt/dosoptkwanheejo/db/remote/NaverApiHelper.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,25 @@ | ||
package org.sopt.dosoptkwanheejo.db.remote | ||
|
||
import org.sopt.dosoptkwanheejo.api.NaverAPI | ||
import org.sopt.dosoptkwanheejo.model.dto.resp.NaverPapagoResp | ||
import org.sopt.dosoptkwanheejo.model.dto.resp.NaverPapagoResult | ||
import retrofit2.Call | ||
import retrofit2.Response | ||
|
||
class NaverApiHelper(private val naverAPI: NaverAPI) { | ||
fun getTranslatedTextToPapago(source: String, target: String, text: String, onResponse: (NaverPapagoResult) -> Unit) { | ||
naverAPI.getTranslatedTextToPapago(source, target, text).enqueue(object: retrofit2.Callback<NaverPapagoResp>{ | ||
override fun onResponse( | ||
call: Call<NaverPapagoResp>, | ||
response: Response<NaverPapagoResp> | ||
) { | ||
if (response.isSuccessful) { | ||
response.body()?.message?.result?.let { onResponse(it) } | ||
} | ||
} | ||
|
||
override fun onFailure(call: Call<NaverPapagoResp>, t: Throwable) { | ||
} | ||
}) | ||
} | ||
} |
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: 3 additions & 5 deletions
8
...dosopttemplate/db/remote/UserApiHelper.kt → ...osoptkwanheejo/db/remote/UserApiHelper.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
2 changes: 1 addition & 1 deletion
2
...pt/dosopttemplate/model/HomeBottomItem.kt → ...t/dosoptkwanheejo/model/HomeBottomItem.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
2 changes: 1 addition & 1 deletion
2
...va/org/sopt/dosopttemplate/model/Music.kt → ...a/org/sopt/dosoptkwanheejo/model/Music.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.sopt.dosopttemplate.model | ||
package org.sopt.dosoptkwanheejo.model | ||
|
||
|
||
data class Music( | ||
|
4 changes: 2 additions & 2 deletions
4
...ava/org/sopt/dosopttemplate/model/User.kt → ...va/org/sopt/dosoptkwanheejo/model/User.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
2 changes: 1 addition & 1 deletion
2
...pt/dosopttemplate/model/dto/RespResult.kt → ...t/dosoptkwanheejo/model/dto/RespResult.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
2 changes: 1 addition & 1 deletion
2
.../dosopttemplate/model/dto/req/LoginReq.kt → ...dosoptkwanheejo/model/dto/req/LoginReq.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
2 changes: 1 addition & 1 deletion
2
...dosopttemplate/model/dto/req/SignUpReq.kt → ...osoptkwanheejo/model/dto/req/SignUpReq.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
35 changes: 35 additions & 0 deletions
35
app/src/main/java/org/sopt/dosoptkwanheejo/model/dto/resp/NaverPapagoResp.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,35 @@ | ||
package org.sopt.dosoptkwanheejo.model.dto.resp | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
|
||
@Serializable | ||
data class NaverPapagoResp( | ||
@SerialName("message") | ||
val message: NaverPapagoType | ||
) | ||
|
||
@Serializable | ||
data class NaverPapagoType( | ||
@SerialName("@type") | ||
val type: String, | ||
@SerialName("@service") | ||
val service: String, | ||
@SerialName("@version") | ||
val version: String, | ||
@SerialName("result") | ||
val result: NaverPapagoResult | ||
) | ||
|
||
@Serializable | ||
data class NaverPapagoResult( | ||
@SerialName("srcLangType") | ||
val srcLangType: String, | ||
@SerialName("tarLangType") | ||
val tarLangType: String, | ||
@SerialName("translatedText") | ||
val translatedText: String, | ||
@SerialName("engineType") | ||
val engineType: String | ||
) |
Oops, something went wrong.