package com.wsk.travelf.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wsk.travelf.bean.RoleWithStatus;
import com.wsk.travelf.pojo.Admin;
import com.wsk.travelf.service.AdminService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class TestAdminMapper {

    @Autowired
    private AdminService adminService;

    @Autowired
    private AdminMapper adminMapper;

    @Test
    public void testSelectPage() {
        Page<Admin> page = adminService.findPage(1, 5);

        System.out.println(page);
    }

    @Test
    public void testFindDesc() {
        Admin desc = adminMapper.findDesc(1);

        System.out.println(desc);
    }

    @Test
    public void testFindRoleWithStatus() {
        List<RoleWithStatus> roleWithStatus = adminService.findRoleWithStatus(2);

        roleWithStatus.forEach(System.out::println);
    }

}
