подропал не юзаемые методы
This commit is contained in:
parent
728b166be0
commit
0a6ba9f820
@ -40,11 +40,6 @@ public class CreatorService {
|
|||||||
public Creator findByLogin(String login) {
|
public Creator findByLogin(String login) {
|
||||||
return findCreator(userRepository.findOneByLoginIgnoreCase(login).getId());
|
return findCreator(userRepository.findOneByLoginIgnoreCase(login).getId());
|
||||||
}
|
}
|
||||||
@Transactional(readOnly = true)
|
|
||||||
public User findUser(Long id) {
|
|
||||||
final Optional<User> user = userRepository.findById(id);
|
|
||||||
return user.orElseThrow(() -> new CreatorNotFoundException(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<Creator> findAllCreators() { return creatorRepository.findAll(); }
|
public List<Creator> findAllCreators() { return creatorRepository.findAll(); }
|
||||||
|
@ -55,14 +55,6 @@ public class MangaService {
|
|||||||
return creator.orElseThrow(() -> new CreatorNotFoundException(id));
|
return creator.orElseThrow(() -> new CreatorNotFoundException(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public Manga addManga(Long creatorId, Integer chapterCount, String mangaName, String Image) {
|
|
||||||
final Creator currentCreator = findCreator(creatorId);
|
|
||||||
final Manga manga = new Manga(currentCreator, mangaName, chapterCount, Image);
|
|
||||||
validatorUtil.validate(manga);
|
|
||||||
return mangaRepository.save(manga);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Manga addManga(MangaDto mangaDto) {
|
public Manga addManga(MangaDto mangaDto) {
|
||||||
final Creator currentCreator = findCreator(mangaDto.getCreatorId());
|
final Creator currentCreator = findCreator(mangaDto.getCreatorId());
|
||||||
@ -80,15 +72,6 @@ public class MangaService {
|
|||||||
return currentManga;
|
return currentManga;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public Manga updateManga(MangaDto mangaDto) {
|
|
||||||
final Manga currentManga = findManga(mangaDto.getId());
|
|
||||||
currentManga.setChapterCount(mangaDto.getChapterCount());
|
|
||||||
currentManga.setImage(mangaDto.getImage().getBytes());
|
|
||||||
validatorUtil.validate(currentManga);
|
|
||||||
return currentManga;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Manga deleteManga(Long id) {
|
public Manga deleteManga(Long id) {
|
||||||
final Manga currentManga = findManga(id);
|
final Manga currentManga = findManga(id);
|
||||||
@ -99,9 +82,4 @@ public class MangaService {
|
|||||||
mangaRepository.delete(currentManga);
|
mangaRepository.delete(currentManga);
|
||||||
return currentManga;
|
return currentManga;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void deleteAllMangas() {
|
|
||||||
mangaRepository.deleteAll();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -43,12 +43,6 @@ public class ReaderService {
|
|||||||
return findReader(userRepository.findOneByLoginIgnoreCase(login).getId());
|
return findReader(userRepository.findOneByLoginIgnoreCase(login).getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
|
||||||
public User findUser(Long id) {
|
|
||||||
final Optional<User> user = userRepository.findById(id);
|
|
||||||
return user.orElseThrow(() -> new CreatorNotFoundException(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<Reader> findAllReaders() {
|
public List<Reader> findAllReaders() {
|
||||||
return readerRepository.findAll();
|
return readerRepository.findAll();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user