-
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 pull request #78 from connecSWUn/fix/my-page
Fix/my page
- Loading branch information
Showing
44 changed files
with
590 additions
and
77 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
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
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
35 changes: 35 additions & 0 deletions
35
...swulab/eatswunee/domain/notification/adapter/out/persistence/OrderNotificationMapper.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,35 @@ | ||
package com.swulab.eatswunee.domain.notification.adapter.out.persistence; | ||
|
||
import com.swulab.eatswunee.domain.notification.adapter.out.persistence.jpa.model.OrderNotificationJpaEntity; | ||
import com.swulab.eatswunee.domain.notification.domain.model.NotificationCategory; | ||
import com.swulab.eatswunee.domain.notification.domain.model.OrderNotification; | ||
import com.swulab.eatswunee.domain.order.adapter.out.persistence.OrderMapper; | ||
import com.swulab.eatswunee.domain.restaurant.adapter.out.persistence.RestaurantMapper; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class OrderNotificationMapper { | ||
|
||
private final OrderMapper orderMapper; | ||
private final RestaurantMapper restaurantMapper; | ||
|
||
public OrderNotification mapToDomainEntity(OrderNotificationJpaEntity notificationJpaEntity) { | ||
return new OrderNotification(notificationJpaEntity.getId(), | ||
notificationJpaEntity.getNotificationContent(), | ||
notificationJpaEntity.getNotificationIsRead(), | ||
notificationJpaEntity.getCreatedAt(), | ||
"", | ||
orderMapper.mapToDomainEntity(notificationJpaEntity.getOrderJpaEntity()), | ||
restaurantMapper.mapToDomainEntity(notificationJpaEntity.getRestaurantJpaEntity()), | ||
NotificationCategory.REQUEST_ORDER); | ||
} | ||
|
||
public OrderNotificationJpaEntity mapToJpaEntity(OrderNotification notification) { | ||
return new OrderNotificationJpaEntity(notification.getNotificationId(), | ||
"주문", "", true, null, | ||
orderMapper.mapToJpaEntity(notification.getOrder()), | ||
restaurantMapper.mapToJpaEntity(notification.getRestaurant())); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...wunee/domain/notification/adapter/out/persistence/jpa/OrderNotificationJpaRepository.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,10 @@ | ||
package com.swulab.eatswunee.domain.notification.adapter.out.persistence.jpa; | ||
|
||
import com.swulab.eatswunee.domain.notification.adapter.out.persistence.jpa.model.OrderNotificationJpaEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface OrderNotificationJpaRepository extends JpaRepository<OrderNotificationJpaEntity, Long> { | ||
|
||
@Override | ||
<S extends OrderNotificationJpaEntity> S save(S entity); | ||
} |
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
9 changes: 9 additions & 0 deletions
9
...m/swulab/eatswunee/domain/notification/application/port/in/SaveOrderNotificationPort.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,9 @@ | ||
package com.swulab.eatswunee.domain.notification.application.port.in; | ||
|
||
import com.swulab.eatswunee.domain.notification.domain.model.OrderNotification; | ||
import java.util.List; | ||
|
||
public interface SaveOrderNotificationPort { | ||
|
||
void saveAll(List<OrderNotification> orderNotifications); | ||
} |
1 change: 0 additions & 1 deletion
1
.../swulab/eatswunee/domain/notification/application/port/out/FindOrderNotificationPort.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
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
18 changes: 18 additions & 0 deletions
18
...main/java/com/swulab/eatswunee/domain/notification/domain/model/NotificationCategory.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 com.swulab.eatswunee.domain.notification.domain.model; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum NotificationCategory { | ||
|
||
REQUEST_ORDER("주문번호 %d"), | ||
ORDER_ARRIVED("음식 준비가 완료되었습니다."), | ||
PLACING_ORDER("주문번호 %d"), | ||
CHAT_ARRIVE("%s님이 메시지를 보냈습니다."); | ||
|
||
private String message; | ||
|
||
NotificationCategory(String message) { | ||
this.message = message; | ||
} | ||
} |
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.