Skip to content

Commit

Permalink
Merge pull request #559 from woowacourse-teams/dev
Browse files Browse the repository at this point in the history
feat: main v1.1.0 배포한다.
  • Loading branch information
xrabcde authored Sep 17, 2021
2 parents 44551cf + 310a651 commit 38ccab4
Show file tree
Hide file tree
Showing 231 changed files with 8,129 additions and 4,358 deletions.
28 changes: 17 additions & 11 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,52 @@ ext {
}

dependencies {
//spring
// Spring
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'

implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
implementation 'org.projectlombok:lombok:1.18.18'

// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'

//database
// Database
runtimeOnly 'mysql:mysql-connector-java'
runtimeOnly 'com.h2database:h2'
//flyway

// Flyway
implementation 'org.flywaydb:flyway-core:6.4.2'

// Test
testImplementation 'io.rest-assured:rest-assured:3.3.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

//restdocs
// Restdocs
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-restassured'

//jwt
// Jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'

//svg
// SvgToPng
implementation 'org.apache.xmlgraphics:batik-all:1.12'
implementation 'org.apache.xmlgraphics:xmlgraphics-commons:2.4'
implementation 'xml-apis:xml-apis:1.4.01'
implementation 'xml-apis:xml-apis-ext:1.3.04'

//cryptor
// Cryptor
implementation 'commons-codec:commons-codec:1.15'

// lombok
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

// Mock Web Server
testImplementation 'com.squareup.okhttp3:okhttp:4.0.1'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.0.1'
}

