-
Notifications
You must be signed in to change notification settings - Fork 1
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 #16 from olmangjolmang/OMJM-76-post_scrap
게시글 스크랩/스크랩 취소 기능 구현
- Loading branch information
Showing
14 changed files
with
171 additions
and
71 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
4 changes: 0 additions & 4 deletions
4
src/main/java/com/ticle/server/scrapped/controller/ScrappedApiController.java
This file was deleted.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/ticle/server/scrapped/dto/ScrappedDto.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,26 @@ | ||
package com.ticle.server.scrapped.dto; | ||
|
||
import com.ticle.server.scrapped.domain.Scrapped; | ||
import lombok.*; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class ScrappedDto { | ||
|
||
private Long userId; | ||
private Long postId; | ||
private String postName; | ||
private String status; | ||
|
||
public static ScrappedDto from(Scrapped scrapped) { | ||
return ScrappedDto.builder() | ||
.userId(scrapped.getUser().getId()) | ||
.postId(scrapped.getPost().getPostId()) | ||
.postName(scrapped.getPost().getTitle()) | ||
.status(scrapped.getStatus()) | ||
.build(); | ||
} | ||
|
||
} |
10 changes: 9 additions & 1 deletion
10
src/main/java/com/ticle/server/scrapped/repository/ScrappedRepository.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,4 +1,12 @@ | ||
package com.ticle.server.scrapped.repository; | ||
|
||
public class ScrappedRepository { | ||
import com.ticle.server.scrapped.domain.Scrapped; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
|
||
public interface ScrappedRepository extends JpaRepository<Scrapped, Long> { | ||
Optional<Scrapped> findByUserIdAndPost_PostId(Long userId, Long postId); | ||
|
||
} |
4 changes: 0 additions & 4 deletions
4
src/main/java/com/ticle/server/scrapped/service/ScrappedService.java
This file was deleted.
Oops, something went wrong.
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.