package com.cool.store.service.dict.impl;

import com.cool.store.dao.dict.SysDictColumnDAO;
import com.cool.store.dao.dict.SysDictTableDAO;
import com.cool.store.entity.dict.SysDictTableDO;
import com.cool.store.request.dict.DictTableQueryRequest;
import com.cool.store.service.dict.DictTableInfoService;
import com.cool.store.utils.BeanUtil;
import com.cool.store.vo.dict.DictTableVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典表 实现类
 * </p>
 *
 * @author wangff
 * @since 2025/2/20
 */
@Service
@RequiredArgsConstructor
public class DictTableInfoServiceImpl implements DictTableInfoService {
    private final SysDictTableDAO dictTableInfoDAO;
    private final SysDictColumnDAO columnInfoDAO;


    @Override
    public DictTableVO getById(Long id) {
        SysDictTableDO table = dictTableInfoDAO.getById(id);
        return BeanUtil.toBean(table, DictTableVO.class);
    }

    @Override
    public List<DictTableVO> getList(DictTableQueryRequest dto) {
        List<SysDictTableDO> list = dictTableInfoDAO.getList(dto);
        return BeanUtil.toList(list, DictTableVO.class);
    }
}
