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

import com.schisandra.oss.infra.basic.entity.SchisandraOssQiniu;
import com.schisandra.oss.infra.basic.dao.SchisandraOssQiniuDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssQiniuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 七牛云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:25:11
 */
@Service("SchisandraOssQiniuService")
public class SchisandraOssQiniuServiceImpl implements SchisandraOssQiniuService {

    @Resource
    private SchisandraOssQiniuDao schisandraOssQiniuDao;

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

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

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

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


}
