main #9

Closed
student-20690 wants to merge 26 commits from (deleted):main into main
3 changed files with 9 additions and 11 deletions
Showing only changes of commit f42e1493a1 - Show all commits

View File

@@ -37,13 +37,10 @@ public class EmployeeController {
if (employeeService.isCodeValid(code)) {
return HttpStatus.OK;
} else if (code == null) {
return
HttpStatus.BAD_REQUEST;
} else if (!employeeService.isCodeValid(code)){
return HttpStatus.UNAUTHORIZED;
} else {
return
HttpStatus.UNAUTHORIZED;
return HttpStatus.BAD_REQUEST;
}
}

View File

@@ -1,9 +1,6 @@
package com.example.nto.entity;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -23,9 +20,11 @@ import lombok.NoArgsConstructor;
public class Place {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "place_name")
private String place;
public Place(long id, String place){

View File

@@ -39,4 +39,6 @@ public class EmployeeServiceImpl implements EmployeeService {
public boolean isCodeValid(String code){
return employeeRepository.findByCode(code).isPresent();
}
}