package com.dcsoft.system.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import com.dcsoft.common.core.constant.ServiceNameConstants;
import com.dcsoft.common.core.domain.R;
import com.dcsoft.system.api.domain.SysFile;
import com.dcsoft.system.api.factory.RemoteFileFallbackFactory;

/**
 * 文件服务
 *
 * @author dcsoft
 */
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteFileService
{
    /**
     * 上传文件
     *
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);

    /**
     * 上传文件
     *
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/uploadMinio", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> uploadMinio(@RequestPart(value = "file") MultipartFile file,@RequestPart(value = "fileName")  String fileName);

    /**
     * 上传文件
     *
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/uploadMinio1", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> uploadMinio1(@RequestPart(value = "file") MultipartFile file,@RequestPart(value = "fileName")  String fileName);

    /**
     * 上传文件
     *
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/uploadMinioPDF", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> uploadMinioPDF(@RequestPart(value = "file") MultipartFile file,@RequestPart(value = "fileName")  String fileName);

    /**
     * 上传文件
     *
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/uploadMinios", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> uploadMinios(@RequestPart(value = "file") MultipartFile file,@RequestPart(value = "fileName")  String fileName);


    @PostMapping(value = "/uploadMinioCar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<SysFile> uploadMinioCar(@RequestPart(value = "file") MultipartFile file);
}
