package com.tuoheng.miniprogram.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.dao.QuestionTypeMapper;
import com.tuoheng.miniprogram.entity.QuestionType;
import com.tuoheng.miniprogram.enums.MarkEnum;
import com.tuoheng.miniprogram.service.IQuestionTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author ChengWang
 * @Date 2022/11/25
 */
@Service
@Slf4j
public class QuestionTypeServiceImpl implements IQuestionTypeService {

    @Autowired
    private QuestionTypeMapper questionTypeMapper;
    /**
     * 获取问题类型
     * @return
     */
    @Override
    public JsonResult getList(){
        List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>()
                .eq(QuestionType::getMark, MarkEnum.VALID.getCode()));
        return JsonResult.success(questionTypeList);
    }
}
