48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Newtonsoft.Json;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Chtn.CSharp.SDK.Models.Media
|
|
{
|
|
public class RegisterUploadReq
|
|
{
|
|
[JsonProperty("roomId")] public string RoomId { get; set; }
|
|
[JsonProperty("userid")] public string UserId { get; set; }
|
|
[JsonProperty("files")] public List<FileUploadRegistration> Files { get; set; }
|
|
}
|
|
public class FileUploadRegistration
|
|
{
|
|
[JsonProperty("size")] public long Size { get; set; }
|
|
[JsonProperty("type")] public string Type { get; set; }
|
|
[JsonProperty("name")] public string Name { get; set; }
|
|
[JsonProperty("fileId")] public string FileId { get; set; }
|
|
}
|
|
public class RegisterUploadResp
|
|
{
|
|
[JsonProperty("uploadId")] public string UploadId { get; set; }
|
|
}
|
|
|
|
public class ChunkUploadReq
|
|
{
|
|
[JsonProperty("uploadId")] public string UploadId { get; set; }
|
|
[JsonProperty("chunkIndex")] public int ChunkIndex { get; set; }
|
|
[JsonProperty("data")] public byte[] Data { get; set; }
|
|
}
|
|
|
|
public class FinishUploadReq
|
|
{
|
|
[JsonProperty("uploadId")] public string UploadId { get; set; }
|
|
}
|
|
|
|
public class FileData
|
|
{
|
|
public string FileId { get; set; }
|
|
public string Name { get; set; }
|
|
public string Type { get; set; }
|
|
public byte[] Data { get; set; }
|
|
}
|
|
|
|
public interface IFileUploadProgressListener
|
|
{
|
|
void FileProgressUpdate(string tempMsgId, string fileId, int totalChunks, int currentChunk);
|
|
}
|
|
} |