Skip to content

ToDo_Solved_By_Hizam#43

Open
hizam37 wants to merge 1 commit into
EffectiveMobile:mainfrom
hizam37:dev
Open

ToDo_Solved_By_Hizam#43
hizam37 wants to merge 1 commit into
EffectiveMobile:mainfrom
hizam37:dev

Conversation

@hizam37

@hizam37 hizam37 commented Nov 23, 2025

Copy link
Copy Markdown

No description provided.

CREATE CAST (varchar AS todo_status_enum) WITH INOUT AS IMPLICIT;
create table todo
(
id serial primary key,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предусловия нужны, if table exist

import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExceptionHandler {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лушче Implementиться от Rest исключений, т.к. тут ты почти никакие не покрыл

jdbcToDoRepository.updateToDoById(toDo, id);
}

@Cacheable(value = "todo", key = "{#toDo.toDoPriority != null ? #toDo.toDoPriority.name() : 'NULL',#toDo.toDoStatus != null ? #toDo.toDoStatus.name() : 'NULL',#pageable.pageNumber,#pageable.pageSize,#pageable.sort != null ? #pageable.sort.toString() : 'NOSORT' }")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Длинное, трудно читаемое выражение SpEL
Как лучше

Создать кастомный KeyGenerator

Вынести туда все правила формирования ключа

В сервисе использовать просто @Cacheable(keyGenerator = "todoFilterKeyGenerator")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants