Skip to content

Dev#8

Open
closeyoureyess wants to merge 9 commits into
EffectiveMobile:mainfrom
closeyoureyess:dev
Open

Dev#8
closeyoureyess wants to merge 9 commits into
EffectiveMobile:mainfrom
closeyoureyess:dev

Conversation

@closeyoureyess

Copy link
Copy Markdown

No description provided.

*/
@ExceptionHandler(EntityNotFoundException.class)
protected ResponseEntity<ApiErrorResponse> handleExecutorNotFoundExeption(EntityNotFoundException e, HttpServletRequest request) {
log.error(GENERATION_ERROR.getEnumDescription() + e.getClass() + LINE_FEED + e.getMessage() + LINE_FEED + e);

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.

Вид логгера везде должен быть формата log.errror({})
Как пример:
log.error("{}{}" + LINE_FEED + "{}" + LINE_FEED + "{}", GENERATION_ERROR.getEnumDescription(), e.getClass(), e.getMessage(), e);

public TaskDto convertTasksToDto(Task tasks) {
log.info("Метод convertTasksToDto()");
TaskDto tasksDtoLocalObject = new TaskDto();
if (tasks != null) {

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.

Повтор кода, можно декомпозировать и вывести в отдельный метод

@NotNull(message = "TasksDto не может быть null") TaskDto tasksDto) throws EntityNotFoundException {
Optional<TaskDto> newTasksDto = taskService
.changeTasks(tasksDto);
if (newTasksDto.isPresent()) {

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.

Можно более краткую вариацию, если уже с Optional работаешь, пример:
return newTasksDto.map(ResponseEntity::ok).orElseGet(() -> ResponseEntity.badRequest().build());
В нескольких местах есть такое


@Getter
@RequiredArgsConstructor
public class Violation {

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.

По факту Record класс

spring.liquibase.enabled=true
spring.cache.type=redis
spring.redis.host=localhost
spring.redis.port=6379

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.

У тебя немного устаревший параметр

spring.data.redis.port

@Autowired
private ObjectMapper objectMapper;

// Тесты для POST /task/create

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.

Лишние комменты лучше не держать, есть JavaDoc лбо Display в данном случае

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