-
Notifications
You must be signed in to change notification settings - Fork 5
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 #225 from readyvery/test
3/25 배포 최종
- Loading branch information
Showing
13 changed files
with
112 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
4 changes: 4 additions & 0 deletions
4
src/main/java/com/readyvery/readyverydemo/domain/repository/PointRepository.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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
package com.readyvery.readyverydemo.domain.repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.readyvery.readyverydemo.domain.Order; | ||
import com.readyvery.readyverydemo.domain.Point; | ||
import com.readyvery.readyverydemo.domain.UserInfo; | ||
|
||
public interface PointRepository extends JpaRepository<Point, Long> { | ||
List<Point> findAllByUserInfo(UserInfo userInfo); | ||
|
||
Optional<Point> findByOrder(Order order); | ||
} |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/readyvery/readyverydemo/src/point/PointServiceFacade.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,34 @@ | ||
package com.readyvery.readyverydemo.src.point; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import com.readyvery.readyverydemo.domain.Order; | ||
import com.readyvery.readyverydemo.domain.Point; | ||
import com.readyvery.readyverydemo.domain.UserInfo; | ||
import com.readyvery.readyverydemo.domain.repository.PointRepository; | ||
import com.readyvery.readyverydemo.global.exception.BusinessLogicException; | ||
import com.readyvery.readyverydemo.global.exception.ExceptionCode; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class PointServiceFacade { | ||
private final PointRepository pointRepository; | ||
|
||
public List<Point> findAllByUserInfo(UserInfo userInfo) { | ||
return pointRepository.findAllByUserInfo(userInfo); | ||
} | ||
|
||
public Point getPointByOrder(Order order) { | ||
return pointRepository.findByOrder(order) | ||
.orElseThrow(() -> new BusinessLogicException(ExceptionCode.POINT_NOT_FOUND)); | ||
} | ||
|
||
public void cancelPoint(Point point) { | ||
point.setIsDeleted(true); | ||
pointRepository.save(point); | ||
} | ||
} |
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