-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93c8978
commit dc7a99c
Showing
6 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
src/main/java/org/daming/hoteler/repository/jdbc/IUserDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
package org.daming.hoteler.repository.jdbc; | ||
|
||
import org.daming.hoteler.base.exceptions.HotelerException; | ||
import org.daming.hoteler.pojo.User; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface IUserDao { | ||
|
||
Optional<User> getUserByUsername(String username); | ||
Optional<User> getUserByUsername(String username) throws HotelerException; | ||
|
||
Optional<User> get(long id); | ||
Optional<User> get(long id) throws HotelerException; | ||
|
||
List<User> getUnlockUsers(); | ||
List<User> getUnlockUsers() throws HotelerException; | ||
|
||
void delete(long id) throws HotelerException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
src/main/java/org/daming/hoteler/service/IUserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
package org.daming.hoteler.service; | ||
|
||
import org.daming.hoteler.base.exceptions.HotelerException; | ||
import org.daming.hoteler.pojo.User; | ||
import org.daming.hoteler.pojo.request.CreateUserRequest; | ||
|
||
import java.util.List; | ||
|
||
public interface IUserService { | ||
|
||
List<User> list(); | ||
List<User> list() throws HotelerException; | ||
|
||
User getUserByUsername(String username); | ||
User getUserByUsername(String username) throws HotelerException; | ||
|
||
User get(long id); | ||
User get(long id) throws HotelerException; | ||
|
||
void create(User user); | ||
void create(User user) throws HotelerException; | ||
|
||
User create(CreateUserRequest createUserRequest); | ||
User create(CreateUserRequest createUserRequest) throws HotelerException; | ||
|
||
void loginFailed(User user); | ||
void loginFailed(User user) throws HotelerException; | ||
|
||
void resetFailedAttempts(User user); | ||
void resetFailedAttempts(User user) throws HotelerException; | ||
|
||
boolean isAccountLocked(long id); | ||
boolean isAccountLocked(long id) throws HotelerException; | ||
|
||
boolean isAccountLocked(User user); | ||
boolean isAccountLocked(User user) throws HotelerException; | ||
|
||
List<User> getUnlockUsers(); | ||
List<User> getUnlockUsers() throws HotelerException; | ||
|
||
void delete(long id) throws HotelerException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters