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

import com.schisandra.oss.infra.basic.entity.SchisandraOssBaidu;
import com.schisandra.oss.infra.basic.dao.SchisandraOssBaiduDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssBaiduService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 百度云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:02:15
 */
@Service("SchisandraOssBaiduService")
public class SchisandraOssBaiduServiceImpl implements SchisandraOssBaiduService {

    @Resource
    private SchisandraOssBaiduDao schisandraOssBaiduDao;

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

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

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

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


}
