Skip to content

Commit

Permalink
[BE] 의존성 리팩터링 및 스케줄링 성능 개선 (#621)
Browse files Browse the repository at this point in the history
* refactor: base root entity 분리

* refactor: round에서 meetingDayOfTheWeek 에 대한 의존성 제거

* refactor: 의존성 확인을 위한 패키지 이동

* refactor: 멤버 의존성 정리 프로필 조회 분리

* refactor: 인증 의존성 정리

* refactor: 피드 의존성 정리

* refactor: 스터디, 라운드 서비스 분리

* refactor: MeetingDayOfTheWeek 삭제

* refactor: Round 생성 로직 분리

* refactor: Round 진행 로직 Round로 이동

* refactor: 임시 커밋

* chore: datadog 의존성 삭제

* refactor: study에서 round에 대한 의존성 제거

* refactor: AuthService 패키지 변경

* test: 성능 테스트 구현

* 성능 측정 테스트 구현

* refactor: 테스트

* refactor: 테스트

* refactor: 테스트

* refactor: 테스트

* refactor: 테스트

* refactor: proceedRound 메서드 시간 측정 코드 제거

---------

Co-authored-by: bjk1649 <[email protected]>
Co-authored-by: kim dae hee <[email protected]>
Co-authored-by: yujamint <[email protected]>
  • Loading branch information
4 people authored Jan 10, 2024
1 parent 1983174 commit 6c9b1cb
Show file tree
Hide file tree
Showing 110 changed files with 1,553 additions and 1,185 deletions.
4 changes: 1 addition & 3 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
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'
testImplementation 'org.testng:testng:7.1.0'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
Expand Down Expand Up @@ -76,9 +77,6 @@ dependencies {
annotationProcessor "javax.persistence:javax.persistence-api"
annotationProcessor "javax.annotation:javax.annotation-api"
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa"

// datadog
runtimeOnly 'io.micrometer:micrometer-registry-datadog'
}

tasks.named('test') {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public void addInterceptors(InterceptorRegistry registry) {
.excludePathPatterns("/login/github/tokens")
.excludePathPatterns("/login/tokens/refresh")
.excludePathPatterns("/login/fake/tokens")
.excludePathPatterns("/members/{id:[0-9]\\d*}")
.excludePathPatterns("/members/{studyId:[0-9]\\d*}")
.excludePathPatterns("/members/exists")
.excludePathPatterns("/api/**")
.excludePathPatterns("/api-docs/**")
.excludePathPatterns("/swagger-ui/**")
.excludePathPatterns("/actuator/**")
.excludePathPatterns("/fake/proceed")
.excludePathPatterns("/studies/{id:[0-9]\\d*}/rounds/{id:[0-9]\\d*}/progress-rate");
.excludePathPatterns("/studies/{studyId:[0-9]\\d*}/rounds/{studyId:[0-9]\\d*}/progress-rate");

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.yigongil.backend.application;
package com.yigongil.backend.config.auth;

import com.yigongil.backend.config.auth.JwtTokenProvider;
import com.yigongil.backend.config.oauth.GithubOauth;
import com.yigongil.backend.config.oauth.GithubProfileResponse;
import com.yigongil.backend.domain.member.Member;
import com.yigongil.backend.domain.member.MemberRepository;
import com.yigongil.backend.domain.member.domain.Member;
import com.yigongil.backend.domain.member.domain.MemberRepository;
import com.yigongil.backend.request.TokenRequest;
import com.yigongil.backend.response.TokenResponse;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.yigongil.backend.config.auth;

import com.yigongil.backend.domain.member.Member;
import com.yigongil.backend.domain.member.MemberRepository;
import com.yigongil.backend.domain.member.domain.Member;
import com.yigongil.backend.domain.member.domain.MemberRepository;
import com.yigongil.backend.exception.AuthorizationException;
import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package com.yigongil.backend.domain;
package com.yigongil.backend.domain.base;

import com.yigongil.backend.domain.event.DomainEvent;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.domain.AfterDomainEventPublication;
import org.springframework.data.domain.DomainEvents;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners(AuditingEntityListener.class)
Expand All @@ -25,23 +19,6 @@ public abstract class BaseEntity {
@LastModifiedDate
protected LocalDateTime updatedAt;

@Transient
private Collection<DomainEvent> domainEvents = new ArrayList<>();

@DomainEvents
public Collection<DomainEvent> events() {
return domainEvents;
}

@AfterDomainEventPublication
public void clear() {
domainEvents.clear();
}

protected void register(DomainEvent event) {
domainEvents.add(event);
}

public LocalDateTime getCreatedAt() {
return createdAt;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.yigongil.backend.domain.base;

import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.domain.AbstractAggregateRoot;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
public class BaseRootEntity extends AbstractAggregateRoot<BaseRootEntity> {

@CreatedDate
@Column(nullable = false)
protected LocalDateTime createdAt;

@LastModifiedDate
protected LocalDateTime updatedAt;

public LocalDateTime getCreatedAt() {
return createdAt;
}

public LocalDateTime getUpdatedAt() {
return updatedAt;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.yigongil.backend.domain.certification;

import com.yigongil.backend.domain.BaseEntity;
import com.yigongil.backend.domain.member.Member;
import com.yigongil.backend.domain.base.BaseEntity;
import com.yigongil.backend.domain.member.domain.Member;
import com.yigongil.backend.domain.round.Round;
import com.yigongil.backend.domain.study.Study;
import java.time.LocalDateTime;
Expand Down
Loading

0 comments on commit 6c9b1cb

Please sign in to comment.