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

xyz.migoo.framework.infra.convert.developer.sms.SmsTemplateConvertImpl Maven / Gradle / Ivy

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

import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import xyz.migoo.framework.common.pojo.PageResult;
import xyz.migoo.framework.infra.controller.developer.sms.vo.template.SmsTemplateCreateReqVO;
import xyz.migoo.framework.infra.controller.developer.sms.vo.template.SmsTemplateRespVO;
import xyz.migoo.framework.infra.controller.developer.sms.vo.template.SmsTemplateUpdateReqVO;
import xyz.migoo.framework.infra.dal.dataobject.developer.sms.SmsTemplateDO;

@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 SmsTemplateConvertImpl implements SmsTemplateConvert {

    @Override
    public SmsTemplateDO convert(SmsTemplateCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        SmsTemplateDO smsTemplateDO = new SmsTemplateDO();

        smsTemplateDO.setStatus( bean.getStatus() );
        smsTemplateDO.setCode( bean.getCode() );
        smsTemplateDO.setName( bean.getName() );
        smsTemplateDO.setContent( bean.getContent() );
        smsTemplateDO.setApiTemplateId( bean.getApiTemplateId() );
        smsTemplateDO.setChannelId( bean.getChannelId() );

        return smsTemplateDO;
    }

    @Override
    public SmsTemplateDO convert(SmsTemplateUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        SmsTemplateDO smsTemplateDO = new SmsTemplateDO();

        smsTemplateDO.setId( bean.getId() );
        smsTemplateDO.setStatus( bean.getStatus() );
        smsTemplateDO.setCode( bean.getCode() );
        smsTemplateDO.setName( bean.getName() );
        smsTemplateDO.setContent( bean.getContent() );
        smsTemplateDO.setApiTemplateId( bean.getApiTemplateId() );
        smsTemplateDO.setChannelId( bean.getChannelId() );

        return smsTemplateDO;
    }

    @Override
    public SmsTemplateRespVO convert(SmsTemplateDO bean) {
        if ( bean == null ) {
            return null;
        }

        SmsTemplateRespVO smsTemplateRespVO = new SmsTemplateRespVO();

        smsTemplateRespVO.setStatus( bean.getStatus() );
        smsTemplateRespVO.setCode( bean.getCode() );
        smsTemplateRespVO.setName( bean.getName() );
        smsTemplateRespVO.setContent( bean.getContent() );
        smsTemplateRespVO.setApiTemplateId( bean.getApiTemplateId() );
        smsTemplateRespVO.setChannelId( bean.getChannelId() );
        smsTemplateRespVO.setId( bean.getId() );
        smsTemplateRespVO.setChannelCode( bean.getChannelCode() );
        List list = bean.getParams();
        if ( list != null ) {
            smsTemplateRespVO.setParams( new ArrayList( list ) );
        }
        smsTemplateRespVO.setCreateTime( bean.getCreateTime() );

        return smsTemplateRespVO;
    }

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

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

        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