package com.hxzk.gps.util; import com.hxzk.gps.controller.System.SystemLogUtil; import com.hxzk.gps.service.System.TbSystemOperationLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; @Component public class Initializer implements ApplicationListener { @Autowired private TbSystemOperationLogService systemOperationLogService; @Override public void onApplicationEvent(ContextRefreshedEvent event) { SystemLogUtil.setSystemOperationLogService(systemOperationLogService); } }