package com.jwipc.inquiry.logic.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.inquiry.convert.InquiryTemplateConvert;
import com.jwipc.inquiry.dto.InquiryTemplateDTO;
import com.jwipc.inquiry.dto.InquiryTemplateFieldDTO;
import com.jwipc.inquiry.entity.InquiryTemplate;
import com.jwipc.inquiry.entity.InquiryTemplateField;
import com.jwipc.inquiry.logic.InquiryTemplateFieldLogic;
import com.jwipc.inquiry.model.po.InquiryTemplateFieldPO;
import com.jwipc.inquiry.model.po.InquiryTemplatePO;
import com.jwipc.inquiry.model.query.InquiryTemplateFieldQuery;
import com.jwipc.inquiry.service.IInquiryTemplateFieldService;
import com.jwipc.page.PageUtil;
import com.jwipc.page.PageView;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/2/18 9:58
 * @desc
 */
@Service
@RequiredArgsConstructor
public class InquiryTemplateFieldLogicImpl implements InquiryTemplateFieldLogic {
    private final IInquiryTemplateFieldService inquiryTemplateFieldService;
    private final InquiryTemplateConvert inquiryTemplateConvert;
    @Override
    public List<InquiryTemplateFieldDTO> listAll(InquiryTemplateFieldQuery query) {
        List<InquiryTemplateFieldPO> inquiryTemplateFieldPOS = inquiryTemplateFieldService.getTemplateField(query);
        return inquiryTemplateConvert.fieldPo2DTOList(inquiryTemplateFieldPOS);
    }
}
