Skip to content

Commit

Permalink
new-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eylulozatman committed Jan 3, 2024
1 parent 6d4a3e8 commit be4bd81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package airline.airlinemidterm4458.controller;


import airline.airlinemidterm4458.DTO.FlightResponse;
import airline.airlinemidterm4458.DTO.NewFlightRequest;
import airline.airlinemidterm4458.DTO.QueryTicketRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public ResponseEntity<?> buyTicket(@RequestBody BuyTicketRequest buyTicketReques
String username = userDetails.getUsername();
Customer currentCustomer = customerRepository.findByUsername(username);
return ticketService.buyOneTicket(buyTicketRequest, currentCustomer);
} else {
}
else {
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);
}
}

}
@DeleteMapping("/delete-ticket")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public AuthenticationResponse login(LoginRequest loginRequest)
return AuthenticationResponse.builder().token("invalid username or password").build();
}
} catch (Exception e) {
System.out.println("Hata: " + e.getMessage());
return AuthenticationResponse.builder().token("Bir hata oluştu").build();
System.out.println("Error: " + e.getMessage());
return AuthenticationResponse.builder().token("An error occurred").build();
}
}
public ResponseEntity<?> register(RegisterRequest registerRequest) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.url=jdbc:mysql://mysql-20231120234854.mysql.database.azure.com:3306/airline?serverTimezone=UTC&useSSL=true&requireSSL=false
spring.datasource.username=DELL
spring.datasource.password=BYE01bye


token.signing.key=413F4428472B4B6250655368566D5970337336763979244226452948404D6351
server.port=8282
Expand Down

0 comments on commit be4bd81

Please sign in to comment.