package cn.skcks.matrix.v2.model.location.record.convert;

import cn.skcks.matrix.v2.model.location.record.dto.LocationRecordDto;
import cn.skcks.matrix.v2.model.location.record.vo.LocationRecordVo;
import cn.skcks.matrix.v2.orm.mybatis.dynamic.model.LocationRecord;
import com.github.pagehelper.PageInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.Collection;

@Mapper
public abstract class LocationRecordConvertor {
    public final static LocationRecordConvertor INSTANCE = Mappers.getMapper(LocationRecordConvertor.class);

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "userId", target = "userId")
    })
    abstract public LocationRecordVo daoToVo(LocationRecord dao);

    abstract public Collection<LocationRecordVo> daoToVo(Collection<LocationRecord> dao);

    abstract public PageInfo<LocationRecordVo> daoToVo(PageInfo<LocationRecord> daoPageInfo);

    abstract public LocationRecord dtoToDao(LocationRecordDto dto);
}
