package cokr.xit.ens.modules;

import cokr.xit.ens.core.aop.repository.AccessLogRepository;
import cokr.xit.ens.core.code.CodeMapperFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Slf4j
@Controller
@RequiredArgsConstructor
public class IndexController {

	private final AccessLogRepository accessLogRepository;
	private final CodeMapperFactory codeMapperFactory;

	@GetMapping("/")
	public String index() {
//		log.info("Welcome to the world!!");
//		codeMapperFactory.get(SampleCd.class).forEach((row) -> System.out.println(row.getCode()+"="+row.getCodeNm()));
//		Queue<Integer> q = new LinkedList<Integer>();
//		for(int i=1; i<=100; i++) {
//			q.offer(i);
//			if(i%10==0)
//				System.out.println(String.format("poll => %d", q.poll()));
//		}
//		q.forEach(i -> System.out.println("value => "+i));
//		for(int i=101; i<=200; i++) {
//			q.offer(i);
//			if(i%10==0)
//				System.out.println(String.format("poll => %d", q.poll()));
//		}
//		q.forEach(i -> System.out.println("value => "+i));
		
		return "index";
	}

}
