package com.ly.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.dao.ArticleDao;
import com.ly.dao.BudgetDao;
import com.ly.domain.Article;
import com.ly.domain.Budget;
import com.ly.domain.Course;
import com.ly.service.BudgetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class BudgetServiceImpl extends ServiceImpl<BudgetDao, Budget>  implements BudgetService {

    @Resource
    private BudgetDao budgetDao;

    @Override
    public Page<Budget> findPage(Page<Budget> page, String name) {
      return   budgetDao.findPage(page, name);
    }

    @Override
    public void setArticleBudget(Integer budgetId, Integer articleId) {
        budgetDao.deleteArticleBudget(budgetId, articleId);
        budgetDao.setArticleBudget(budgetId, articleId);
    }
}
