package com.xcong.excoin.modules.otc.mapper; import com.xcong.excoin.modules.otc.dto.EntrustOrderAddDto; import com.xcong.excoin.modules.otc.entity.OtcEntrustOrder; import com.xcong.excoin.modules.otc.vo.EntrustListInfoVo; import com.xcong.excoin.modules.otc.vo.EntrustOrderDetailVo; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; import java.util.List; @Mapper public abstract class OtcEntrustOrderMapper { public static OtcEntrustOrderMapper INSTANCE = Mappers.getMapper(OtcEntrustOrderMapper.class); @Mapping(target = "coinAmount", source = "amount") @Mapping(target = "limitMinAmount", source = "min") @Mapping(target = "limitMaxAmount", source = "max") @Mapping(target = "orderType", source = "type") public abstract OtcEntrustOrder entrustOrderDtoToEntity(EntrustOrderAddDto entrustOrderAddDto); @Mapping(target = "min", source = "limitMinAmount") @Mapping(target = "max", source = "limitMaxAmount") @Mapping(target = "amount", source = "coinAmount") @Mapping(target = "remainAmount", source = "remainCoinAmount") public abstract EntrustListInfoVo entityToListInfoVo(OtcEntrustOrder otcEntrustOrder); public abstract List entrustToListInfoVoList(List list); @Mapping(target = "min", source = "limitMinAmount") @Mapping(target = "max", source = "limitMaxAmount") @Mapping(target = "amount", source = "coinAmount") @Mapping(target = "remainAmount", source = "remainCoinAmount") @Mapping(target = "orderNo", source = "entrustOrderNo") public abstract EntrustOrderDetailVo entityToOrderDetail(OtcEntrustOrder order); }