-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/update-InitDb(#78)
- Loading branch information
Showing
25 changed files
with
388 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...java/iampotato/iampotato/domain/customer/application/GetUnauthorizedCustomersService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package iampotato.iampotato.domain.customer.application; | ||
|
||
|
||
import iampotato.iampotato.domain.customer.dao.CustomerRepository; | ||
import iampotato.iampotato.domain.customer.domain.Customer; | ||
import iampotato.iampotato.domain.customer.dto.UnauthorizedCustomer; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class GetUnauthorizedCustomersService { | ||
private final CustomerRepository customerRepository; | ||
|
||
public List<Customer> getUnauthorizedCustomers() { | ||
List<Customer> unauthorizedCustomers = customerRepository.findUnauthorizedCustomers(); | ||
return unauthorizedCustomers; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/iampotato/iampotato/domain/customer/dto/UnauthorizedCustomer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package iampotato.iampotato.domain.customer.dto; | ||
|
||
import iampotato.iampotato.domain.customer.domain.CustomerImage; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class UnauthorizedCustomer { | ||
private String id; | ||
private String customerNumber; | ||
private String customerDept; | ||
private String customerCollege; | ||
private CustomerImage customerImage; | ||
|
||
public UnauthorizedCustomer(String id, String customerNumber, String customerDept, String customerCollege, CustomerImage customerImage) { | ||
this.id = id; | ||
this.customerNumber = customerNumber; | ||
this.customerDept = customerDept; | ||
this.customerCollege = customerCollege; | ||
this.customerImage = customerImage; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/iampotato/iampotato/domain/owner/dao/OwnerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package iampotato.iampotato.domain.owner.dao; | ||
|
||
import iampotato.iampotato.domain.owner.domain.Owner; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import javax.persistence.EntityManager; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class OwnerRepository { | ||
|
||
private final EntityManager em; | ||
|
||
public Owner findById(String id) { | ||
return em.find(Owner.class, id); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/iampotato/iampotato/domain/ownerstore/application/OwnerStoreService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package iampotato.iampotato.domain.ownerstore.application; | ||
|
||
import iampotato.iampotato.domain.owner.domain.Owner; | ||
import iampotato.iampotato.domain.ownerstore.dao.OwnerStoreRepository; | ||
import iampotato.iampotato.domain.ownerstore.domain.OwnerStore; | ||
import iampotato.iampotato.domain.store.domain.Store; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class OwnerStoreService { | ||
|
||
private final OwnerStoreRepository ownerStoreRepository; | ||
|
||
@Transactional | ||
public void registerOwnerStore(Store store, Owner owner) { | ||
|
||
OwnerStore ownerStore = OwnerStore.builder() | ||
.store(store) | ||
.owner(owner) | ||
.build(); | ||
|
||
ownerStoreRepository.save(ownerStore); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/iampotato/iampotato/domain/ownerstore/dao/OwnerStoreRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package iampotato.iampotato.domain.ownerstore.dao; | ||
|
||
import iampotato.iampotato.domain.ownerstore.domain.OwnerStore; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import javax.persistence.EntityManager; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class OwnerStoreRepository { | ||
|
||
private final EntityManager em; | ||
|
||
public void save(OwnerStore ownerStore) { | ||
em.persist(ownerStore); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.