package com.seer.teach.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seer.teach.common.enums.user.GradeStatusEnum;
import com.seer.teach.user.convert.GradeConvert;
import com.seer.teach.user.entity.GradeEntity;
import com.seer.teach.user.mapper.GradeMapper;
import com.seer.teach.user.response.GradeResp;
import com.seer.teach.user.service.IGradeService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Captain
 * @since 2025-05-20
 */
@Service
public class IGradeServiceImpl extends ServiceImpl<GradeMapper, GradeEntity> implements IGradeService {

    @Override
    public List<GradeResp> padList() {
        List<GradeEntity> list = this.lambdaQuery()
                .eq(GradeEntity::getStatus, GradeStatusEnum.ENABLE.getCode())
                .list();
        return GradeConvert.INSTANCE.toGradeRespList(list);
    }

}
