/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.etl.service.bi;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.etl.entity.bi.ReportDatasource;
import org.springblade.etl.mapper.ReportDatasourceMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**ReportDatasource
 * 报表数据源 服务实现类
 *
 * @author BladeX
 * @since 2021-03-22
 */
@Service
public class ReportDatasourceService extends ServiceImpl<ReportDatasourceMapper, ReportDatasource> {

    public List<ReportDatasource> listDo() {

        return baseMapper.getList();
    }

    private static String getMessage() {
        return "bi 相关方法已禁用,走使用 rpc 接口!";
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveOrUpdate(ReportDatasource entity) {
        throw new RuntimeException(getMessage());
    }

    /**
     * 批量插入
     *
     * @param entityList ignore
     * @param batchSize  ignore
     * @return ignore
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveBatch(Collection<ReportDatasource> entityList, int batchSize) {
        throw new RuntimeException(getMessage());
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveOrUpdateBatch(Collection<ReportDatasource> entityList, int batchSize) {
        throw new RuntimeException(getMessage());
    }

    @Override
    public boolean removeById(Serializable id) {
        throw new RuntimeException(getMessage());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean removeByIds(Collection<?> list) {
        throw new RuntimeException(getMessage());
    }

    @Override
    public boolean removeById(Serializable id, boolean useFill) {
        throw new RuntimeException(getMessage());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean removeBatchByIds(Collection<?> list, int batchSize) {
        throw new RuntimeException(getMessage());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean removeBatchByIds(Collection<?> list, int batchSize, boolean useFill) {
        throw new RuntimeException(getMessage());
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean updateBatchById(Collection<ReportDatasource> entityList, int batchSize) {
        throw new RuntimeException(getMessage());
    }
}
