Skip to content

Commit

Permalink
Merge pull request #74 from NewsFit-jolp/fix/comment
Browse files Browse the repository at this point in the history
fix: 테스트 api 작성
  • Loading branch information
k000927 authored Nov 13, 2024
2 parents b763898 + 73462bd commit 102996e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,11 @@ public String recommendArticles(@RequestParam(value = "page", required = false,
public SuccessResponse<List<GetArticles>> getHeadLine() throws JsonProcessingException {
return SuccessResponse.success(articleService.getHeadLine());
}


@GetMapping("/test/{articleId}")
public String getArticleTest(@PathVariable("articleId") String articleId){
return articleService.getTest(articleId);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.example.newsfit.global.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.*;
import org.hibernate.annotations.ColumnDefault;

import java.time.LocalDateTime;
Expand All @@ -16,6 +13,7 @@

@Entity
@Getter
@ToString
@NoArgsConstructor
public class Article extends BaseEntity {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,9 @@ public List<GetArticles> getHeadLine() throws JsonProcessingException {
}
return getArticles;
}

public String getTest(String articleId){
return articleRepository.findById(Long.parseLong(articleId)).get().toString();
}
}

0 comments on commit 102996e

Please sign in to comment.