package ink.wgink.module.file.remote;

import ink.wgink.annotation.rpc.rest.RemoteService;
import ink.wgink.annotation.rpc.rest.method.RemotePostMethod;
import ink.wgink.annotation.rpc.rest.params.RemoteFileInputStreamParams;
import ink.wgink.annotation.rpc.rest.params.RemoteFormParams;
import ink.wgink.annotation.rpc.rest.params.RemoteHeaderParams;
import ink.wgink.annotation.rpc.rest.params.RemoteServerParams;
import ink.wgink.common.rpc.rest.pojo.RemoteFileInputStream;
import ink.wgink.module.file.pojo.dtos.v2.FileUploadSuccessDTO;

/**
 * @ClassName: IFileCenterUploadService
 * @Description: 文件中心上传
 * @Author: wanggeng
 * @Date: 2022/8/4 15:00
 * @Version: 1.0
 */
@RemoteService
public interface IFileCenterRemoteService {

    /**
     * 上传文件
     *
     * @param server
     * @param accessKey
     * @param accessSecret
     * @param remoteFileInputStream
     * @param creator
     * @return
     */
    @RemotePostMethod("/app/file-center/upload-file")
    FileUploadSuccessDTO uploadFile(@RemoteServerParams String server,
                                    @RemoteHeaderParams("Access-Key") String accessKey,
                                    @RemoteHeaderParams("Access-Secret") String accessSecret,
                                    @RemoteFileInputStreamParams("file") RemoteFileInputStream remoteFileInputStream,
                                    @RemoteFormParams("creator") String creator);

    /**
     * 上传图片
     *
     * @param server
     * @param accessKey
     * @param accessSecret
     * @param remoteFileInputStream
     * @param creator
     * @return
     */
    @RemotePostMethod("/app/file-center/upload-image")
    FileUploadSuccessDTO uploadImage(@RemoteServerParams String server,
                                     @RemoteHeaderParams("Access-Key") String accessKey,
                                     @RemoteHeaderParams("Access-Secret") String accessSecret,
                                     @RemoteFileInputStreamParams("image") RemoteFileInputStream remoteFileInputStream,
                                     @RemoteFormParams("creator") String creator);

    /**
     * 上传音频
     *
     * @param server
     * @param accessKey
     * @param accessSecret
     * @param remoteFileInputStream
     * @param creator
     * @return
     */
    @RemotePostMethod("/app/file-center/upload-audio")
    FileUploadSuccessDTO uploadAudio(@RemoteServerParams String server,
                                     @RemoteHeaderParams("Access-Key") String accessKey,
                                     @RemoteHeaderParams("Access-Secret") String accessSecret,
                                     @RemoteFileInputStreamParams("audio") RemoteFileInputStream remoteFileInputStream,
                                     @RemoteFormParams("creator") String creator);

    /**
     * 上传视频
     *
     * @param server
     * @param accessKey
     * @param accessSecret
     * @param remoteFileInputStream
     * @param creator
     * @return
     */
    @RemotePostMethod("/app/file-center/upload-video")
    FileUploadSuccessDTO uploadVideo(@RemoteServerParams String server,
                                     @RemoteHeaderParams("Access-Key") String accessKey,
                                     @RemoteHeaderParams("Access-Secret") String accessSecret,
                                     @RemoteFileInputStreamParams("video") RemoteFileInputStream remoteFileInputStream,
                                     @RemoteFormParams("creator") String creator);

}
