package org.springblade.resource.feign;

import lombok.SneakyThrows;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
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 java.awt.*;
import java.io.InputStream;

/**
 * Created By lidexi in 2021/4/28
 **/
@FeignClient(
	value = AppConstant.APPLICATION_RESOURCE_NAME,
	fallback = IOssEndpointClientFallback.class
)
public interface IOssEndpointClient {

	String API_PREFIX = "/client/oss/endpoint";

	@PostMapping(value = API_PREFIX+"/put-file",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public R<BladeFile> putFile(@RequestPart("file") MultipartFile file);
}
