optimize code
This commit is contained in:
@@ -15,8 +15,12 @@ import java.util.List;
|
||||
@RequestMapping("/expenses")
|
||||
public class ExpenseController {
|
||||
|
||||
private final ExpenseService expenseService;
|
||||
|
||||
@Autowired
|
||||
private ExpenseService expenseService;
|
||||
public ExpenseController(ExpenseService expenseService) {
|
||||
this.expenseService = expenseService;
|
||||
}
|
||||
|
||||
@GetMapping("/user/{userUuid}")
|
||||
public ResponseEntity<List<Expense>> getExpensesByUser(@PathVariable String userUuid) {
|
||||
|
||||
@@ -14,8 +14,13 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/incomes")
|
||||
public class IncomeController {
|
||||
|
||||
private final IncomeService incomeService;
|
||||
|
||||
@Autowired
|
||||
private IncomeService incomeService;
|
||||
public IncomeController(IncomeService incomeService) {
|
||||
this.incomeService = incomeService;
|
||||
}
|
||||
|
||||
@GetMapping("/user/{userUuid}")
|
||||
public ResponseEntity<List<Income>> getIncomesByUser(@PathVariable String userUuid) {
|
||||
|
||||
@@ -13,8 +13,12 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/users")
|
||||
public class UserController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
public UserController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping("/{userUuid}")
|
||||
public ResponseEntity<User> getUser(@PathVariable String userUuid) {
|
||||
|
||||
Reference in New Issue
Block a user