package com.yonge.cooleshow.api.feign;

import com.yonge.cooleshow.api.feign.dto.OmsOrderDetail;
import com.yonge.cooleshow.api.feign.enums.CheckStatus;
import com.yonge.cooleshow.api.feign.fallback.MallPortalFeignServiceFallback;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import com.yonge.toolset.feign.config.FeignConfiguration;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;
import java.util.Set;

@FeignClient(name = "${app-config.open-feign.mall-portal-server.name:mall-portal-server}", url = "${app-config.open-feign.mall-portal-server.url:}",
        configuration = FeignConfiguration.class, fallback = MallPortalFeignServiceFallback.class)
public interface MallPortalFeignService {

    /**
     * 订单轮询
     */
    @GetMapping("/task/cancelTimeOutOrder")
    Object cancelTimeOutOrder();

    /**
     * 自动收货
     */
    @GetMapping("/task/autoReceive")
    HttpResponseResult autoReceive();


    /**
     * 收货多少天后分润
     */
    @GetMapping("/task/shareProfit")
    HttpResponseResult shareProfit();


    @GetMapping("/order/queryOrderList")
    HttpResponseResult<List<OmsOrderDetail>> queryOrderList(@RequestParam("status") String status,
                                                            @RequestParam("userId") Long userId);

    @GetMapping("/order/checkOrderStatus")
    HttpResponseResult<Map<String, Set<CheckStatus>>> checkOrderStatus(@RequestParam("userId") Long userId);
}
