package shop.alien.storeplatform.feign;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
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;

@FeignClient(url = "${feign.alienStore.url}", name = "alien-store")
public interface AlienStoreFeign {

    @GetMapping("/websocket/sendMsgToClientByPhoneId")
    JSONObject sendMsgToClientByPhoneId(
            @RequestParam(value = "messageReceiverId") String messageReceiverId,
            @RequestParam(value = "webSocketVoStr") String webSocketVoStr);

    @PostMapping(value = "/file/uploadMore", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    JSONObject uploadFile(@RequestPart("multipartRequest") MultipartFile multipartRequest);

}
