package com.casic.detector.retrofit

import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface RetrofitService {
    /**
     * 登录
     */
    @GET("/ems/user/login.do")
    suspend fun login(
        @Query("userName") userName: String,
        @Query("password") password: String
    ): String

    /**
     * 更新版本
     */
    @GET("/ems/app/get-latest-version.do")
    suspend fun getApplicationVersion(): String

    /**
     * 下载
     */
    @GET("/ems/marker/exportMarker.do")
    suspend fun getMarkerFile(
        @Query("userId") userId: String,
        @Query("companyId") companyId: String
    ): String

    /**
     * 获取标识器图片
     */
    @POST("/ems/marker/get-marker-images.do")
    suspend fun getLabelPicture(@Body requestBody: RequestBody): String

    /**
     * 获取巡检工单
     */
    @GET("/ems/rs/task/get")
    suspend fun getTask(@Query("userName") userName: String): String

    /**
     * 提交工单
     */
    @GET("/ems/rs/task/update")
    suspend fun uploadTask(
        @Query("userId") userId: String,
        @Query("taskId") taskId: String,
        @Query("state") state: String
    ): String

    /**
     * 安装新标识器
     */
    @POST("/ems/marker/save-marker-photo.do")
    suspend fun installLabel(@Body requestBody: RequestBody): String
}