package com.bocloud.ims.interfaces.resource.azure.blob;

import com.alibaba.fastjson.JSONObject;
import com.bocloud.cmp.params.azure.AzureBlobCreateParams;
import com.bocloud.cmp.params.azure.AzureBlobParams;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.azure.blob.Blob;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;

/**
 * azure blob存储业务接口
 *
 * @author wangyu
 * @version 5.0.0-SNAPSHOT
 * @since 2021/2/2
 */
public interface BlobService {

    /**
     * 查询列表
     *
     * @param page
     * @param context
     * @return
     */
    BocloudResult<GridBean<Blob>> list(Pager page, RequestContext context);

    /**
     * 根据条件查询
     *
     * @param condition
     * @param context
     * @return
     */
    BocloudResult<Void> condition(String condition, RequestContext context);

    /**
     * 上传blob
     *
     * @param blobCreateParams
     * @param context
     * @return
     */
    BocloudResult<Void> create(AzureBlobCreateParams blobCreateParams, RequestContext context);

    /**
     * 修改blob
     *
     * @param blob
     * @param context
     * @return
     */
    BocloudResult<Void> modify(Blob blob, RequestContext context);

    /**
     * 下载blob文件
     *
     * @param id
     * @param outputStream
     * @param context
     * @return
     */
    BocloudResult<Blob> download(Long id, OutputStream outputStream, RequestContext context);

    /**
     * 下载blob文件
     *
     * @param id
     * @param context
     * @return
     */
    String download(Long id, RequestContext context);

    /**
     * 查询blob详情
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult<Blob> detail(Long id, RequestContext context);

    /**
     * 删除blob
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult<Void> remove(Long id, RequestContext context);

    /**
     * 批量删除blob
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult<Void> batchRemove(AzureBlobParams params, RequestContext context);


    /**
     * 创建blob快照
     *
     * @param blob
     * @param context
     * @return
     */
    BocloudResult<Void> createSnapshot(Blob blob, RequestContext context);


    /**
     * 删除blob快照
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult<Void> removeSnapshot(Long id, RequestContext context);

    /**
     * 批量删除blob快照
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult<Void> batchRemoveSnapshot(AzureBlobParams params, RequestContext context);

    /**
     * 下载blob快照
     *
     * @param id
     * @return
     */
    String downloadSnapshot(Long id, RequestContext context);

    /**
     * blob操作
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult<Void> operations(AzureBlobParams params, RequestContext context);
}
