package com.adealink.weparty.oss.data

import com.adealink.frame.oss.data.UploadFile
import com.google.gson.annotations.SerializedName

enum class OssType(val type: Int) {
    AVATAR(1),
    COVER(2),
    LOG(5);

    companion object {

    }
}

data class OssUploadReq(
    @SerializedName("type") val type: Int, //类型
    @SerializedName("suffix") val suffix: String //文件后缀
)

data class OssUploadRes(
    @SerializedName("preSignUrl") val uploadUrl: String, //文件上传地址
    @SerializedName("fileUrl") val fileUrl: String //文件远端地址
)


fun UploadFile.LocalFile.toUploadReq(): OssUploadReq {
    return OssUploadReq(
        OssType.AVATAR.type,
        fileType.suffix
    )
}