Springフレームワーク、サービスコールやマッパーの一般的なカテゴリには、ヌルポインタソリューションを報告しました

package com.example.timer;

import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.example.dao.FileMapper;

/**
 * 定时器
 * @author limstorm
 * @create 2020-01-23 07:55:50
 */
@Component
public class TimerTask {
	
	@Autowired
	private FileMapper fileMapper;
	
	public static TimerTask timerTask;
	
	@PostConstruct
    public void init() {    
		timerTask = this;
    } 
	
	public void convertVideo() {
		List<com.example.bean.File> fileList = timerTask.fileMapper.selectFileWithAllUserVideo();
	}
}

 

公開された22元の記事 ウォンの賞賛2 ビュー6439

おすすめ

転載: blog.csdn.net/qq_21479345/article/details/104108058