package com.xindazhou.vehicle.convert.category;

import com.xindazhou.framework.common.pojo.PageResult;
import com.xindazhou.vehicle.controller.admin.vehicle.vo.VehicleCategoryRespVO;
import com.xindazhou.vehicle.controller.admin.vehicle.vo.VehicleCategorySaveReqVO;
import com.xindazhou.vehicle.dal.dataobject.category.VehicleCategoryDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 分类管理 Convert
 *
 * @author xindazhou
 */
@Mapper
public interface VehicleCategoryConvert {

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

    VehicleCategoryRespVO convert(VehicleCategoryDO bean);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "articleCount", ignore = true)
    VehicleCategoryDO convert(VehicleCategorySaveReqVO bean);

    PageResult<VehicleCategoryRespVO> convertPage(PageResult<VehicleCategoryDO> page);

}

