package com.pcloud.book.test;

import com.pcloud.book.BookApplication;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dao.BookGroupServeDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.vo.BookGroupServeCountVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {BookApplication.class})
public class SlowSQLTest {


    @Autowired
    private BookGroupServeDao bookGroupServeDao;
    @Autowired
    private BookGroupDao bookGroupDao;

    @Test
    public void testBookGroupServeDao(){
        List<Long> bookIds = new ArrayList<>();
        bookIds.add(4L);
        bookIds.add(5L);
        List<BookGroupServeCountVO> serveList4Applet = bookGroupServeDao.getServeList4Applet(bookIds);
        List<BookGroupServeCountVO> serveList4Applet1 = bookGroupServeDao.getServeList4Applet(getTestBookIdList());
        System.out.println(1);
    }

    @Test
    public void testGetDTOByIds(){
        List<BookGroupDTO> dtoByIds = bookGroupDao.getDTOByIds(getTestBookIdList());
    }


    public static List<Long>getTestBookIdList(){
        return TestBookList.getBookIdList();
    }



}
