깃헙 백업 연동

This commit is contained in:
jinia91
2021-12-17 17:04:50 +09:00
parent 87bd90fb5b
commit c0ab4a020d
4 changed files with 6 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ public class ArticleController {
}
Long articleId = articleService.writeArticle(articleForm, principal.getMember());
// articleService.pushArticleToGithub(article);
articleService.pushArticleToGithub(articleId);
tempArticleService.deleteTemp();
return "redirect:/article/view?articleId=" + articleId;

View File

@@ -179,8 +179,9 @@ public class ArticleService {
/*
- 깃헙에 아티클 푸시하기
*/
public void pushArticleToGithub(Article article) {
public void pushArticleToGithub(Long articleId) {
try {
Article article = articleRepository.findById(articleId).get();
GitHub gitHub = new GitHubBuilder().withOAuthToken(gitToken).build();
GHRepository repository = gitHub.getRepository(gitRepo);
repository.createContent()

View File

@@ -16,6 +16,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@Service
@RequiredArgsConstructor
@@ -37,7 +38,7 @@ public class SiteMapService {
public String makeSiteMap(){
List<Article> articles = articleService.getTotalArticle();
List<Category> allCategories = categoryService.getAllCategories();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss Z", Locale.ENGLISH);
// siteMap 레이아웃 루트 작성
Element siteMap = new Element("urlset", NAMESPACE);

View File

@@ -50,7 +50,7 @@
<div class="col m-2">
<a href="/oauth2/authorization/naver">
<button class="btnCtm btn-naver">네이버 로그인</button>
<button class="btnCtm btn-naver">네이버 로그인<div>(검토중)</div></button>
</a>
</div>
</div>