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

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.module.system.controller.admin.carousel.vo.CarouselCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.carousel.vo.CarouselExcelVO;
import com.jojubanking.boot.module.system.controller.admin.carousel.vo.CarouselRespVO;
import com.jojubanking.boot.module.system.controller.admin.carousel.vo.CarouselUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.carousel.CarouselDO;
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 CarouselConvertImpl implements CarouselConvert {

    @Override
    public CarouselDO convert(CarouselCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        CarouselDO carouselDO = new CarouselDO();

        carouselDO.setTitle( bean.getTitle() );
        carouselDO.setImg( bean.getImg() );
        carouselDO.setType( bean.getType() );

        return carouselDO;
    }

    @Override
    public CarouselDO convert(CarouselUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        CarouselDO carouselDO = new CarouselDO();

        carouselDO.setId( bean.getId() );
        carouselDO.setTitle( bean.getTitle() );
        carouselDO.setImg( bean.getImg() );
        carouselDO.setType( bean.getType() );

        return carouselDO;
    }

    @Override
    public CarouselRespVO convert(CarouselDO bean) {
        if ( bean == null ) {
            return null;
        }

        CarouselRespVO carouselRespVO = new CarouselRespVO();

        carouselRespVO.setId( bean.getId() );
        carouselRespVO.setTitle( bean.getTitle() );
        carouselRespVO.setImg( bean.getImg() );
        carouselRespVO.setType( bean.getType() );
        carouselRespVO.setCreateTime( bean.getCreateTime() );

        return carouselRespVO;
    }

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

        List<CarouselRespVO> list1 = new ArrayList<CarouselRespVO>( list.size() );
        for ( CarouselDO carouselDO : list ) {
            list1.add( convert( carouselDO ) );
        }

        return list1;
    }

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

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

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

        return pageResult;
    }

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

        List<CarouselExcelVO> list1 = new ArrayList<CarouselExcelVO>( list.size() );
        for ( CarouselDO carouselDO : list ) {
            list1.add( carouselDOToCarouselExcelVO( carouselDO ) );
        }

        return list1;
    }

    protected CarouselExcelVO carouselDOToCarouselExcelVO(CarouselDO carouselDO) {
        if ( carouselDO == null ) {
            return null;
        }

        CarouselExcelVO carouselExcelVO = new CarouselExcelVO();

        carouselExcelVO.setId( carouselDO.getId() );
        carouselExcelVO.setTitle( carouselDO.getTitle() );
        carouselExcelVO.setImg( carouselDO.getImg() );
        carouselExcelVO.setType( carouselDO.getType() );
        carouselExcelVO.setCreateTime( carouselDO.getCreateTime() );

        return carouselExcelVO;
    }
}
