-
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.
[FEATURE] 팝업스토어 게시글 스크랩 관련 기능 구현 (#13)
* [FEAT] 팝업스토어 게시글 스크랩 기능 구현 * [REFACTOR] profile 설정 및 Github Actions 적용 (#12) * [REFACTOR] profile 에 따라 properties 파일 분리 * [CHORE] Dockerfile 설정 추가 * [CHORE] Github Actions 파일 작성 * [CHORE] 프로젝트 기본 설정 추가 * [CHORE] Github Actions 폴더 공백 제거 * [CHORE] Github Actions 시 Maven 빌드로 수정 * [CHORE] Github Actions 시 sudo 권한 추가 * [CHORE] Github Actions 시 push 브랜치 변경 * [REFACTOR] 팝업스토어 게시글 리스트 조회 선택 채임 mapper 로 변경 * [FEAT] 스크랩한 팝업스토어 게시글 리스트 조회 기능 구현 * [FIX] repository 계층 추가에 따라 실패하는 테스트 코드 수정
- Loading branch information
Showing
15 changed files
with
456 additions
and
45 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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/oya/kr/popup/mapper/PopupCollectionMapper.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.oya.kr.popup.mapper; | ||
|
||
import java.util.Optional; | ||
|
||
import com.oya.kr.popup.mapper.dto.request.PopupCollectionMapperRequest; | ||
import com.oya.kr.popup.mapper.dto.request.PopupCollectionSaveMapperRequest; | ||
import com.oya.kr.popup.mapper.dto.response.PopupCollectionMapperResponse; | ||
|
||
public interface PopupCollectionMapper { | ||
|
||
Optional<PopupCollectionMapperResponse> findByPopupIdAndUserId(PopupCollectionMapperRequest request); | ||
|
||
void save(PopupCollectionSaveMapperRequest request); | ||
|
||
void deleteById(Long id); | ||
|
||
void deleteAll(); | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/oya/kr/popup/mapper/dto/request/PopupCollectionMapperRequest.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,12 @@ | ||
package com.oya.kr.popup.mapper.dto.request; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class PopupCollectionMapperRequest { | ||
|
||
private final Long userId; | ||
private final Long popupId; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/oya/kr/popup/mapper/dto/request/PopupCollectionSaveMapperRequest.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,13 @@ | ||
package com.oya.kr.popup.mapper.dto.request; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class PopupCollectionSaveMapperRequest { | ||
|
||
private long popupCollectionId; | ||
private final Long userId; | ||
private final Long popupId; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/oya/kr/popup/mapper/dto/response/PopupCollectionMapperResponse.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,13 @@ | ||
package com.oya.kr.popup.mapper.dto.response; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class PopupCollectionMapperResponse { | ||
|
||
private long id; | ||
private final long userId; | ||
private final long popupId; | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/resources/com/oya/kr/popup/mapper/PopupCollectionMapper.xml
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="com.oya.kr.popup.mapper.PopupCollectionMapper"> | ||
|
||
<select id="findByPopupIdAndUserId" parameterType="popupCollectionMapperRequest" resultType="popupCollectionMapperResponse"> | ||
SELECT ID, USER_ID, POPUP_ID | ||
FROM POPUP_COLLECTION | ||
WHERE POPUP_ID = #{popupId} | ||
AND USER_ID = #{userId} | ||
AND DELETED = 0 | ||
</select> | ||
|
||
<insert id="save" parameterType="popupCollectionMapperRequest"> | ||
INSERT INTO POPUP_COLLECTION (USER_ID, POPUP_ID) | ||
VALUES (#{userId}, #{popupId}) | ||
<selectKey keyProperty="popupCollectionId" resultType="long" order="AFTER"> | ||
SELECT NVL(MAX(ID), 0) | ||
FROM POPUP_COLLECTION | ||
</selectKey> | ||
</insert> | ||
|
||
<delete id="deleteById" parameterType="Long"> | ||
DELETE FROM POPUP_COLLECTION | ||
WHERE ID = #{id} | ||
</delete> | ||
|
||
<delete id="deleteAll"> | ||
DELETE | ||
FROM POPUP_COLLECTION | ||
</delete> | ||
|
||
</mapper> |
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.