package com.wmyun.module.infra.controller.admin.file.vo.preview;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

/**
 * @Description: wopi server文件信息
 * @link <a href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response">https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response<a/>
 * @link <a href="https://learn.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/71e66fb4-144b-4369-b597-f425f0b700b9?redirectedfrom=MSDN">https://learn.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/71e66fb4-144b-4369-b597-f425f0b700b9?redirectedfrom=MSDN<a/>
 * @Date: 2025/2/27 9:36
 * @Created: by ZZSLL
 */

@Data
@Builder
public class CheckFileInfoVo {

    /**
     * 基本信息
     */

    @Schema(description = "文件名称")
    @JsonProperty("BaseFileName")
    private String baseFileName;

    @Schema(description = "文件创建认")
    @JsonProperty("OwnerId")
    private String ownerId;

    @Schema(description = "文件大小")
    @JsonProperty("Size")
    private Long size;

    @Schema(description = "当前用户id")
    @JsonProperty("UserId")
    private String userId;

    @Schema(description = "用户昵称")
    @JsonProperty("UserFriendlyName")
    private String userFriendlyName;

    @Schema(description = "版本号")
    @JsonProperty("Version")
    private String version;

    /**
     * WOPI host capabilities properties
     */

    @Schema(description = "支持删除文档")
    @JsonProperty("SupportsDeleteFile")
    private Boolean supportsDeleteFile;

    @Schema(description = "支持文件重命名")
    @JsonProperty("SupportsRename")
    private Boolean supportsRename;

    @Schema(description = "支持更新文件")
    @JsonProperty("SupportsUpdate")
    private Boolean supportsUpdate;

    /**
     * https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response#userinfo
     */
    @Schema(description = "支持获取用户信息")
    @JsonProperty("SupportsUserInfo")
    private Boolean supportsUserInfo;

    /**
     * User permissions properties
     */
    @Schema(description = "只读")
    @JsonProperty("ReadOnly")
    private Boolean readOnly;

    @Schema(description = "重命名")
    @JsonProperty("UserCanRename")
    private Boolean userCanRename;

    @Schema(description = "更新文件")
    @JsonProperty("UserCanWrite")
    private Boolean userCanWrite;

    /**
     * File URL properties
     */
    @Schema(description = "文件下载地址")
    @JsonProperty("DownloadUrl")
    private String downloadUrl;

    @Schema(description = "文件下载地址（可代替wopi中的putfile）")
    @JsonProperty("FileUrl")
    private String fileUrl;

    @Schema(description = "HOST地址")
    @JsonProperty("HostViewUrl")
    private String hostViewUrl;

    @Schema(description = "HOST地址")
    @JsonProperty("HostEditUrl")
    private String hostEditUrl;
}
