package com.hzs.ground.product.provider;

import cn.hutool.core.bean.BeanUtil;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.product.BdProductBas;
import com.hzs.ground.product.service.IBdProductBasService;
import com.hzs.scm.product.IProductBasServiceApi;
import com.hzs.scm.product.dto.ProductBasDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@DubboService
public class IProductBasServiceProvider implements IProductBasServiceApi {

    @Autowired
    private IBdProductBasService productBasService;

    /**
     * 根据id 查询
     *
     * @return
     */
    @Override
    public R<ProductBasDTO> getProductBasById(Integer pkId) {
        BdProductBas productBas = productBasService.getProductBasById(pkId);
        return R.ok(BeanUtil.copyProperties(productBas, ProductBasDTO.class));
    }

}
