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

import com.schisandra.oss.infra.basic.entity.SchisandraOssAws;
import com.schisandra.oss.infra.basic.dao.SchisandraOssAwsDao;
import com.schisandra.oss.infra.basic.service.SchisandraOssAwsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 亚马逊对象存储配置表 表服务实现类
 *
 * @author landaiqing
 * @since 2024-06-02 21:48:16
 */
@Service("SchisandraOssAwsService")
public class SchisandraOssAwsServiceImpl implements SchisandraOssAwsService {

    @Resource
    private SchisandraOssAwsDao schisandraOssAwsDao;

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

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

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

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


}
