package com.sckw.file.api.feign;

import com.sckw.core.web.response.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author lfdc
 * @version 1.0
 * @className FileApiFeignService
 * @description 定义oss文件Feign
 * @company sckw
 * @date 2023-06-06 10:06:06
 */
//name：调⽤的服务名称，和服务提供者yml⽂件中spring.application.name保持⼀致
//path: 定义当前FeignClient的统一前缀 ,path = "/file",url = "http://127.0.0.1:10050"
//url: 定义当前FeignClient调用地址
@FeignClient(name = "sckw-file")
public interface FileApiFeignService {

    /**
     * 上传文件至OSS
     * @param file
     * @return
     */
//   @RequestMapping(value = "/file/fileFeignUpload",method = RequestMethod.POST)
    @PostMapping("/file/fileFeignUpload")
    public HttpResult fileFeignUpload(@RequestParam("file") MultipartFile file) ;

    /**
     * file-demo
     * @param userName
     * @return
     */
//    @RequestMapping(value = "/fileFeignUpload",method = RequestMethod.POST)
    @GetMapping(value = "/file/fileFeignDemo")
    public String fileFeignDemo(@RequestParam("userName") String userName) ;


    @RequestMapping(value = "/file/fileFeignDemo1",method = RequestMethod.POST)
    String fileFeignDemo1( Map<String, String> map);
}
