diff --git a/build.gradle.kts b/build.gradle.kts index 64b1c48..233b214 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,5 +48,7 @@ dependencies { implementation ("io.github.scwang90:refresh-footer-ball:2.1.0") //球脉冲加载 implementation ("io.github.scwang90:refresh-footer-classics:2.1.0") implementation ("com.google.code.gson:gson:2.10.1") + implementation ("com.squareup.retrofit2:retrofit:2.9.0") + implementation ("com.squareup.retrofit2:converter-gson:2.9.0") } \ No newline at end of file diff --git a/src/main/java/com/hnucm/c202201020141/Api.java b/src/main/java/com/hnucm/c202201020141/Api.java index 59a3245..766f845 100644 --- a/src/main/java/com/hnucm/c202201020141/Api.java +++ b/src/main/java/com/hnucm/c202201020141/Api.java @@ -1,4 +1,14 @@ package com.hnucm.c202201020141; +import java.util.Map; + +import retrofit2.Call; +import retrofit2.http.Body; +import retrofit2.http.POST; + public interface Api { + @POST("login") + Call login(@Body Map map); + + } diff --git a/src/main/java/com/hnucm/c202201020141/Doctor2.java b/src/main/java/com/hnucm/c202201020141/Doctor2.java deleted file mode 100644 index c8c4f72..0000000 --- a/src/main/java/com/hnucm/c202201020141/Doctor2.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.hnucm.c202201020141; - -import java.util.List; - -public class Doctor2 { - public List departments; - - public static class DepartmentsDTO { - public String Doctor; - public String Expert; - public String Cost; - public String Picture; - } -} diff --git a/src/main/java/com/hnucm/c202201020141/LoginResult.java b/src/main/java/com/hnucm/c202201020141/LoginResult.java new file mode 100644 index 0000000..d37fd6b --- /dev/null +++ b/src/main/java/com/hnucm/c202201020141/LoginResult.java @@ -0,0 +1,12 @@ +package com.hnucm.c202201020141; + +import com.google.gson.annotations.SerializedName; + +public class LoginResult { + @SerializedName("msg") + public String msg; + @SerializedName("code") + public Integer code; + @SerializedName("token") + public String token; +} diff --git a/src/main/java/com/hnucm/c202201020141/Medicine.java b/src/main/java/com/hnucm/c202201020141/Medicine.java deleted file mode 100644 index 7c5c737..0000000 --- a/src/main/java/com/hnucm/c202201020141/Medicine.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.hnucm.c202201020141; - -import java.util.List; - -public class Medicine { - public List departments; - - public static class DepartmentsDTO { - public String Doctor; - public String Expert; - public String Cost; - public String Picture; - } -}