package org.dromara.zhishu.service.client;

import com.dtflys.forest.annotation.*;
import org.dromara.common.core.domain.R;
import org.dromara.zhishu.domain.dto.request.*;
import org.dromara.zhishu.domain.dto.response.GoodsSaleStatusSetResponse;
import org.dromara.zhishu.domain.dto.response.LogisticsMethodResponse;
import org.dromara.zhishu.domain.dto.response.UpdateSkuPriceResponse;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Service
public interface PddClient {

    /**
     * 查询物流公司列表
     *
     * @param myURL
     * @return
     */
    @Get(value = "{myURL}/api/pdd/order/delivery/methodList", dataType = "json")
    List<LogisticsMethodResponse> deliveryMethodList(@Var("myURL") String myURL);

    /**
     * 订单发货
     *
     * @param myURL
     * @param request
     * @return
     */
    @Post(value = "{myURL}/api/pdd/order/deliver", dataType = "json", contentType = "application/json")
    R<Boolean> orderDelivery(@Var("myURL") String myURL, @Body OrderDeliveryPddRequest request);


    /**
     * 同步90天存量订单
     */
    @Post(value = "{myURL}/api/pdd/order/fullSynchronizationOrder", dataType = "json", contentType = "application/json")
    String fullSynchronizationOrder(@Var("myURL") String myURL, @Query("days") Integer days, @Query("type") String type, @Body List<Long> shopIdList);

    /**
     * 设置商品上下架状态
     */
    @Post(value = "{myURL}/api/pdd/goods/goodsSaleStatusSet", dataType = "json", contentType = "application/json")
    R<Boolean> goodsSaleStatusSet(@Var("myURL") String myURL, @Body GoodsSaleStatusSetBatchRequest request);

    /**
     * 设置单个商品上下架状态
     */
    @Post(value = "{myURL}/api/pdd/goods/goodsSaleStatusSetSingle", dataType = "json", contentType = "application/json")
    R<Boolean> goodsSaleStatusSetSingle(@Var("myURL") String myURL, @Body GoodsSaleStatusSetRequest request);

    /**
     * 修改商品sku价格
     */
    @Post(value = "{myURL}/api/pdd/goods/updateSkuPrice", dataType = "json", contentType = "application/json")
    R<Boolean> updateSkuPrice(@Var("myURL") String myURL, @Body UpdateSkuPriceRequest request);

    /**
     * 修改商品sku价格
     */
    @Post(value = "{myURL}/api/pdd/goods/deleteSaleOutGoodsBatch", dataType = "json", contentType = "application/json")
    R<Boolean> deleteSaleOutGoodsBatch(@Var("myURL") String myURL, @Body DeleteSaleOutGoodsBatchRequest request);
}
