текстовые ответы в .body
This commit is contained in:
@@ -31,14 +31,20 @@ public class EmployeeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{code}/auth")
|
@GetMapping("/{code}/auth")
|
||||||
public HttpStatus Isauth(@PathVariable String code){
|
public ResponseEntity<?> Isauth(@PathVariable String code) {
|
||||||
if(employeeService.isCodeValid(code)){
|
if (employeeService.isCodeValid(code)) {
|
||||||
return HttpStatus.OK;
|
return ResponseEntity
|
||||||
|
.status(HttpStatus.OK)
|
||||||
|
.body("<html><i> данный код существует - можно пользоваться приложением</b></html>");
|
||||||
|
} else if (code == null) {
|
||||||
|
return ResponseEntity
|
||||||
|
.status(HttpStatus.BAD_REQUEST)
|
||||||
|
.body("<html><b> что-то пошло не так</b></html>");
|
||||||
|
} else {
|
||||||
|
return ResponseEntity
|
||||||
|
.status(HttpStatus.UNAUTHORIZED)
|
||||||
|
.body("<html>кода не существует</html>");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return HttpStatus.UNAUTHORIZED;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user