Преглед на файлове

2024-09-29 修改

修改:
1. 部分UI逻辑修改, 修改部分请求体为APK加密做准备
zhaiy преди 6 месеца
родител
ревизия
c434833136

+ 2 - 1
app/src/main/java/com/pan_american/android/data/model/address_book/network/DepartmentListRequest.kt

@@ -1,5 +1,6 @@
 package com.pan_american.android.data.model.address_book.network
 
+import com.google.gson.annotations.SerializedName
 import com.pan_american.android.base.BaseRequest
 
-class DepartmentListRequest(val companyId: Int): BaseRequest()
+class DepartmentListRequest(@SerializedName("companyId")val companyId: Int): BaseRequest()

+ 2 - 1
app/src/main/java/com/pan_american/android/data/model/address_book/network/MemberListRequest.kt

@@ -1,5 +1,6 @@
 package com.pan_american.android.data.model.address_book.network
 
+import com.google.gson.annotations.SerializedName
 import com.pan_american.android.base.BaseRequest
 
-class MemberListRequest(val companyId: Int, val depId: Int): BaseRequest()
+class MemberListRequest(@SerializedName("companyId")val companyId: Int, @SerializedName("depId")val departmentId: Int): BaseRequest()

+ 6 - 6
app/src/main/java/com/pan_american/android/ui/efficiency_tools/address_book/MemberListFragment.kt

@@ -29,9 +29,9 @@ class MemberListFragment : BaseFragment<FragmentMemberListBinding>() {
 
     private var companyName = ""
 
-    private var depId = 0
+    private var departmentId = 0
 
-    private var depName = ""
+    private var departmentName = ""
 
     override fun getViewBinding(
         inflater: LayoutInflater, container: ViewGroup?, bundle: Bundle?
@@ -43,8 +43,8 @@ class MemberListFragment : BaseFragment<FragmentMemberListBinding>() {
         requireArguments().apply {
             companyId = getInt("companyId")
             companyName = getString("companyName").toString()
-            depId = getInt("depId")
-            depName = getString("depName").toString()
+            departmentId = getInt("depId")
+            departmentName = getString("depName").toString()
         }
 
         initViews()
@@ -52,7 +52,7 @@ class MemberListFragment : BaseFragment<FragmentMemberListBinding>() {
 
     override fun initViews() {
         binding.subtitle.text =
-            String.format(resources.getString(R.string.member_sub_title), companyName, depName)
+            String.format(resources.getString(R.string.member_sub_title), companyName, departmentName)
         initMemberList()
     }
 
@@ -62,7 +62,7 @@ class MemberListFragment : BaseFragment<FragmentMemberListBinding>() {
             return
         }
 
-        ServiceCreator.create<APIService>().getMembersList(MemberListRequest(companyId, depId))
+        ServiceCreator.create<APIService>().getMembersList(MemberListRequest(companyId, departmentId))
             .enqueue(object : Callback<MemberListResponse> {
                 override fun onResponse(
                     call: Call<MemberListResponse>, response: Response<MemberListResponse>

+ 1 - 1
app/src/test/java/com/oasystem/forandroid/ExampleUnitTest.kt

@@ -1,4 +1,4 @@
-package com.pan_american.android
+package com.oasystem.forandroid
 
 import org.junit.Test