package com.ruoyi.bst.agreement.service.impl;

import com.ruoyi.bst.agreement.domain.Agreement;
import com.ruoyi.bst.agreement.service.AgreementConverter;
import org.springframework.stereotype.Service;


@Service
public class AgreementConverterImpl implements AgreementConverter {

    @Override
    public Agreement toPoByCreate(Agreement data) {
        if (data == null) {
            return null;
        }
        Agreement po = new Agreement();
        // 基础信息
        po.setAppId(data.getAppId());
        po.setTitle(data.getTitle());
        po.setAgreementType(data.getAgreementType());
        po.setContent(data.getContent());
        return po;
    }

    @Override
    public Agreement toPoByUpdate(Agreement data) {
        if (data == null) {
            return null;
        }
        Agreement po = new Agreement();
        // 基础信息
        po.setAppId(data.getAppId());
        po.setId(data.getId());
        po.setTitle(data.getTitle());
        po.setAgreementType(data.getAgreementType());
        po.setContent(data.getContent());
        return po;

    }

}
