package com.izouma.jiashanxia.service;

import com.izouma.jiashanxia.domain.CommissionRecord;
import com.izouma.jiashanxia.dto.CommissionRecordDTO;
import com.izouma.jiashanxia.dto.PageQuery;
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;
import java.util.Map;


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

    @Autowired
    private CommissionRecordService commissionRecordService;

    @Test
    public void my() {
        List<CommissionRecordDTO> my = commissionRecordService.my(497L);
        my.forEach(System.out::println);
    }

    @Test
    public void test() {
        PageQuery pageQuery = new PageQuery();
        Map<String, Object> query = pageQuery.getQuery();
        query.put("transactionType", "REFUND");
        List<CommissionRecord> content = commissionRecordService.backAll2(pageQuery).getContent();
        content.forEach(System.out::println);
    }
}