package com.zhyc.module.app.service.impl;

import java.util.List;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.module.app.domain.AppSettings;
import com.zhyc.module.app.mapper.AppSettingsMapper;
import com.zhyc.module.app.service.IAppSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 应用设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2026-01-20
 */
@Service
public class AppSettingsServiceImpl implements IAppSettingsService
{
    @Autowired
    private AppSettingsMapper appSettingsMapper;

    /**
     * 查询应用设置
     * 
     * @param id 应用设置主键
     * @return 应用设置
     */
    @Override
    public AppSettings selectAppSettingsById(Long id)
    {
        return appSettingsMapper.selectAppSettingsById(id);
    }

    /**
     * 查询应用设置列表
     * 
     * @param appSettings 应用设置
     * @return 应用设置
     */
    @Override
    public List<AppSettings> selectAppSettingsList(AppSettings appSettings)
    {
        return appSettingsMapper.selectAppSettingsList(appSettings);
    }

    /**
     * 新增应用设置
     * 
     * @param appSettings 应用设置
     * @return 结果
     */
    @Override
    public int insertAppSettings(AppSettings appSettings)
    {
        appSettings.setCreateTime(DateUtils.getNowDate());
        return appSettingsMapper.insertAppSettings(appSettings);
    }

    /**
     * 修改应用设置
     * 
     * @param appSettings 应用设置
     * @return 结果
     */
    @Override
    public int updateAppSettings(AppSettings appSettings)
    {
        appSettings.setUpdateTime(DateUtils.getNowDate());
        return appSettingsMapper.updateAppSettings(appSettings);
    }

    /**
     * 批量删除应用设置
     * 
     * @param ids 需要删除的应用设置主键
     * @return 结果
     */
    @Override
    public int deleteAppSettingsByIds(Long[] ids)
    {
        return appSettingsMapper.deleteAppSettingsByIds(ids);
    }

    /**
     * 删除应用设置信息
     * 
     * @param id 应用设置主键
     * @return 结果
     */
    @Override
    public int deleteAppSettingsById(Long id)
    {
        return appSettingsMapper.deleteAppSettingsById(id);
    }
}
