package com.izouma.jiashanxia.service;

import com.izouma.jiashanxia.dto.PageQuery;
import com.izouma.jiashanxia.dto.UserPackageFlowVO;
import com.izouma.jiashanxia.dto.WriteOffSaveVO;
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.SpringRunner;

import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class UserPackageFlowServiceTest {

    @Autowired
    private UserPackageFlowService userPackageFlowService;

    @Test
    public void my() {
        // 810ms 3012ms
        List<UserPackageFlowVO> my = userPackageFlowService.my(2L);
        my.forEach(System.out::println);
    }

    @Test
    public void test() {
        userPackageFlowService.writeOff(WriteOffSaveVO.builder()
                .userId(40L)
                .writeOffUserId(1L)
                .content("[{\"goodsInfoId\":13,\"num\":1}]")
                .build());
    }

    @Test
    public void test1() {
        System.out.println(userPackageFlowService.writeOffAll1(new PageQuery()));
    }
}