diff --git a/src/main/java/com/libraryman_api/borrowing/BorrowingController.java b/src/main/java/com/libraryman_api/borrowing/BorrowingController.java
index aae9d5b..2c36af8 100644
--- a/src/main/java/com/libraryman_api/borrowing/BorrowingController.java
+++ b/src/main/java/com/libraryman_api/borrowing/BorrowingController.java
@@ -67,6 +67,7 @@ public Page This method takes a MembersDto object and transforms it into a Members entity
* to be used in database operations. It maps all relevant member details from
- * the DTO, including member ID, role, name, email, password, and membership date.
This method takes a Members entity object and converts it into a MembersDto * object to be used for data transfer between layers. It maps all necessary - * member details, including member ID, name, role, email, password, and membership + * member details, including member ID, name, username, role, email, password, and membership * date, from the entity to the DTO.
* * @param members the entity object containing member information * @return a MembersDto object with data populated from the entity */ - - public MembersDto EntityToDto(Members members){ MembersDto membersDto= new MembersDto(); membersDto.setMemberId(members.getMemberId()); membersDto.setName(members.getName()); + membersDto.setUsername(members.getUsername()); membersDto.setRole(members.getRole()); membersDto.setEmail(members.getEmail()); membersDto.setPassword(members.getPassword()); diff --git a/src/main/java/com/libraryman_api/member/MembersDto.java b/src/main/java/com/libraryman_api/member/MembersDto.java index d4f67fe..93a7c73 100644 --- a/src/main/java/com/libraryman_api/member/MembersDto.java +++ b/src/main/java/com/libraryman_api/member/MembersDto.java @@ -4,10 +4,11 @@ public class MembersDto { - private int memberId; private String name; + + private String username; private String email; @@ -19,9 +20,10 @@ public class MembersDto { private Date membershipDate; - public MembersDto(int memberId, String name, String email, String password, Role role, Date membershipDate) { + public MembersDto(int memberId, String name, String username, String email, String password, Role role, Date membershipDate) { this.memberId = memberId; this.name = name; + this.username = username; this.email = email; this.password = password; this.role = role; @@ -42,10 +44,18 @@ public void setMemberId(int memberId) { public String getName() { return name; } + + public String getUsername() { + return username; + } public void setName(String name) { this.name = name; } + + public void setUsername(String username) { + this.username = username; + } public String getEmail() { return email; @@ -84,6 +94,7 @@ public String toString() { return "MembersDto{" + "memberId=" + memberId + ", name='" + name + '\'' + + ", username='" + username + '\'' + ", email='" + email + '\'' + ", password='" + password + '\'' + ", role=" + role + diff --git a/src/main/resources/application-production.properties b/src/main/resources/application-production.properties index 871f3b5..3e13ee0 100644 --- a/src/main/resources/application-production.properties +++ b/src/main/resources/application-production.properties @@ -19,4 +19,4 @@ spring.mail.properties.domain_name=${MAIL_SERVICE_DOMAIN_NAME} spring.security.oauth2.client.registration.google.client-name=google spring.security.oauth2.client.registration.google.client-id=${YOUR_CLIENT_ID} spring.security.oauth2.client.registration.google.client-secret=${YOUR_SECRET_KEY} -spring.security.oauth2.client.registration.google.scope=email,profile +spring.security.oauth2.client.registration.google.scope=email,profile \ No newline at end of file