package com.jwipc.inquiry.logic.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jwipc.inquiry.convert.InquiryApproveConvert;
import com.jwipc.inquiry.dto.InquiryApproveDTO;
import com.jwipc.inquiry.entity.InquiryApprove;
import com.jwipc.inquiry.logic.InquiryApproveLogic;
import com.jwipc.inquiry.service.IInquiryApproveService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/4/30 12:27
 * @desc
 */
@Service
@RequiredArgsConstructor
public class InquiryApproveLogicImpl implements InquiryApproveLogic {
    private final IInquiryApproveService inquiryApproveService;
    private final InquiryApproveConvert inquiryApproveConvert;
    @Override
    public List<InquiryApproveDTO> list(Long inquiryId) {
        List<InquiryApprove> inquiryApproves = inquiryApproveService.list(Wrappers.lambdaQuery(InquiryApprove.class).eq(InquiryApprove::getInquiryId,inquiryId));
        return inquiryApproveConvert.entity2DtoList(inquiryApproves);
    }
}
