Skip to content

Instantly share code, notes, and snippets.

@adgadev
Created August 26, 2022 21:17
Show Gist options
  • Save adgadev/fd2aa86af5adafcd11c75a6cac58e4d6 to your computer and use it in GitHub Desktop.
Save adgadev/fd2aa86af5adafcd11c75a6cac58e4d6 to your computer and use it in GitHub Desktop.
@Service
@HaloFeature
@RequiredArgsConstructor
public class HaloService {
private final HaloRepository haloRepository;
public HaloEntity addHalo(String name) {
var haloEntity = new HaloEntity(UUID.randomUUID().toString(), name);
return haloRepository.save(haloEntity);
}
public HaloEntity getHalo(String id) {
return haloRepository.findById(id).orElseThrow();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment