package com.sooka.sponest.monitor.remoteapi.service.center.file;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysFile;
import com.sooka.sponest.monitor.remoteapi.fallback.center.file.RemoteFileServiceFallbackFactory;
import com.sooka.sponest.monitor.remoteapi.service.ModulesServiceNameContants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(contextId = "remoteFileBaseService", value = ModulesServiceNameContants.CENTER_FILE,
        fallbackFactory = RemoteFileServiceFallbackFactory.class)
public interface RemoteFileBaseService {

    /**
     * 文件上传请求
     */
    @PostMapping(value = "/upload", headers = "content-type=" + MediaType.MULTIPART_FORM_DATA_VALUE)
    R<SysFile> upload(@RequestPart("file") MultipartFile file);
}
