package com.cool.store.dao.menu;

import com.cool.store.entity.menu.MiniMenuConfigDO;
import com.cool.store.mapper.menu.MiniMenuConfigMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 小程序菜单配置
 * </p>
 *
 * @author wangff
 * @since 2025/10/31
 */
@Repository
@RequiredArgsConstructor
public class MiniMenuConfigDAO {
    private final MiniMenuConfigMapper miniMenuConfigMapper;

    /**
     * 根据角色id查询
     * @param roleId 角色id
     * @return 菜单配置列表
     */
    public List<MiniMenuConfigDO> getListByRoleId(Long roleId) {
        return miniMenuConfigMapper.select(MiniMenuConfigDO.builder().roleId(roleId).build());
    }
}
