package com.izouma.dingdong.contorller;

import com.izouma.dingdong.domain.MoneyRecord;
import com.izouma.dingdong.dto.PageQuery;
import com.izouma.dingdong.enums.FinancialType;
import com.izouma.dingdong.web.MoneyRecordController;
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.HashMap;
import java.util.Map;

@SpringBootTest
@RunWith(SpringRunner.class)
public class MoneyRecordTest {
    @Autowired
    private MoneyRecordController moneyRecordController;

    @Test
    public void test(){
        PageQuery pageQuery = new PageQuery();
        pageQuery.setPage(0);
        pageQuery.setSize(50);
        pageQuery.setSearch(null);
        pageQuery.setSort("");
        Map<String,Object> map = new HashMap<>();
//        map.put("time","2020-05-14 00:00:00,2020-05-14 13:59:59");
        map.put("type", FinancialType.INCOME);
        pageQuery.setQuery(map);

        System.out.println(moneyRecordController.my(pageQuery));
    }
}
