package com.ruoyi.ss.toilet.service.impl;

import com.ruoyi.ss.device.service.DeviceService;
import com.ruoyi.ss.toilet.domain.ToiletVO;
import com.ruoyi.ss.toilet.service.IToiletAssembler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 卫生间Service业务层处理
 *
 * @author qzz
 * @date 2025-01-07
 */
@Service
public class ToiletAssembler implements IToiletAssembler
{

    @Autowired
    private DeviceService deviceService;

    @Override
    public void assembleDevice(List<ToiletVO> list) {
        if (list == null || list.isEmpty()) {
            return;
        }

        for (ToiletVO toiletVO : list) {
            toiletVO.setDevice(deviceService.selectById(toiletVO.getDeviceId()));
        }
    }
}
