package com.schisandra.oss.infra.basic.service.impl;

import com.schisandra.oss.infra.basic.dao.SchisandraOssTencentDao;
import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent;
import com.schisandra.oss.infra.basic.service.SchisandraOssTencentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 腾讯云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 21:38:56
 */
@Service("SchisandraOssTencentService")
public class SchisandraOssTencentServiceImpl implements SchisandraOssTencentService {

    @Resource
    private SchisandraOssTencentDao schisandraOssTencentDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public SchisandraOssTencent queryById(Long id) {
        return this.schisandraOssTencentDao.selectOneById(id);
    }

    /**
     * 新增数据
     *
     * @param schisandraOssTencent 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(SchisandraOssTencent schisandraOssTencent) {
        return this.schisandraOssTencentDao.insert(schisandraOssTencent,true);
    }

    /**
     * 修改数据
     *
     * @param schisandraOssTencent 实例对象
     * @return 实例对象
     */
    @Override
    public int update(SchisandraOssTencent schisandraOssTencent) {
        return this.schisandraOssTencentDao.update(schisandraOssTencent,true);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.schisandraOssTencentDao.deleteById(id) > 0;
    }


}
