package cn.skcks.matrix.v2.model.user.convert;

import cn.skcks.matrix.v2.model.user.vo.UserVo;
import cn.skcks.matrix.v2.orm.mybatis.dynamic.model.User;
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 UserConvertor {
    public final static UserConvertor INSTANCE = Mappers.getMapper(UserConvertor.class);

    @Mappings(
            @Mapping(source = "id", target = "id")
    )
    abstract public UserVo daoToVo(User user);

    abstract public Collection<UserVo> daoToVo(Collection<User> users);

    abstract public PageInfo<UserVo> daoToVo(PageInfo<User> userPageInfo);
}
