package com.wms_main.dao.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wms_main.dao.ITSysMenuService;
import com.wms_main.mapper.SysMenuMapper;
import com.wms_main.model.po.TSysMenu;
import com.wms_main.repository.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * Menu服务实现
 */
@Service
@RequiredArgsConstructor
public class TSysMenuServiceImpl extends ServiceImpl<SysMenuMapper, TSysMenu> implements ITSysMenuService {
    private final SysMenuMapper sysMenuMapper;

    /**
     * 实现
     * @param roleId 角色id
     * @return 查询结果
     */
    @Override
    public List<TSysMenu> selMenuByRoleId(String roleId) {
        if (StringUtils.isEmpty(roleId)) {
            return Collections.emptyList();
        }
        return sysMenuMapper.selMenuByRoleId(roleId);
    }
}
