package org.ta.pddserver.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.ta.pdd.entity.LogsPddDownEntity;
import org.ta.pddserver.mapper.LogsPddDownMapper;
import org.ta.pddserver.service.LogsPddDownService;

import java.util.Date;
import java.util.List;

@Service
public class LogsPddDownImpl extends ServiceImpl<LogsPddDownMapper, LogsPddDownEntity> implements LogsPddDownService {

    public void insertLog(String req) {
        LogsPddDownEntity  logsPddDownEntity = new LogsPddDownEntity();
        logsPddDownEntity.setReq(req);
        logsPddDownEntity.setCreated(new Date());
        this.save(logsPddDownEntity);
    }

    public List<LogsPddDownEntity> getListByKeyword(String keyword) {
        return this.baseMapper.findByKeyWord(keyword);
    }
}