package com.pj.project4sp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.pj.project4sp.public4mapper.PublicMapper;
import com.pj.project4sp.public4mapper.PublicService;

/**
 * 公共Mapper 与 公共Service 
 * @author kong
 *
 */
@Component
public class SP {
	

	/**
	 * 公共Mapper
	 */
	public static PublicMapper publicMapper;	
	/**
	 * 公共Service
	 */
	public static PublicService publicService;				
	
	/**
	 * json序列化对象 
	 */
	@Autowired
	public static ObjectMapper objectMapper;

	/**
	 * Spring 封装的线程池对象 
	 */
	@Autowired
	public static ThreadPoolTaskExecutor taskExecutor;

	// 注入 
	@Autowired
	public void setBean(
			PublicMapper publicMapper,
			PublicService publicService,
			ObjectMapper objectMapper,
		    ThreadPoolTaskExecutor taskExecutor
			) {
		SP.publicMapper = publicMapper;
		SP.publicService = publicService;
		SP.objectMapper = objectMapper;
		SP.taskExecutor = taskExecutor;
	}
	
	
	
	
}
