Skip to main content

依赖注入

@Authwired注解

@Autowired
UserDetailsServiceImpl userDetailsServiceImpl;

setter

private InventoryMapper inventoryMapper;

public void setInventoryMapper(InventoryMapper inventoryMapper) {
this.inventoryMapper = inventoryMapper;
}

构造器

private final InventoryMapper inventoryMapper;

public InventoryController(InventoryMapper inventoryMapper) {
this.inventoryMapper = inventoryMapper;
}