Helius
2022-05-10 80163ed89afd4d656b168070ced82d4f0cab0c7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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<EntrustListInfoVo> entrustToListInfoVoList(List<OtcEntrustOrder> 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);
}