Skip to content

Commit

Permalink
Fixing Repository Id from Long to String (#55)
Browse files Browse the repository at this point in the history
* added DTO mapper for Users Model

* added auto generated DTOs, and APIs are now returning DTOs

* adding mapper for different models and making sure API return only DTOs

* tried refactoring user-service and model repos

* added new DTOs for the db models

* added DAO to DTO Mappers but having problem in package initialization, hence in compilation.

* Moved mapper and DTOs to gamedoora-model

* refactoring packages

* minor refactoring

* added configs for running the application

* changed private fields to setter based autowiring

* refactored naming convention in UserController and added test classes

* updated UserRepositoryTest and its configs

* updated test repository imports

* updates and resolving conflicts

* Updated test repository

* updating Repository id from Long to String

* fixing repository method
  • Loading branch information
picksitquick authored Feb 23, 2024
1 parent a8c1491 commit 4c112fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public List<RoleDTO> getAllRolesBySkillName(String name) {

public List<RoleDTO> getRolesByUserEmail(String email){

return rolesRepository.findByUsers_Email(email).stream().map(
return rolesRepository.findByUsers_EmailId(email).stream().map(
roles -> getRolesMapper().roleToRoleDto(roles)
).collect(Collectors.toList()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public UserDTO updateUsers(String emailId, UserDTO userDto) {

public void deleteUsers(String emailId) {
userOperationsHelper.deleteUser(emailId);
getUsersRepository().deleteByEmailId(emailId);
getUsersRepository().deleteById(emailId);
}

public void deleteAllUsers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public interface RolesRepository extends JpaRepository<Roles, Long> {

List<Roles> findBySkills_Name(String name);

List<Roles> findByUsers_Email(String email);
List<Roles> findByUsers_EmailId(String emailId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.gamedoora.model.dao.Users;

@Repository
public interface UsersRepository extends JpaRepository<Users, Long> {
public interface UsersRepository extends JpaRepository<Users, String> {

List<Users> findByEmailContaining(String emailId);

Expand All @@ -25,6 +25,4 @@ public interface UsersRepository extends JpaRepository<Users, Long> {
List<Users> findByRole_Name(String name);

List<Users> findByStudiosSet_EmailId(String emailId);

void deleteByEmailId(String emailId);
}

0 comments on commit 4c112fa

Please sign in to comment.