package com.ruoyi;

import com.ruoyi.web.work.domain.Notice;
import com.ruoyi.web.work.domain.Relate;
import com.ruoyi.web.work.service.INoticeService;
import com.ruoyi.web.work.service.IRelateService;
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 org.springframework.transaction.annotation.Transactional;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = RuoYiApplication.class)
public class user {

    @Autowired
    private IRelateService relateService;

    @Autowired
    private INoticeService noticeService;

    @Test
    @Transactional
    public void aa() {
        Relate relate = new Relate();
        relateService.updateById(relate);

        Notice notice = new Notice();
        notice.setTitle("高韦神");
        notice.setState(0);
        notice.setContents("高韦神");
        noticeService.save(notice);

        System.out.println("操作成功");
    }
}
