package com.seer.teach.admin.convert;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.seer.teach.admin.request.GenerateTaskReq;
import com.seer.teach.admin.request.KnowledgePointsPageQueryReq;
import com.seer.teach.admin.request.KnowledgePointsReq;
import com.seer.teach.admin.response.KnowledgePointsResp;
import com.seer.teach.teacher.module.entity.KnowledgePointEntity;
import com.seer.teach.teacher.module.param.KnowledgePointSearchParam;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 知识点转换器
 * </p>
 *
 * @author ZS
 * @since 2025-10-24
 */
@Mapper
public interface KnowledgePointsConvert {

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

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    KnowledgePointEntity convertReq2Entity(KnowledgePointsReq req);

    KnowledgePointsResp toResp(KnowledgePointEntity entity);

    List<KnowledgePointsResp> converEntity2RespList(List<KnowledgePointEntity>  entities);

    List<KnowledgePointsResp> converEntity2RespList(Collection<KnowledgePointEntity> entities);

    LambdaQueryWrapper<KnowledgePointEntity> convert(KnowledgePointsPageQueryReq req);

    KnowledgePointSearchParam generateReq2KnowledgePointSearchParam(GenerateTaskReq req);
}