package com.xindazhou.business.convert.service.feedback;

import com.xindazhou.business.controller.admin.service.feedback.vo.FeedbackRespVO;
import com.xindazhou.business.dal.service.dataobject.feedback.FeedbackDO;
import com.xindazhou.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 意见反馈 Convert
 *
 * @author xindazhou
 */
@Mapper
public interface FeedbackConvert {

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

    @Mapping(target = "userInfo", ignore = true) // userInfo 需要通过 RPC 调用用户服务获取
    @Mapping(target = "images", ignore = true) // images 需要从JSON字符串解析
    FeedbackRespVO convert(FeedbackDO bean);

    List<FeedbackRespVO> convertList(List<FeedbackDO> list);

    PageResult<FeedbackRespVO> convertPage(PageResult<FeedbackDO> page);

}

