package com.example.defenseapplication.utils

import bean.ForgotRequest
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>

    @POST("/app/login")
    suspend fun login(@Body loginRequest: LoginRequest): GetCodeBean<LoginBean>

    @POST("/app/register")
    suspend fun register(@Body registerRequest: RegisterRequest): GetCodeBean<Any>

    @PUT("/app/forgot")
    suspend fun forgotPassword(@Body forgotRequest: ForgotRequest): GetCodeBean<Any>
}

