com.zcj.web.businesslog.BusinessLogObjectHolder Maven / Gradle / Ivy
package com.zcj.web.businesslog;
import com.zcj.web.spring.SpringBeanUtil;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
import java.io.Serializable;
@Component
@Scope(scopeName = WebApplicationContext.SCOPE_SESSION)
public class BusinessLogObjectHolder implements Serializable {
private static final long serialVersionUID = 1L;
// 用于记录日志时识别修改的内容
private T object = null;
public void set(T obj) {
this.object = obj;
}
public T get() {
return object;
}
public static BusinessLogObjectHolder me() {
return SpringBeanUtil.getBean(BusinessLogObjectHolder.class);
}
}