package sgc.portal.com.sym.mnu.service;

import sgc.portal.base.model.Yfvrprg;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.security.model.Authority;
import sgc.portal.com.sym.mnu.persistence.MenuMapper;
import sgc.portal.com.sym.user.model.UserDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * The type Menu service.
 */
@Service
@Transactional
public class MenuService {
    @Autowired
    private MenuMapper menuMapper;

    /**
     * Select menu list list.
     *
     * @param authorities the authorities
     * @param topMenu     the top menu
     * @param prgNm       the prg nm
     * @return the list
     */
    public List<EasyHashMap<String, Object>> selectMenuListKo(List<Authority> authorities, String topMenu, String prgNm) {
        return menuMapper.selectMenuListKo(authorities, topMenu, prgNm);
    }
    
    public List<EasyHashMap<String, Object>> selectMenuListEn(List<Authority> authorities, String topMenu, String prgNm) {
        return menuMapper.selectMenuListEn(authorities, topMenu, prgNm);
    }

    /**
     * Select top menu list list.
     *
     * @param userDetails the user details
     * @return the list
     */
    public List<EasyHashMap<String, Object>> selectTopMenuListKo(UserDetails userDetails) {
        return menuMapper.selectTopMenuListKo(userDetails);
    }
    
    public List<EasyHashMap<String, Object>> selectTopMenuListEn(UserDetails userDetails) {
        return menuMapper.selectTopMenuListEn(userDetails);
    }

    /**
     * Select bock menu list list.
     *
     * @param yfvrprgs the yfvrprgs
     * @return the list
     */
//즐겨찾기
    public List<EasyHashMap<String, Object>> selectBockMenuList(Yfvrprg yfvrprgs) {
        return menuMapper.selectBockMenuList(yfvrprgs);
    }

    /**
     * Select menu list list.
     *
     * @param authorities the authorities
     * @param topMenu     the top menu
     * @param prgNm       the prg nm
     * @return the list
     */
    public List<EasyHashMap<String, Object>> selectMenuAsListKo(List<Authority> authorities, String topMenu, String prgNm) {
        return menuMapper.selectMenuAsListKo(authorities, topMenu, prgNm);
    }
    
    public List<EasyHashMap<String, Object>> selectMenuAsListEn(List<Authority> authorities, String topMenu, String prgNm) {
        return menuMapper.selectMenuAsListEn(authorities, topMenu, prgNm);
    }

    /**
     * Select top menu list list.
     *
     * @param userDetails the user details
     * @return the list
     */
    public List<EasyHashMap<String, Object>> selectTopMenuAsListKo(UserDetails userDetails) {
        return menuMapper.selectTopMenuAsListKo(userDetails);
    }
    
    public List<EasyHashMap<String, Object>> selectTopMenuAsListEn(UserDetails userDetails) {
        return menuMapper.selectTopMenuAsListEn(userDetails);
    }
    
}