package cn.iocoder.yudao.module.system.api.dish;


import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.dish.dto.DishExcelDto;
import cn.iocoder.yudao.module.system.api.dish.dto.DishesRespDto;
import cn.iocoder.yudao.module.system.dal.dataobject.dishes.DishesDO;
import cn.iocoder.yudao.module.system.service.dishes.DishesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 菜品营养 Service 接口
 *
 * @author 开发账号
 */
@Service
public class DishesApiImpl implements DishesApi {

    @Resource
    private DishesService dishesService;

    @Override
    public DishesRespDto getDish(Long id) {
        DishesDO dishes = dishesService.getDishes(id);
        return BeanUtils.toBean(dishes,DishesRespDto.class);
    }

    @Override
    public Map<Long, String> getDishName(List<Long> ids) {
        return dishesService.getDishName(ids);
    }

    @Override
    public List<DishesRespDto> getDishInfo(List<Long> ids) {
        List<DishesDO> dishesList = dishesService.getDishesList(ids);
        return  BeanUtils.toBean(dishesList, DishesRespDto.class);
    }

    @Override
    public void exportDish(List<DishExcelDto> dishExcels,Long storeId) {
        dishesService.exportDish(dishExcels,storeId);
    }
}