All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.migoo.framework.infra.convert.developer.job.JobLogConvertImpl Maven / Gradle / Ivy

The newest version!
package xyz.migoo.framework.infra.convert.developer.job;

import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.processing.Generated;
import xyz.migoo.framework.common.pojo.PageResult;
import xyz.migoo.framework.infra.controller.developer.job.vo.JobLogRespVO;
import xyz.migoo.framework.infra.dal.dataobject.developer.job.JobLogDO;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-11-29T19:15:13+0800",
    comments = "version: 1.6.0, compiler: javac, environment: Java 21.0.3 (Oracle Corporation)"
)
public class JobLogConvertImpl implements JobLogConvert {

    @Override
    public JobLogRespVO convert(JobLogDO bean) {
        if ( bean == null ) {
            return null;
        }

        JobLogRespVO jobLogRespVO = new JobLogRespVO();

        jobLogRespVO.setJobId( bean.getJobId() );
        jobLogRespVO.setHandlerName( bean.getHandlerName() );
        jobLogRespVO.setHandlerParam( bean.getHandlerParam() );
        jobLogRespVO.setExecuteIndex( bean.getExecuteIndex() );
        if ( bean.getBeginTime() != null ) {
            jobLogRespVO.setBeginTime( Date.from( bean.getBeginTime().toInstant( ZoneOffset.UTC ) ) );
        }
        if ( bean.getEndTime() != null ) {
            jobLogRespVO.setEndTime( Date.from( bean.getEndTime().toInstant( ZoneOffset.UTC ) ) );
        }
        jobLogRespVO.setDuration( bean.getDuration() );
        jobLogRespVO.setStatus( bean.getStatus() );
        jobLogRespVO.setResult( bean.getResult() );
        jobLogRespVO.setId( bean.getId() );
        jobLogRespVO.setCreateTime( bean.getCreateTime() );

        return jobLogRespVO;
    }

    @Override
    public List convertList(List list) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( JobLogDO jobLogDO : list ) {
            list1.add( convert( jobLogDO ) );
        }

        return list1;
    }

    @Override
    public PageResult convertPage(PageResult page) {
        if ( page == null ) {
            return null;
        }

        PageResult pageResult = new PageResult();

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

        return pageResult;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy