Class AdminService
java.lang.Object
com.goldenleaf.shop.service.AdminService
Service class providing business logic for working with
Admin entities.
This service interacts with the AdminRepository to retrieve and remove
admin accounts using a unique secret word.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAdminBySecretWord(String secretWord) Finds anAdminby its secret word.voidremoveAdminBySecretWord(String secretWord) Deletes anAdminidentified by its secret word.
-
Constructor Details
-
AdminService
Creates an instance ofAdminService.- Parameters:
repo- the repository used to perform CRUD operations on admin entities- Throws:
IllegalArgumentException- ifrepoisnull- See Also:
-
-
Method Details
-
getAdminBySecretWord
Finds anAdminby its secret word.- Parameters:
secretWord- the secret word used to identify the admin- Returns:
- the matching
Admin - Throws:
RuntimeException- if no admin with the provided secret word exists- See Also:
-
removeAdminBySecretWord
Deletes anAdminidentified by its secret word.- Parameters:
secretWord- the secret word of the admin to delete- Throws:
RuntimeException- if no admin with the given secret word is found- See Also:
-