package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallAboutPrivacyMapper;
import com.ruoyi.mall.domain.MallAboutPrivacy;
import com.ruoyi.mall.service.IMallAboutPrivacyService;

import javax.annotation.Resource;

/**
 * 关于我们、隐私Service业务层处理
 *
 * @author LCL
 * @date 2024-03-11
 */
@Service
public class MallAboutPrivacyServiceImpl implements IMallAboutPrivacyService
{
    @Resource
    private MallAboutPrivacyMapper mallAboutPrivacyMapper;

    /**
     * 查询关于我们、隐私
     *
     * @param id 关于我们、隐私主键
     * @return 关于我们、隐私
     */
    @Override
    public MallAboutPrivacy selectMallAboutPrivacyById(Long id)
    {
        return mallAboutPrivacyMapper.selectMallAboutPrivacyById(id);
    }

    /**
     * 查询关于我们、隐私列表
     *
     * @param mallAboutPrivacy 关于我们、隐私
     * @return 关于我们、隐私
     */
    @Override
    public List<MallAboutPrivacy> selectMallAboutPrivacyList(MallAboutPrivacy mallAboutPrivacy)
    {
        return mallAboutPrivacyMapper.selectMallAboutPrivacyList(mallAboutPrivacy);
    }

    /**
     * 新增关于我们、隐私
     *
     * @param mallAboutPrivacy 关于我们、隐私
     * @return 结果
     */
    @Override
    public int insertMallAboutPrivacy(MallAboutPrivacy mallAboutPrivacy)
    {
        mallAboutPrivacy.setCreateAt(DateUtils.getTime());
        return mallAboutPrivacyMapper.insertMallAboutPrivacy(mallAboutPrivacy);
    }

    /**
     * 修改关于我们、隐私
     *
     * @param mallAboutPrivacy 关于我们、隐私
     * @return 结果
     */
    @Override
    public int updateMallAboutPrivacy(MallAboutPrivacy mallAboutPrivacy)
    {
        mallAboutPrivacy.setUpdateAt(DateUtils.getTime());
        return mallAboutPrivacyMapper.updateMallAboutPrivacy(mallAboutPrivacy);
    }

    /**
     * 批量删除关于我们、隐私
     *
     * @param ids 需要删除的关于我们、隐私主键
     * @return 结果
     */
    @Override
    public int deleteMallAboutPrivacyByIds(Long[] ids)
    {
        return mallAboutPrivacyMapper.deleteMallAboutPrivacyByIds(ids);
    }

    /**
     * 删除关于我们、隐私信息
     *
     * @param id 关于我们、隐私主键
     * @return 结果
     */
    @Override
    public int deleteMallAboutPrivacyById(Long id)
    {
        return mallAboutPrivacyMapper.deleteMallAboutPrivacyById(id);
    }
}
