Optimize UserConverter

This commit is contained in:
2023-11-29 11:44:22 +08:00
parent 3d178aa8fe
commit 929c01f98f

View File

@@ -154,8 +154,8 @@ object UserConverter {
avatar = userUpdateParam.avatar avatar = userUpdateParam.avatar
email = userUpdateParam.email email = userUpdateParam.email
} }
roles = userUpdateParam.roleIds?.map { Role().apply { id = it } } roles = if (userUpdateParam.id != 0L) userUpdateParam.roleIds?.map { Role().apply { id = it } } else null
groups = userUpdateParam.groupIds?.map { Group().apply { id = it } } groups = if (userUpdateParam.id != 0L) userUpdateParam.groupIds?.map { Group().apply { id = it } } else null
} }
fun userPageToUserWithRoleInfoPageVo(userPage: IPage<User>) = PageVo( fun userPageToUserWithRoleInfoPageVo(userPage: IPage<User>) = PageVo(