package cn.ibizlab.core.extensions.service;

import cn.ibizlab.core.analysis.service.impl.DAChartServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.analysis.domain.DAChart;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;

/**
 * 实体[图表] 自定义服务对象
 */
@Slf4j
@Primary
@Service("DAChartExService")
public class DAChartExService extends DAChartServiceImpl {

    @Override
    protected Class currentModelClass() {
        return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
    }

    /**
     * [Build:build] 行为扩展
     * @param et
     * @return
     */
    @Override
    @Transactional
    public DAChart build(DAChart et) {
        return super.build(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public boolean update(DAChart et) {
        return super.update(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public void updateBatch(List<DAChart> list) {
        super.updateBatch(list);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public boolean save(DAChart et) {
        return super.save(et);
    }

    @Caching( evict = {
            @CacheEvict( value="dataAnalyse",allEntries = true)
    })
    @Override
    public void saveBatch(List<DAChart> list) {
        super.saveBatch(list);
    }
}

