创建名称为'centralPagamentoPfController'的bean时出错:通过字段'service'表达的不满意的依赖关系;嵌套的异常是org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为“ centralPagamentoPfImpl”的bean时出错:通过字段“ simulaPagamentoEntryDTO”表示的不满足的依赖关系;嵌套的异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:没有类型为'br.com.itau.internet.mobile.pagamento.model.dto.PagamentoPfSimulacaoRequest'的合格Bean:期望至少有1个有资格作为自动装配候选的Bean。依赖注释:{@ org.springframework.beans.factory.annotation.Autowired(required = true)}
@RestController
@RequestMapping("/central_pagamentos")
public class CentralPagamentoPfController extends SummerControllerBase{
@Autowired
private CentralPagamentoPfService service;
//-------PAGAMENTO------------//
@PostMapping(value = "/pagamento/simular")
public Protocol simularPagamentoPf(@RequestBody EntryProtocol entryProtocol){
return service.simularPagamento(entryProtocol, ACTION_SIMULAR_PAGAMENTO, OPKEY_SIMULAR_PAGAMENTO);
}
...................................
public interface CentralPagamentoPfService {
Protocol simularPagamento(final EntryProtocol entryProtocol, String action, String opkey);
}
.......................................
@Service
public class CentralPagamentoPfImpl implements CentralPagamentoPfService, EstatisticaFactory {
@Autowired
private PagamentoPfSimulacaoRequest simulaPagamentoEntryDTO;
@Override
public Protocol simularPagamento(EntryProtocol entryProtocol, String action, String opkey){
PagamentoPfSimulacaoRequest entity = entryProtocol.getBodyAs(PagamentoPfSimulacaoRequest.class);
//code
}
}
........................
public class PagamentoPfSimulacaoRequest implements Serializable{
@JsonProperty("canal_pagamento")
private CanalPagamentoDto canalPagamento;
@JsonProperty("codigo_terminal")
private String codigoTerminal;
// geter e setter
}