package com.bc.exam.modules.config.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bc.exam.core.utils.BeanMapper;
import com.bc.exam.modules.config.dto.SysConfigDTO;
import com.bc.exam.modules.config.entity.SysConfig;
import com.bc.exam.modules.config.mapper.SysConfigMapper;
import com.bc.exam.modules.config.service.SysConfigService;
import org.springframework.stereotype.Service;


/**
 * @Description 描述:语言设置 服务实现类
 * @Author A贾宇婷034244310
 * @Date 20260615
 */
@Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService {

    @Override
    public SysConfigDTO find() {

        QueryWrapper<SysConfig> wrapper = new QueryWrapper<>();
        wrapper.last(" LIMIT 1");

        SysConfig entity = this.getOne(wrapper, false);
        SysConfigDTO dto = new SysConfigDTO();
        BeanMapper.copy(entity, dto);
        return dto;
    }
}
