package com.zanxiang.game.module.sdk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zanxiang.game.module.mybatis.entity.WordCheck;
import com.zanxiang.game.module.mybatis.mapper.WordCheckMapper;
import com.zanxiang.game.module.sdk.service.IWordCheckService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : lingfeng
 * @time : 2022-06-14
 * @description : 敏感词
 */
@Slf4j
@Service
public class WordCheckServiceImpl extends ServiceImpl<WordCheckMapper, WordCheck> implements IWordCheckService {

    @Override
    public boolean hasWord(String word) {
        List<WordCheck> wordCheckList = super.list(new LambdaQueryWrapper<WordCheck>().eq(WordCheck::getWord, word));
        return CollectionUtils.isNotEmpty(wordCheckList);
    }
}
