class ItemWriteService implements ItemWriteFacade {

    @Override
    public ICResponse<Long> create(ItemCreateRequest request) {
        try {
            if (request == null) {
                throw new IllegalArgumentException("request is null");
            }
            log.info("##create request param:{}", JSON.toJSONString(request));
            ItemParam itemParam = request.getItemParam();
            request.setSellerId(itemParam.getSellerId());
            request.setSellerName(itemParam.getSellerName());
            request.checkParam();
            //todo check request skuNo
            List<ProductDTO> productDTOS = checkProductDump(request);
            if (CollectionUtils.isNotEmpty(productDTOS)) {
                throw new IllegalArgumentException(String.format(" 检查名称/barcode，sku_code是否重复创建，%s", JSON.toJSONString(productDTOS)));
            }
            return itemWriteFacade.create(request);
        } catch (Exception ex) {
            log.error("create ex", ex);
            return ICResponse.fail(ex.getMessage());
        }

    }

}