Skip to content

Commit a1827bf

Browse files
committed
refactor(UserServiceImpl): 优化 createUser 方法的文档注释
-移除了 unused 参数 mailService 的文档注释 - 为 createUser 方法添加了更详细的文档注释,包括参数说明和方法功能描述
1 parent d15d18e commit a1827bf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/app/login/service/impl/UserServiceImpl.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public UserServiceImpl(UserRepository userRepository, PasswordEncoder passwordEn
8181
* @param managedUserVM managedUserVM
8282
* @param textPlainHeaders textPlainHeaders
8383
* @param ipAddress ipAddress
84-
* @param mailService mailService
8584
* @return
8685
*/
8786
@Override
@@ -227,6 +226,16 @@ public User createUser(ManagedUserVM managedUserVM,Instant createdDate, String i
227226
return newUser;
228227
}
229228

229+
/**
230+
* Creates a new user based on the provided user DTO.
231+
*
232+
* @param userDTO The data transfer object containing the user information, must not be null.
233+
* @return The created User entity.
234+
*
235+
* This method first checks if the provided userDTO is null, throwing a NullPointerException if it is.
236+
* It then validates the userDTO using the validation facade. After validation, it creates a new User object,
237+
* sets its properties based on the userDTO, and handles default values and many-to-many relationships.
238+
*/
230239
@Override
231240
public User createUser(UserDTO userDTO) {
232241
Objects.requireNonNull(userDTO);

0 commit comments

Comments
 (0)