2026-02-05 16:27:23 +08:00
|
|
|
package com.blog.initializer;
|
2026-02-02 21:24:59 +08:00
|
|
|
|
|
|
|
|
import com.blog.context.GlobalContext;
|
|
|
|
|
import com.blog.holder.GlobalContextHolder;
|
|
|
|
|
import jakarta.annotation.PostConstruct;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
@Component
|
2026-02-05 16:27:23 +08:00
|
|
|
public class GlobalContextInitializer {
|
2026-02-02 21:24:59 +08:00
|
|
|
|
|
|
|
|
@PostConstruct
|
|
|
|
|
public void initGlobalContext(){
|
|
|
|
|
GlobalContext globalContext = new GlobalContext();
|
|
|
|
|
GlobalContextHolder.setGlobalContext(globalContext);
|
|
|
|
|
}
|
|
|
|
|
}
|