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

import com.schisandra.oss.infra.basic.entity.SchisandraOssUp;
import com.schisandra.oss.infra.basic.dao.SchisandraOssUpDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssUpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 又拍云对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 22:29:27
 */
@Service("SchisandraOssUpService")
public class SchisandraOssUpServiceImpl implements SchisandraOssUpService {

    @Resource
    private SchisandraOssUpDao schisandraOssUpDao;

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

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

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

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


}
