Skip to content

Commit

Permalink
fix, add endpoint, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yennanliu committed Feb 21, 2024
1 parent 71ec064 commit 842eecb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions springBank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ docker-compose up
# restart
docker-compose restart

# run
docker-compose -f docker-compose.yml up

# rebuild (use updated java code) and run
docker-compose -f docker-compose.yml up --build

#---------------------------
# Macbook apple M1 chip
#---------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public ResponseEntity<Balance> getDepartmentByUserId(@PathVariable("userId") Int
return new ResponseEntity<>(balance, HttpStatus.OK);
}

@GetMapping("/v1/{userId}")
public ResponseEntity<Balance> getDepartmentByUserIdWithLock(@PathVariable("userId") Integer userId){

Balance balance = balanceServiceRedisson.getBalanceById(userId);
return new ResponseEntity<>(balance, HttpStatus.OK);
}

// @PostMapping("/update")
// public ResponseEntity<ApiResponse> updateDepartment(@RequestBody DepartmentDto departmentDto) {
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public List<Balance> getBalances() {

public Balance getBalanceById(Integer id) {

System.out.println("(BalanceServiceRedisson) getBalanceById start ... Id = " + id);

Balance balance = new Balance();

// lock
Expand Down

0 comments on commit 842eecb

Please sign in to comment.