package com.framework.app.api

import com.framework.app.http.FileInfo
import com.framework.app.http.FileUploadInfo
import com.framework.app.test2IP
import com.framework.mvvm.model.data.Model
import com.framework.mvvm.model.vo.*
import okhttp3.RequestBody
import retrofit2.http.*

interface Api {
    /**
     * 获取自字典数据
     */
    @POST("adm/dict")
    suspend fun getDict(@Body request: AdmRequest): Model<Dict>

    /**
     * 获取配置信息
     */
    @POST("adm/config")
    suspend fun getConfig(@Body request: AdmRequest): Model<Config>

    /**
     * 获取框架数据
     */
    @POST("adm/frame")
    suspend fun getFrame(@Body request: AdmRequest): Model<Frame>

    /**
     * 获取建筑数据
     */
    @POST("adm/download")
    suspend fun getBuilding(@Body request: AdmRequest): Model<Building>

    /**
     * 上传建筑数据
     */
    @Headers("Content-Encoding: gzip")
    @POST("adm/upload")
    suspend fun uploadBuilding(@Body building: UploadBuilding): Model<UploadResult>

    /**
     * 获取文件上传接口
     */
    @POST("http://develop.persagy.com/dmp-file/file/initSingleUpload?groupCode=BR&userId=bdtp&appId=adm&projectId=Pj000222011")
    suspend fun getFileUploadInfo(@Body file: FileInfo): Model<FileUploadInfo>

    /**
     * 上传文件
     */
    @PUT("")
    suspend fun uploadFile(@Url url: String, @Body file: RequestBody): String
}

