package com.hdkj.lt.job.entity.convert;

import com.hdkj.lt.core.bizms.modle.po.DwdShbDsFeederBase;
import com.hdkj.lt.job.entity.po.FeederBaseResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

/**
 * @author rj
 * @date 2025/6/27 9:57
 * @description
 */
@Component
@Mapper
public interface EntityConvertor {

    EntityConvertor INSTANCE = Mappers.getMapper(EntityConvertor.class);

    @Mapping(source = "assets.astId",target = "astId")
    @Mapping(source = "assets.feederRateCapacity",target = "feederRateCapacity")
    @Mapping(source = "assets.ctime",target = "ctime")
    @Mapping(source = "assets.lastUpdateTime",target = "lastUpdateTime")
    @Mapping(expression = "java(new java.util.Date())",target = "updateTime")
    DwdShbDsFeederBase toDwdShbDsFeederBase(FeederBaseResponse.ResultDTO.DkxDTO.RecordsDTO.ResourceDTO resourceDTO, FeederBaseResponse.ResultDTO.DkxDTO.RecordsDTO.AssetsDTO assets);
}
