package com.ruoyi;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.system.domain.md.query.QueryPage;
import com.ruoyi.system.domain.md.request.NewMsgQuery;
import com.ruoyi.system.domain.task.utils.WorkMSGUtils;
import com.ruoyi.system.service.md.NewMsgService;
import org.assertj.core.util.Lists;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author vidar
 * date 2024/6/19
 * description
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class WorkMsgTest {
    @Resource
    private NewMsgService msgService;
    @Resource
    private WorkMSGUtils workMSGUtils;

    @Test
    public void sendTest(){
        workMSGUtils.sendMsg("2","ruoyi", Lists.newArrayList("1"),"谢宁远大帅哥",1,"1");
    }

    @Test
    public void pageTest(){
        NewMsgQuery query = new NewMsgQuery();
        query.setToUserid("1");
        IPage<Map<String,Object>> page = msgService.queryUnion(query,new QueryPage());
        System.out.println(1);
    }

    @Test
    public void msgDetail(){
        String id = "0_baaeba6b-0d35-40bf-8624-31dc23515af7";
        Map<String,Object> map = msgService.getInboxDetail4Map(id);
        System.out.println(1);
    }
}
