package com.lightinit.hsdataportal.impl;

import com.lightinit.hsdataportal.entity.BaseExample;
import com.lightinit.hsdataportal.mapper.NewsMapper;
import com.lightinit.hsdataportal.model.EntrepreneurshipTutoringListModel;
import com.lightinit.hsdataportal.model.EntrepreneurshipTutoringSearchModel;
import com.lightinit.hsdataportal.model.EntrepreneurshipTutoringViewModel;
import com.lightinit.hsdataportal.service.IEntrepreneurshipTutoringService;
import com.lightinit.hsdataportal.spring.DynamicDataContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EntrepreneurshipTutoringServiceImpl implements IEntrepreneurshipTutoringService {
    @Autowired
   private NewsMapper newsMapper;
    @Override
    public List<EntrepreneurshipTutoringListModel> selectList(EntrepreneurshipTutoringSearchModel inputModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return newsMapper.selectList(inputModel);
    }

    @Override
    public long selectCount(EntrepreneurshipTutoringSearchModel inputModel) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return newsMapper.selectCount(inputModel);
    }

    @Override
    public EntrepreneurshipTutoringViewModel view(long id) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return newsMapper.view(id);
    }
}
