package com.wms.service.serviceImplements;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wms.entity.app.dto.MenuDto;
import com.wms.entity.table.Menu;
import com.wms.mapper.MenuMapper;
import com.wms.service.MenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class MenuServiceImplements extends ServiceImpl<MenuMapper, Menu> implements MenuService {
    private final MenuMapper menuMapper;

    @Override
    public List<MenuDto> selMenuByRoleId(int roleId) {
        return BeanUtil.copyToList(menuMapper.selMenuByRoleId(roleId), MenuDto.class);
    }
}
