package org.dromara.zhishu.service.client;

import com.dtflys.forest.annotation.*;
import org.dromara.common.core.domain.R;
import org.dromara.zhishu.domain.dto.response.LogisticsMethodResponse;
import org.dromara.zhishu.domain.dto.request.OrderDeliveryKWRequest;
import org.dromara.zhishu.domain.dto.request.SoldOutRequest;
import org.dromara.zhishu.domain.dto.request.UpdateArtNoRequest;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface KfzClient {

    /**
     * 拉取孔夫子商品
     *
     * @param myURL
     * @param shopId
     * @return
     */
    @Get(value = "{myURL}/api/kfz/synchronizationGoods", dataType = "json")
    Boolean synchronizationGoods(@Var("myURL") String myURL, @Query("shopId") Long shopId, @Query("taskId") Long taskId, @Query("sycFlag") Integer sycFlag);

    /**
     * 更新商品货号
     *
     * @param myURL
     * @param request
     * @return
     */
    @Post(value = "{myURL}/api/kfz/updateArtNo", dataType = "json", contentType = "application/json")
    Boolean updateArtNo(@Var("myURL") String myURL, @Body UpdateArtNoRequest request);

    /**
     * 同步近30天历史存量订单
     *
     * @param myURL
     * @param shopIdList
     * @return
     */
    @Post(value = "{myURL}/api/kfz/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);


    /**
     * 获取物流配送方式
     *
     * @param myURL
     * @param shopId
     * @return
     */
    @Get(value = "{myURL}/api/kfz/order/delivery/methodList", dataType = "json")
    List<LogisticsMethodResponse> deliveryMethodList(@Var("myURL") String myURL, @Query("shopId") Long shopId);


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

    /**
     * 下架商品
     *
     * @param myURL
     * @param request
     * @return
     */
    @Post(value = "{myURL}/api/kfz/soldOut", dataType = "json", contentType = "application/json")
    R<Boolean> soldOut(@Var("myURL") String myURL, @Body SoldOutRequest request);
}
