package click.kamil.examples.statemachine.extended.web;

import click.kamil.examples.statemachine.extended.service.OrderedService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderedTestController {

    private final OrderedService service;

    // The name "service" does not match HighPriorityOrderedService or LowPriorityOrderedService
    // So the Fallback by name will fail, and it will fall back to @Order
    public OrderedTestController(OrderedService service) {
        this.service = service;
    }

    @GetMapping("/test-order")
    public void testOrder() {
        service.doAction();
    }
}
