Skip to content

Commit

Permalink
#37-storeManager가 관리하는 store 연결 (1:1)
Browse files Browse the repository at this point in the history
- response에서 password 삭제
  • Loading branch information
chanwooo committed Nov 13, 2022
1 parent 5eb3735 commit 5f19da2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main/java/flab/quing/user/StoreManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package flab.quing.user;

import flab.quing.entity.BaseEntity;
import flab.quing.store.Store;
import flab.quing.user.dto.StoreManagerResponse;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand All @@ -10,6 +11,7 @@
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.OneToOne;


@Data
Expand All @@ -28,12 +30,15 @@ public class StoreManager extends BaseEntity {

private String name;

@OneToOne
private Store store;

public StoreManagerResponse toResponse() {
StoreManagerResponse storeManagerResponse = StoreManagerResponse.builder()
.loginId(loginId)
.password(encryptedPassword)
.phoneNumber(phoneNumber)
.name(name)
.storeId(store.getId())
.build();
return storeManagerResponse;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
public class StoreManagerResponse {

private String loginId;
private String password;
private String phoneNumber;
private String name;
private long storeId;

}

0 comments on commit 5f19da2

Please sign in to comment.