Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from FinFellows/develop
Browse files Browse the repository at this point in the history
[FIX]: contents request 수정
  • Loading branch information
LEEJaeHyeok97 authored Jan 9, 2024
2 parents 38f1ccf + f2ada4a commit 88c8b69
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public interface EduContentBookmarkRepository extends JpaRepository<EduContentBo
List<EduContentBookmark> findAllByUser(User user);

boolean existsByUser_IdAndEduContent_Id(Long userId, Long id);
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class EduContentService {
private final EduContentBookmarkRepository eduContentBookmarkRepository;

@Transactional
public EduContent createEduContent(EduContentResponse request) {
public EduContent createEduContent(EduContentRequest request) {
Post post = new Post();
postRepository.save(post);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class EduContentRequest {
private Long id;
private LocalDateTime created_at;
private String title;
private String content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class EduContentController {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = EduContentResponse.class)))
})
@PostMapping("")
public ResponseEntity<EduContent> saveEduContent(@RequestBody EduContentResponse request) {
public ResponseEntity<EduContent> saveEduContent(@RequestBody EduContentRequest request) {
EduContent response = eduContentService.createEduContent(request);
return new ResponseEntity<>(response, HttpStatus.CREATED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class NewsContentService {
private final EduContentBookmarkRepository eduContentBookmarkRepository;

@Transactional
public NewsContent createNewsContent(NewsContentResponse request) {
public NewsContent createNewsContent(NewsContentRequest request) {
Post post = new Post();
postRepository.save(post);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class NewsContentRequest {
private Long id;
private LocalDateTime created_at;
private String title;
private String content;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class NewsContentController {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NewsContentResponse.class)))
})
@PostMapping("")
public ResponseEntity<NewsContent> saveNewsContent(@RequestBody NewsContentResponse request) {
public ResponseEntity<NewsContent> saveNewsContent(@RequestBody NewsContentRequest request) {
NewsContent response = newsContentService.createNewsContent(request);
return new ResponseEntity<>(response, HttpStatus.CREATED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ContentService {
private final PostRepository postRepository;

@Transactional
public Content createContent(ContentResponse request) {
public Content createContent(ContentRequest request) {
Post post = new Post();
postRepository.save(post);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class ContentRequest {
private Long id;
private LocalDateTime created_at;
private String title;
private String content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ContentController {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = ContentResponse.class)))
})
@PostMapping("")
public ResponseEntity<com.finfellows.domain.post.domain.Content> saveContent(@RequestBody ContentResponse request) {
public ResponseEntity<com.finfellows.domain.post.domain.Content> saveContent(@RequestBody ContentRequest request) {
com.finfellows.domain.post.domain.Content response = contentService.createContent(request);
return new ResponseEntity<>(response, HttpStatus.CREATED);
}
Expand Down

0 comments on commit 88c8b69

Please sign in to comment.