package com.img.rabbit.viewmodel.`interface`

import com.img.rabbit.bean.response.AlipayParamEntity
import com.img.rabbit.bean.response.CaptchaCodeEntity
import com.img.rabbit.bean.response.UploadFileEntity
import com.img.rabbit.bean.response.LoginInfoEntity
import com.img.rabbit.bean.response.UserConfigEntity
import com.img.rabbit.bean.response.UserInfoEntity
import com.img.rabbit.provider.api.ResultVo
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ServiceVo {
    /*
    @POST("/dictionary/getTsSyspara")
    suspend fun requestHospitalName(): Response<ResultListVo<MutableList<HospitalNameData>>>
    @POST("/dictionary/getLogo")
    suspend fun requestHospitalLogo(): Response<ResultListVo<HospitalLogoData>>
    @POST("/nurse/login")
    suspend fun requestLogin(@Body request: LoginRequest): Response<ResultListVo<LoginData>>
     */

    /**
     * 获取服务器时间
     */
    @GET("/api/time")
    suspend fun getServerTime(): ResultVo<Long>

    /**
     * 获取客户端配置
     */
    @GET("/api/user/config")
    suspend fun getUserConfig(
        @Query("oaid") oaid: String,
        @Query("os_version") osVersion: Int,
        @Query("ua") ua: String,
        @Query("imei") imei: String,
        @Query("cid") cid: String,
    ): ResultVo<UserConfigEntity>

    @GET("api/alipay/app_param")
    suspend fun getAlipayAuthParam(): ResultVo<AlipayParamEntity>

    /**
     * 发送验证码
     */
    @POST("api/user/code")
    suspend fun sendCode(@Body requestBody: RequestBody): ResultVo<CaptchaCodeEntity>

    /**
     * 登录
     */
    @POST("/api/user/login")
    suspend fun login(@Body requestBody: RequestBody): ResultVo<LoginInfoEntity>


    /**
     * 退出登录
     */
    @POST("/api/user/logout")
    suspend fun logout(): ResultVo<Any>

    /**
     * 注销
     */
    @POST("/api/user/destroy")
    suspend fun userDestroy(): ResultVo<Any>

    /**
     * 获取用户信息
     */
    @GET("/api/user")
    suspend fun userInfo(): ResultVo<UserInfoEntity>

    /**
     * 获取账号列表
     */
    @GET("/api/user/account")
    suspend fun account(@Query("scene") scene: String="account"): ResultVo<MutableList<UserInfoEntity>?>

    /**
     * 上传文件
     */
    @Multipart
    @POST("/api/user/upload")
    suspend fun upload(@Part part: MultipartBody.Part, @Query("scene") scene: String): ResultVo<UploadFileEntity>

    /**
     *删除上传文件
     */
    @DELETE("/api/user/upload")
    suspend fun deleteFile(@Query("id") id: String): ResultVo<Any>

    /**
     * 意见反馈
     */
    @POST("/api/user/feedback")
    suspend fun feedback(@Body requestBody: RequestBody): ResultVo<Any>
}