변수에 대한 주입을 사용하여 약간 손실되었습니다. 내가 수업에 필요한 곳마다 내 RPC 서비스를 호출 할 수 있습니다이 코드GIN @ Rpc 서비스 용 @Inject on
private XXServiceAsync xxServiceAsync;
@Inject
protected IndexViewImpl(EventBus eventBus, XXServiceAsync tableManagementServiceAsync) {
super(eventBus, mapper);
this.xxServiceAsync = xxServiceAsync;
initializeWidgets();
}
(클릭에 ...) 나는 약간에게 코드를 삭제하고 싶습니다 :이 코드 작업을 얻었다
변수에 직접 주입함으로써; 그럴 경우 :
@Inject
private XXServiceAsync xxServiceAsync;
protected IndexViewImpl(EventBus eventBus) {
super(eventBus, mapper);
initializeWidgets();
}
이렇게하면 서비스가 항상 NULL로 유지됩니다. 내가 잘못하고 있니? 그렇지 않으면 rpc 서비스가있는 GIN 마술은 의미가 있습니까?
감사합니다.
일단 생성자가 실행을 마쳤 으면 필드가 지정된다는 점을 지적 해 주셔서 감사합니다. –