package com.qnfhq.modules.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qnfhq.common.service.impl.BaseServiceImpl;
import com.qnfhq.modules.user.dao.SettingDao;
import com.qnfhq.modules.user.entity.SettingEntity;
import com.qnfhq.modules.user.service.SettingService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 配置(短信邮箱等)
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-13
 */
@Service
public class SettingServiceImpl extends BaseServiceImpl<SettingDao, SettingEntity> implements SettingService {


    public QueryWrapper<SettingEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<SettingEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }

    @Override
    public SettingEntity getSetting(String id){
        return baseDao.selectById(id);
    }

}