package com.miya.fastcashier.net

import com.miya.fastcashier.beans.LoginRequest
import com.miya.fastcashier.beans.SelfCashierAccountInfo
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.*

/**
 * 请求地址配置
 */
interface ApiService {

    companion object {

        /**
         * 登录
         */
        const val LOGIN: String = "verify/auth/token"

        /**
         * 上传日志文件
         */
        var UPLOAD_LOG_FILE: String = "verify/r-log/upload-log-file"


        fun wrapUrl(suffix: String): String {
            return ApiConfig.baseUrl.plus(suffix)
        }
    }

    @POST(LOGIN)
    fun login(@Body loginRequestCall: LoginRequest): Call<BaseResponse<SelfCashierAccountInfo>>

    @Multipart
    @POST
    fun uploadFile(@Url url: String?, @Part part: MultipartBody.Part): Call<BaseResponse<String>>
}