package com.bonus.sgzb.app.mapper;

import com.bonus.sgzb.app.domain.AppMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author c liu
 * @date 2024/1/17
 */
@Mapper
public interface AppMenuMapper {
    /**
     * 获取所有按钮
     * @return
     */
    List<AppMenu> getAllMenu();

    /**
     * 根据用户id获取按钮
     * @param userId
     * @return
     */
    List<AppMenu> getMenuById(Long userId);

    /**
     * 为用户id添加按钮
     * @param appMenuId
     * @param userId
     * @return
     */
    int addMenuById(@Param("appMenuId") Long appMenuId,@Param("userId") Long userId);

    /**
     * 为用户id删除按钮
     * @param appMenuId
     * @param userId
     * @return
     */
    int delMenuById(@Param("appMenuId") Long appMenuId, @Param("userId")Long userId);
}
