Skip to content

Commit

Permalink
deleted unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
RCherniavskiy committed Mar 19, 2024
1 parent 64a19eb commit 227c3c9
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package mate.academy.rickandmorty.controller;

import java.util.Arrays;
import java.util.List;

import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import mate.academy.rickandmorty.model.Character;
import mate.academy.rickandmorty.service.CharacterLoader;
import mate.academy.rickandmorty.service.CharacterService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import mate.academy.rickandmorty.dto.internal.CharacterDto;
import mate.academy.rickandmorty.model.Character;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(config = MapperConfig.class)
public interface CharacterMapper {
CharacterDto toDto(Character character);

Character toCharacter(CharacterResponseDataDto characterDto);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package mate.academy.rickandmorty.repository;

import java.util.List;
import java.util.Optional;

import mate.academy.rickandmorty.model.Character;
import org.springframework.data.jpa.repository.JpaRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package mate.academy.rickandmorty.service;

import java.util.List;

import mate.academy.rickandmorty.model.Character;

public interface CharacterService {
Character getRandomCharacter();

List<Character> getCharactersByNames(String characters);
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public void loadDataFromExternalAPI() {
e.printStackTrace();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
import java.util.List;
import java.util.Optional;
import java.util.Random;

import jakarta.annotation.PostConstruct;
import mate.academy.rickandmorty.mapper.CharacterMapper;
import mate.academy.rickandmorty.model.Character;
import mate.academy.rickandmorty.repository.CharacterRepository;
import mate.academy.rickandmorty.service.CharacterLoader;
import mate.academy.rickandmorty.service.CharacterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
Expand Down Expand Up @@ -54,4 +51,4 @@ public Character getRandomCharacter() {
Optional<Character> optionalCharacter = characterRepository.findById(randomIndex);
return optionalCharacter.orElseThrow(() -> new RuntimeException("Character not found"));
}
}
}

0 comments on commit 227c3c9

Please sign in to comment.