From fa57a9b4bcba2a0a05bd1f2639b51403497fc321 Mon Sep 17 00:00:00 2001 From: sitou Date: Wed, 10 Sep 2025 18:41:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=82=B8=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=8B=E3=82=89=E3=81=AE=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E6=99=82=E3=80=81=E8=AA=8D=E8=A8=BC=E5=89=8D?= =?UTF-8?q?=E3=81=AB=E6=89=BF=E8=AA=8D=E4=BB=B6=E6=95=B0=E5=8F=96=E5=BE=97?= =?UTF-8?q?API=E3=82=92=E5=AE=9F=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atled/agileworks/view/ui/login/LoginFragment.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt b/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt index a88f7d5..1803139 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt @@ -19,6 +19,7 @@ import androidx.core.view.WindowInsetsCompat import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders +import androidx.lifecycle.lifecycleScope import com.google.android.material.snackbar.Snackbar import com.google.firebase.messaging.FirebaseMessaging import jp.atled.agileworks.BuildConfig @@ -43,6 +44,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch +import java.io.IOException class LoginFragment: Fragment() { @@ -71,6 +73,17 @@ class LoginFragment: Fragment() { } else if(tapServer > -1) { //ウィジェットタップ + // 認証前にサーバーと接続が必要?→承認件数取得APIを実行しておく(ZA5965) + viewLifecycleOwner.lifecycleScope.launch { + try { + Log.d(TAG, "ウィジェットの接続先に承認件数取得APIを実行") + val response = ApiClient.instance(tapServer).getApproval().execute() + } catch (e: IOException) { + Log.e(TAG, "IOException:ウィジェットの接続先に承認件数取得APIを実行して失敗", e) + } catch (e: Exception) { + Log.e(TAG, "Exception:ウィジェットの接続先に承認件数取得APIを実行して失敗", e) + } + } ServerRepository().setServer(tapServer) ServerRepository().changeServerList(tapServer) } else { -- GitLab From 53c571b43d74b04c5571aaa35456bc9d1035ac35 Mon Sep 17 00:00:00 2001 From: sitou Date: Tue, 16 Sep 2025 09:32:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=82=B8=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=BF=E3=83=83=E3=83=97=E6=99=82API?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=81=A7=E3=81=AA=E3=81=8F=E3=80=81ApiClient?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agileworks/view/ui/login/LoginFragment.kt | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt b/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt index 1803139..7644a3f 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/login/LoginFragment.kt @@ -19,7 +19,6 @@ import androidx.core.view.WindowInsetsCompat import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders -import androidx.lifecycle.lifecycleScope import com.google.android.material.snackbar.Snackbar import com.google.firebase.messaging.FirebaseMessaging import jp.atled.agileworks.BuildConfig @@ -44,7 +43,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch -import java.io.IOException class LoginFragment: Fragment() { @@ -73,17 +71,7 @@ class LoginFragment: Fragment() { } else if(tapServer > -1) { //ウィジェットタップ - // 認証前にサーバーと接続が必要?→承認件数取得APIを実行しておく(ZA5965) - viewLifecycleOwner.lifecycleScope.launch { - try { - Log.d(TAG, "ウィジェットの接続先に承認件数取得APIを実行") - val response = ApiClient.instance(tapServer).getApproval().execute() - } catch (e: IOException) { - Log.e(TAG, "IOException:ウィジェットの接続先に承認件数取得APIを実行して失敗", e) - } catch (e: Exception) { - Log.e(TAG, "Exception:ウィジェットの接続先に承認件数取得APIを実行して失敗", e) - } - } + ApiClient.instance(tapServer) ServerRepository().setServer(tapServer) ServerRepository().changeServerList(tapServer) } else { -- GitLab