对象存储-初始化
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.blog.initializer;
|
||||
|
||||
import com.blog.context.GlobalContext;
|
||||
import com.blog.holder.GlobalContextHolder;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GlobalContextInitializer {
|
||||
|
||||
@PostConstruct
|
||||
public void initGlobalContext(){
|
||||
GlobalContext globalContext = new GlobalContext();
|
||||
GlobalContextHolder.setGlobalContext(globalContext);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user