package org.dromara.zhishu.service.client;

import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.Header;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Var;
import com.dtflys.forest.converter.json.JacksonEncoder;
import org.dromara.zhishu.domain.dto.request.ErpBaseShopPageGetRequest;
import org.dromara.zhishu.domain.dto.request.ErpGoodsQueryOlnGoodsRequest;
import org.dromara.zhishu.domain.dto.request.ErpGoodsUpdateItemRequest;
import org.dromara.zhishu.domain.dto.response.ErpBaseShopPageGetResponse;
import org.dromara.zhishu.domain.dto.response.ErpGoodsQueryOlnGoodsResponse;
import org.dromara.zhishu.domain.dto.response.WlnBaseResponse;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface WlnClient {

    /**
     * 查询店铺
     *
     * @param myURL
     * @param request
     * @return
     */
    @JacksonEncoder
    @Post(value = "{myURL}/api/erpBaseShopPageGet", dataType = "json", contentType = "application/json")
    WlnBaseResponse<List<ErpBaseShopPageGetResponse>> erpBaseShopPageGet(@Var("myURL") String myURL, @Header("appKey") String appKey, @Header("appSecret") String appSecret, @Body ErpBaseShopPageGetRequest request);

    /**
     * 查询线上商品
     *
     * @param myURL
     * @param request
     * @return
     */
    @JacksonEncoder
    @Post(value = "{myURL}/api/erpGoodsQueryOlngoods", dataType = "json", contentType = "application/json")
    WlnBaseResponse<ErpGoodsQueryOlnGoodsResponse> erpGoodsQueryOlnGoods(@Var("myURL") String myURL, @Header("appKey") String appKey, @Header("appSecret") String appSecret, @Body ErpGoodsQueryOlnGoodsRequest request);

    /**
     * 修改商品
     *
     * @param myURL
     * @param request
     * @return
     */
    @JacksonEncoder
    @Post(value = "{myURL}/api/erpGoodsUpdateItem", dataType = "json", contentType = "application/json")
    WlnBaseResponse<Boolean> erpGoodsUpdateItem(@Var("myURL") String myURL, @Header("appKey") String appKey, @Header("appSecret") String appSecret, @Body ErpGoodsUpdateItemRequest request);

}
