package com.mvc.netty;

import com.mvc.dao.TPackLog2Mapper;
import com.mvc.dao.TPackLogMapper;
import com.mvc.entity.TAiread;
import com.mvc.entity.TPackLog;
import com.mvc.entity.TPackLog2;
import com.mvc.service.ScheduleService;
import com.mvc.service.copy.TAireadService;
import com.mvc.service.copy.TPackLogService;
import com.mvc.utils.StoreBlockingQueue;
import com.mvc.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Component
public class PackLogThread implements Runnable{

    private  static Logger log = LoggerFactory.getLogger(RegularMessageParser.class);

    @Autowired
    private TPackLog2Mapper TPackLog2Mapper;

    @Override
    public void run()  {
        while(true){
            try {
                TPackLog2 log2 = StoreBlockingQueue.logQueue.take();
                TPackLog2Mapper.insert(log2);
            } catch (Exception e) {
                e.printStackTrace();
                log.error(e.getMessage());
            }
        }
    }
}
