package com.jeeplus.test.wdt.merchantCompany.service.mapstuct;

import com.jeeplus.core.mapstruct.TreeWrapper;
import com.jeeplus.test.wdt.merchantCompany.domain.MerchantCompany;
import com.jeeplus.test.wdt.merchantCompany.domain.SettledPlatform;
import com.jeeplus.test.wdt.merchantCompany.service.dto.MerchantCompanyDTO;
import com.jeeplus.test.wdt.merchantCompany.service.dto.SettledPlatformDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 入驻平台MAPPER接口
 * @author 刘高峰
 * @version 2024-01-04 10:42
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
public interface SettledPlatformWrapper extends TreeWrapper<SettledPlatformDTO, SettledPlatform> {

    SettledPlatformWrapper INSTANCE = Mappers.getMapper(SettledPlatformWrapper.class);
    @Mappings({
            @Mapping(source = "createBy.id", target = "createById"),
            @Mapping (source = "updateBy.id", target = "updateById")})
    SettledPlatform toEntity(SettledPlatformDTO dto);


    @Mappings({
            @Mapping (source = "createById", target = "createBy.id"),
            @Mapping (source = "updateById", target = "updateBy.id")})
    SettledPlatformDTO toDTO(SettledPlatform entity);
}
