Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/#1429-article-front-merge-featur…
Browse files Browse the repository at this point in the history
…e-branch
  • Loading branch information
Creative-Lee authored Jul 20, 2023
2 parents 9311017 + f3ea20a commit 6545260
Show file tree
Hide file tree
Showing 369 changed files with 6,963 additions and 4,480 deletions.
1 change: 0 additions & 1 deletion .github/workflows/back-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
mkdir -p deploy
cp build/libs/*.jar deploy/application.jar
cp -r .ebextensions deploy/.ebextensions
cp -r deploy-config deploy
cd deploy && zip -r deploy.zip .
- name: Deploy to EB
Expand Down
48 changes: 48 additions & 0 deletions backend/.ebextensions/02-set-filebeat.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
files:
"/tmp/make_filebeat_yml.sh":
mode: "000755"
content: |
#!/bin/bash
PASSWORD=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PASSWORD)
HOST=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_HOST)
PORT=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PORT)
USER=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_USER)
cat > /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat.yml <<EOF
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/app/current/logs/info/info.log
- /var/app/current/logs/error/error.log
- /var/app/current/logs/warn/*.log
fields:
log_type: legacy-log
- type: log
enabled: true
paths:
- /var/log/nginx/access.log
fields:
log_type: access-log

output.elasticsearch:
hosts: ["$HOST:$PORT"]
username: "$USER"
password: "$PASSWORD"
indices:
- index: "filebeat-%{[agent.version]}-access-log"
when.equals:
fields.log_type: "access-log"
- index: "filebeat-%{[agent.version]}-legacy-log"
when.equals:
fields.log_type: "legacy-log"
EOF

commands:
01_install_filebeat:
command: |
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.14.1-linux-x86_64.tar.gz
tar xzvf filebeat-7.14.1-linux-x86_64.tar.gz
02_run_make_filebeat_yml_script:
command: "bash /tmp/make_filebeat_yml.sh"
03_run_filebeat_yml:
command: "nohup /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat -e &"
10 changes: 0 additions & 10 deletions backend/.ebextensions/02-set-promtail.config

This file was deleted.

46 changes: 0 additions & 46 deletions backend/deploy-config/promtail-local-config.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
import io.restassured.http.ContentType;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope(scopeName = "cucumber-glue")
Expand Down Expand Up @@ -65,7 +64,8 @@ public void invokeHttpGetWithToken(String path, Object... pathParams) {
response.then().log().all();
}

public void invokeHttpGetWithTokenAndCookies(String path, Map<String, ?> cookies, Object... pathParams) {
public void invokeHttpGetWithTokenAndCookies(String path, Map<String, ?> cookies,
Object... pathParams) {
request = RestAssured.given().log().all()
.cookies(cookies)
.auth().oauth2(accessToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package wooteco.prolog.fixtures;

import wooteco.prolog.article.ui.ArticleRequest;

public class ArticleFixture {
public static final ArticleRequest ARTICLE_REQUEST1 = new ArticleRequest("첫 아티클 제목","첫 아티클 주소");
public static final ArticleRequest ARTICLE_REQUEST2 = new ArticleRequest("두번째 아티클 제목","두번째 아티클 주소");
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public enum GithubResponses {
수달("7", "access_token_7", "수달", "her0807", "777777",
"https://avatars.githubusercontent.com/u/26570275?v=4");

private String code;
private String accessToken;
private String name;
private String login;
private String id;
private String avatarUrl;
private final String code;
private final String accessToken;
private final String name;
private final String login;
private final String id;
private final String avatarUrl;

GithubResponses(String code, String accessToken, String name, String login, String id,
String avatarUrl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public ResponseEntity<GithubProfileResponse> user(
String accessToken = authorization.split(" ")[1];
GithubResponses githubResponse = GithubResponses.findByToken(accessToken);
GithubProfileResponse response = new GithubProfileResponse(githubResponse.getName(),
githubResponse.getLogin(),
githubResponse.getId(),
githubResponse.getAvatarUrl());
githubResponse.getLogin(),
githubResponse.getId(),
githubResponse.getAvatarUrl());
return ResponseEntity.ok(response);
}
}
Original file line number Diff line number Diff line change
@@ -1,68 +1,72 @@
package wooteco.prolog.fixtures;

import wooteco.prolog.studylog.application.dto.StudylogRequest;
import wooteco.prolog.studylog.application.dto.TagRequest;
import static java.util.stream.Collectors.toList;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG1;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG2;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG3;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG4;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG5;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG6;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;
import static wooteco.prolog.fixtures.TagAcceptanceFixture.*;
import wooteco.prolog.studylog.application.dto.StudylogRequest;
import wooteco.prolog.studylog.application.dto.TagRequest;

public enum PostAcceptanceFixture {
POST1(
"[자바][옵셔널] 학습log 제출합니다.",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
"[자바][옵셔널] 학습log 제출합니다.",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
),
POST2(
"[자바스크립트][비동기] 학습log 제출합니다.",
"모던 JS의 fetch문, ajax라이브러리인 axios등을 통해 비동기 요청을 \n " +
"편하게 할 수 있습니다. 자바 최고",
2L,
TAG3,
TAG4
"[자바스크립트][비동기] 학습log 제출합니다.",
"모던 JS의 fetch문, ajax라이브러리인 axios등을 통해 비동기 요청을 \n " +
"편하게 할 수 있습니다. 자바 최고",
2L,
TAG3,
TAG4
),
POST3(
"[자료구조] 자료구조는 어려워요",
"진짜 어려움",
1L,
TAG1,
TAG5
"[자료구조] 자료구조는 어려워요",
"진짜 어려움",
1L,
TAG1,
TAG5
),
POST4(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L
),
POST5(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
TAG5,
TAG6
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
TAG5,
TAG6
),
POST6(
"새로운 스터디로그",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
"새로운 스터디로그",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
);

PostAcceptanceFixture(
String title,
String content,
Long missionId,
TagAcceptanceFixture... tags) {
String title,
String content,
Long missionId,
TagAcceptanceFixture... tags) {
this.tags = Arrays.asList(tags);
List<TagRequest> tagRequests = Arrays.stream(tags)
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
this.studylogRequest = new StudylogRequest(title, content, missionId, tagRequests);
}

Expand All @@ -75,15 +79,15 @@ public StudylogRequest getPostRequest() {

public static List<StudylogRequest> findByMissionNumber(Long missionId) {
return Arrays.stream(PostAcceptanceFixture.values())
.map(PostAcceptanceFixture::getPostRequest)
.filter(it -> it.getMissionId().equals(missionId))
.collect(toList());
.map(PostAcceptanceFixture::getPostRequest)
.filter(it -> it.getMissionId().equals(missionId))
.collect(toList());
}

public static List<StudylogRequest> findByTagNumber(Long tagId) {
return Arrays.stream(PostAcceptanceFixture.values())
.filter(it -> it.tags.stream().anyMatch(tag -> tag.getTagId().equals(tagId)))
.map(PostAcceptanceFixture::getPostRequest)
.collect(toList());
.filter(it -> it.tags.stream().anyMatch(tag -> tag.getTagId().equals(tagId)))
.map(PostAcceptanceFixture::getPostRequest)
.collect(toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public enum StudylogAcceptanceFixture {
List<TagRequest> tagRequests = Arrays.stream(tags)
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
this.studylogRequest = new StudylogRequest(title, content, sessionId, missionId, tagRequests);
this.studylogRequest = new StudylogRequest(title, content, sessionId, missionId,
tagRequests);
}

public static List<StudylogRequest> findByMissionNumber(Long missionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public enum TagAcceptanceFixture {
TAG5(5L, "자료구조"),
TAG6(6L, "알고리즘");

private Long tagId;
private TagRequest tagRequest;
private final Long tagId;
private final TagRequest tagRequest;

TagAcceptanceFixture(Long id, String name) {
this.tagId = id;
Expand Down
Loading

0 comments on commit 6545260

Please sign in to comment.