package cn.cslg.pas.service;

import cn.cslg.pas.common.JsonPage;
import cn.cslg.pas.common.model.dto.ProductQueryPageDTO;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * 产品的Service层接口实现类的测试类
 *
 * @Author chenyu
 * @Date 2023/3/16
 */
@Slf4j
@SpringBootTest
public class ProductServiceImplTests {
    @Autowired
    private IProductService productService;

    @Test
    void query() {
        ProductQueryPageDTO productQueryPageDTO = new ProductQueryPageDTO()
                //.setProductName("手")
                //.setCompanyName("世博")
                //.setProductCategoryId(16)
                .setPatentNo("CN202674151U");
        JsonPage jsonPage = productService.query(productQueryPageDTO);
        List<Object> list = jsonPage.getList();
        log.info("根据专利号查询产品完成，数据信息为：");
        for (Object o : list) {
            log.info("{}", o);
        }
    }


}
