package com.jojubanking.boot.module.system.convert.information;

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.module.system.controller.admin.information.vo.InformationCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.information.vo.InformationExcelVO;
import com.jojubanking.boot.module.system.controller.admin.information.vo.InformationRespVO;
import com.jojubanking.boot.module.system.controller.admin.information.vo.InformationUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.information.InformationDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2025-12-05T11:32:08+0800",
    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_201 (Oracle Corporation)"
)
public class InformationConvertImpl implements InformationConvert {

    @Override
    public InformationDO convert(InformationCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        InformationDO informationDO = new InformationDO();

        informationDO.setTitle( bean.getTitle() );
        informationDO.setImg( bean.getImg() );
        informationDO.setContent( bean.getContent() );
        informationDO.setType( bean.getType() );

        return informationDO;
    }

    @Override
    public InformationDO convert(InformationUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        InformationDO informationDO = new InformationDO();

        informationDO.setId( bean.getId() );
        informationDO.setTitle( bean.getTitle() );
        informationDO.setImg( bean.getImg() );
        informationDO.setContent( bean.getContent() );
        informationDO.setType( bean.getType() );

        return informationDO;
    }

    @Override
    public InformationRespVO convert(InformationDO bean) {
        if ( bean == null ) {
            return null;
        }

        InformationRespVO informationRespVO = new InformationRespVO();

        informationRespVO.setTitle( bean.getTitle() );
        informationRespVO.setImg( bean.getImg() );
        informationRespVO.setContent( bean.getContent() );
        informationRespVO.setType( bean.getType() );
        informationRespVO.setId( bean.getId() );
        informationRespVO.setCreateTime( bean.getCreateTime() );

        return informationRespVO;
    }

    @Override
    public List<InformationRespVO> convertList(List<InformationDO> list) {
        if ( list == null ) {
            return null;
        }

        List<InformationRespVO> list1 = new ArrayList<InformationRespVO>( list.size() );
        for ( InformationDO informationDO : list ) {
            list1.add( convert( informationDO ) );
        }

        return list1;
    }

    @Override
    public PageResult<InformationRespVO> convertPage(PageResult<InformationDO> page) {
        if ( page == null ) {
            return null;
        }

        PageResult<InformationRespVO> pageResult = new PageResult<InformationRespVO>();

        pageResult.setList( convertList( page.getList() ) );
        pageResult.setTotal( page.getTotal() );

        return pageResult;
    }

    @Override
    public List<InformationExcelVO> convertList02(List<InformationDO> list) {
        if ( list == null ) {
            return null;
        }

        List<InformationExcelVO> list1 = new ArrayList<InformationExcelVO>( list.size() );
        for ( InformationDO informationDO : list ) {
            list1.add( informationDOToInformationExcelVO( informationDO ) );
        }

        return list1;
    }

    protected InformationExcelVO informationDOToInformationExcelVO(InformationDO informationDO) {
        if ( informationDO == null ) {
            return null;
        }

        InformationExcelVO informationExcelVO = new InformationExcelVO();

        informationExcelVO.setId( informationDO.getId() );
        informationExcelVO.setTitle( informationDO.getTitle() );
        informationExcelVO.setImg( informationDO.getImg() );
        informationExcelVO.setContent( informationDO.getContent() );
        informationExcelVO.setType( informationDO.getType() );
        informationExcelVO.setCreateTime( informationDO.getCreateTime() );

        return informationExcelVO;
    }
}
