Files
SecurityDefenseDevice/app/src/main/java/com/example/defenseapplication/utils/ApiService.kt

53 lines
1.5 KiB
Kotlin
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.example.defenseapplication.utils
import bean.ForgotRequest
import com.example.defenseapplication.bean.DeviceBean
import com.example.defenseapplication.bean.FamilyBean
import com.example.defenseapplication.bean.GetCodeBean
import bean.LoginBean
import bean.LoginRequest
import bean.RegisterRequest
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Query
interface ApiService {
/**
* 获取登录验证码
*/
@GET("/resource/sms/code")
suspend fun getCode(@Query("userName") userName: String): GetCodeBean<String>
/**
* app登录方法
* @param loginRequest 登录参数 sms验证码登录password密码登录
*
*/
@POST("/app/login")
suspend fun login(@Body loginRequest: LoginRequest): GetCodeBean<LoginBean>
/**
* app注册
*/
@POST("/app/register")
suspend fun register(@Body registerRequest: RegisterRequest): GetCodeBean<Any>
/**
* 忘记密码——修改密码
*/
@PUT("/app/forgot")
suspend fun forgotPassword(@Body forgotRequest: ForgotRequest): GetCodeBean<Any>
/**
* 获取家庭列表
*/
@GET("/app/selectFamily")
suspend fun getFamilyList(): GetCodeBean<List<FamilyBean>>
/**
* 切换家庭
*/
//@POST("/app/switchFamily")
//suspend fun switchFamily(@Body request: com.example.defenseapplication.bean.SwitchFamilyRequest): GetCodeBean<Any>
}