package cn.pluss.platform.converter;

import cn.pluss.platform.dto.MerchantStaffDTO;
import cn.pluss.platform.entity.UserInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

/**
 * @author DJH
 */
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface MerchantStaffConverter {

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

    /**
     * 数据转换
     * @param merchantStaffDTO
     * @return
     */
    @Mapping(source = "userId", target = "id")
    UserInfo toUserInfo(MerchantStaffDTO merchantStaffDTO);
}
