gthdst ghfdrb

This commit is contained in:
Kayashov.SM
2025-04-28 18:39:15 +04:00
parent 3e3f33bebb
commit 56ffb21b91
6 changed files with 12 additions and 67 deletions

View File

@@ -37,17 +37,17 @@ public class BarController {
return unitRepository.findAll();
}
@GetMapping("glass")
@GetMapping("/glass")
public List<String> getGlass() {
return Arrays.stream(Glass.values()).map(Glass::getName).toList();
}
@GetMapping("category")
@GetMapping("/category")
public List<String> getCategory() {
return Arrays.stream(Category.values()).map(Category::getName).toList();
}
@GetMapping("receipt")
@GetMapping("/receipt")
public List<ReceiptResponseDto> getReceipt(@RequestParam("id") Long id) {
return sessionService.getReceiptList(id);
}
@@ -56,18 +56,12 @@ public class BarController {
public VisitorResponseDto getMe() {
Visitor visitor = visitorService.getCurrentVisitor();
String role;
Boolean invited;
boolean active;
role = UserRole.ADMIN.toString();
invited = true;
active = true;
VisitorResponseDto dto = VisitorResponseDto.mapToDto(visitor, invited, role, active);
log.info("Запрос информации о пользователе: {}-{} {}, вошел в бар{},в роли {}",
VisitorResponseDto dto = VisitorResponseDto.mapToDto(visitor, true, role, true);
log.info("Запрос информации о пользователе: {}-{} {}, вошел в бар",
dto.getId(),
dto.getName().strip(),
dto.getLastName() != null ? dto.getLastName().strip() : "",
invited ? "" : "не ",
role);
dto.getLastName() != null ? dto.getLastName().strip() : "");
return dto;
}
}