test {
Expand Down Expand Up @@ -105,7 +111,7 @@ jacocoTestCoverageVerification {
excludes = ["**.exception.**", "**.ControllerAdvice", "**.*ErrorResponse", "**.ValidatorMessage",
"**.ZzimkkongApplication", "**.*TimeConverter", "**.DataLoader", "**.*Config",
"**.LoginInterceptor", "**.AuthenticationPrincipalArgumentResolver",
"**.slack.**", "**.Slack*"]
"**.slack.**", "**.Slack*", "**.datasource.**"]
//todo: 패키지 분리하면 더 멋있게 해보겠슴,,

limit {
Expand Down Expand Up @@ -139,6 +145,6 @@ sonarqube {
property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/jacoco/test/jacocoTestReport.xml'
property 'sonar.java.binaries', 'build/classes'
property 'sonar.test.inclusions', '**/*Test.java'
property 'sonar.exclusions', '**/*Doc*.java, **/resources/**'
property 'sonar.exclusions', '**/*Doc*.java, **/resources/**, **/config/datasource/**'
}
}
54 changes: 54 additions & 0 deletions backend/src/docs/asciidoc/member.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,57 @@ include::{snippets}/member/token/success/http-request.adoc[]
include::{snippets}/member/token/success/http-response.adoc[]
==== Fail Response
include::{snippets}/member/token/fail/http-response.adoc[]

=== 멤버 구글 이메일 반환
==== Request
include::{snippets}/member/get/oauth/GOOGLE/http-request.adoc[]
==== Response
include::{snippets}/member/get/oauth/GOOGLE/http-response.adoc[]

=== 멤버 깃헙 이메일 반환
==== Request
include::{snippets}/member/get/oauth/GITHUB/http-request.adoc[]
==== Response
include::{snippets}/member/get/oauth/GITHUB/http-response.adoc[]

=== 멤버 구글 회원가입
==== Request
include::{snippets}/member/post/oauth/GOOGLE/http-request.adoc[]
==== Response
include::{snippets}/member/post/oauth/GOOGLE/http-response.adoc[]

=== 멤버 깃헙 회원가입
==== Request
include::{snippets}/member/post/oauth/GITHUB/http-request.adoc[]
==== Response
include::{snippets}/member/post/oauth/GITHUB/http-response.adoc[]

=== 멤버 구글 로그인
==== Request
include::{snippets}/member/login/oauth/GOOGLE/http-request.adoc[]
==== Response
include::{snippets}/member/login/oauth/GOOGLE/http-response.adoc[]

=== 멤버 깃헙 로그인
==== Request
include::{snippets}/member/login/oauth/GITHUB/http-request.adoc[]
==== Response
include::{snippets}/member/login/oauth/GITHUB/http-response.adoc[]

=== 멤버 정보 조회
==== Request
include::{snippets}/member/myinfo/get/http-request.adoc[]
==== Response
include::{snippets}/member/myinfo/get/http-response.adoc[]

=== 멤버 정보 수정
==== Request
include::{snippets}/member/myinfo/put/http-request.adoc[]
==== Response
include::{snippets}/member/myinfo/put/http-response.adoc[]

=== 회원 탈퇴
==== Request
include::{snippets}/member/myinfo/delete/http-request.adoc[]
==== Response
include::{snippets}/member/myinfo/delete/http-response.adoc[]
17 changes: 12 additions & 5 deletions backend/src/main/java/com/woowacourse/zzimkkong/DataLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public void run(String... args) {
String meetingRoomColor = "#FFE3AC";

Member pobi = members.save(
new Member("[email protected]", "test1234", "woowacourse")
new Member("[email protected]",
"$2a$10$c3BysogWR4hnexYx60/r/e3lEUIbSs4zhW6kuX4UW733MW5/NmbW.", // test1234 입니다.
"woowacourse")
);

Map luther = maps.save(
Expand All @@ -51,13 +53,13 @@ public void run(String... args) {
);

Setting defaultSetting = Setting.builder()
.availableStartTime(LocalTime.of(0, 0))
.availableEndTime(LocalTime.of(23, 59))
.availableStartTime(LocalTime.of(9, 0))
.availableEndTime(LocalTime.of(22, 00))
.reservationTimeUnit(10)
.reservationMinimumTimeUnit(10)
.reservationMaximumTimeUnit(1440)
.reservationMaximumTimeUnit(700)
.reservationEnable(true)
.enabledDayOfWeek(null)
.enabledDayOfWeek("monday,tuesday,wednesday,thursday,friday,saturday,sunday")
.build();

Space be = Space.builder()
Expand Down Expand Up @@ -175,6 +177,7 @@ public void run(String... args) {
Reservation reservationBackEndTargetDate0To1 = Reservation.builder()
.startTime(targetDate.atStartOfDay())
.endTime(targetDate.atTime(1, 0, 0))
.date(targetDate)
.description("찜꽁 1차 회의")
.userName("찜꽁")
.password("1234")
Expand All @@ -184,6 +187,7 @@ public void run(String... args) {
Reservation reservationBackEndTargetDate13To14 = Reservation.builder()
.startTime(targetDate.atTime(13, 0, 0))
.endTime(targetDate.atTime(14, 0, 0))
.date(targetDate)
.description("찜꽁 2차 회의")
.userName("찜꽁")
.password("1234")
Expand All @@ -193,6 +197,7 @@ public void run(String... args) {
Reservation reservationBackEndTargetDate18To23 = Reservation.builder()
.startTime(targetDate.atTime(18, 0, 0))
.endTime(targetDate.atTime(23, 59, 59))
.date(targetDate)
.description("찜꽁 3차 회의")
.userName("찜꽁")
.password("6789")
Expand All @@ -202,6 +207,7 @@ public void run(String... args) {
Reservation reservationBackEndTheDayAfterTargetDate = Reservation.builder()
.startTime(targetDate.plusDays(1L).atStartOfDay())
.endTime(targetDate.plusDays(1L).atTime(1, 0, 0))
.date(targetDate)
.description("찜꽁 4차 회의")
.userName("찜꽁")
.password("1234")
Expand All @@ -211,6 +217,7 @@ public void run(String... args) {
Reservation reservationFrontEnd1TargetDate0to1 = Reservation.builder()
.startTime(targetDate.atStartOfDay())
.endTime(targetDate.atTime(1, 0, 0))
.date(targetDate)
.description("찜꽁 5차 회의")
.userName("찜꽁")
.password("1234")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,29 @@ public void addArgumentResolvers(List argumentResolvers) {
@Override
public void addInterceptors(InterceptorRegistry registry) {
List<String> pathsToAdd = List.of(
"/api/members/token",
"/api/managers/token",
"/api/managers/**"
);

List<String> pathsToExclude = List.of(
//manager join
"/api/managers",
"/api/managers/GOOGLE",
"/api/managers/GITHUB",
"/api/managers/google",
"/api/managers/github",
"/api/managers/oauth",

//manager login
"/api/managers/login/token",
"/api/managers/GOOGLE/login/token",
"/api/managers/GITHUB/login/token",
"/api/managers/google/login/token",
"/api/managers/github/login/token"
);

registry.addInterceptor(loginInterceptor)
.addPathPatterns(pathsToAdd);
.addPathPatterns(pathsToAdd)
.excludePathPatterns(pathsToExclude);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.woowacourse.zzimkkong.config;

import com.woowacourse.zzimkkong.infrastructure.oauth.StringToOauthProviderConverter;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class OauthConfig implements WebMvcConfigurer {
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToOauthProviderConverter());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.woowacourse.zzimkkong.config;

import com.woowacourse.zzimkkong.infrastructure.oauth.GithubRequester;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource("classpath:config/oauth.properties")
public class OauthGithubConfig {
@Bean(name = "githubRequester")
@Profile({"prod"})
public GithubRequester githubRequesterProd(
@Value("${github.client-id.prod}") final String clientId,
@Value("${github.secret-id.prod}") final String secretId,
@Value("${github.url.oauth-login}") final String githubOauthUrl,
@Value("${github.url.open-api}") final String githubOpenApiUrl) {
return new GithubRequester(clientId, secretId, githubOauthUrl, githubOpenApiUrl);
}

@Bean(name = "githubRequester")
@Profile({"dev"})
public GithubRequester githubRequesterDev(
@Value("${github.client-id.dev}") final String clientId,
@Value("${github.secret-id.dev}") final String secretId,
@Value("${github.url.oauth-login}") final String githubOauthUrl,
@Value("${github.url.open-api}") final String githubOpenApiUrl) {
return new GithubRequester(clientId, secretId, githubOauthUrl, githubOpenApiUrl);
}

@Bean(name = "githubRequester")
@Profile({"local", "test"})
public GithubRequester githubRequesterLocalTest(
@Value("${github.client-id.local}") final String clientId,
@Value("${github.secret-id.local}") final String secretId,
@Value("${github.url.oauth-login}") final String githubOauthUrl,
@Value("${github.url.open-api}") final String githubOpenApiUrl) {
return new GithubRequester(clientId, secretId, githubOauthUrl, githubOpenApiUrl);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.woowacourse.zzimkkong.config.datasource;

import java.util.List;

public class CircularList<T> {
private final List<T> list;
private Integer counter = 0;

public CircularList(List<T> list) {
this.list = list;
}

public T getOne() {
if (counter + 1 >= list.size()) {
counter = -1;
}
return list.get(++counter);
}
}
Loading

0 comments on commit 38ccab4

Please sign in to comment.