Static-工具类-注入-service

49次阅读

共计 382 个字符,预计需要花费 1 分钟才能阅读完成。

import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.svc.XXSvc;

@Component
public class XXUtil {

@Autowired
XXSvc xXSvc;
private static XXUtil  xXUtil ;

@PostConstruct
public void init() {
    xXUtil = this;
    xXUtil.xXSvc = this.xXSvc;
}

public static Boolean xMethod(String name) {return xXUtil.xXSvc.XMethod(name);
}

}

正文完
 0