package com.xindazhou.business.convert.community.activity;

import com.xindazhou.business.controller.admin.community.activity.vo.ActivityRespVO;
import com.xindazhou.business.controller.admin.community.activity.vo.ActivitySaveReqVO;
import com.xindazhou.business.dal.community.dataobject.activity.ActivityDO;
import com.xindazhou.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 活动 Convert
 *
 * @author xindazhou
 */
@Mapper
public interface ActivityConvert {

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

    ActivityRespVO convert(ActivityDO bean);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "activityId", ignore = true)
    @Mapping(target = "status", ignore = true)
    @Mapping(target = "registerCount", ignore = true)
    @Mapping(target = "virtualRegisterCount", ignore = true)
    ActivityDO convert(ActivitySaveReqVO bean);

    PageResult<ActivityRespVO> convertPage(PageResult<ActivityDO> page);

}

