Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 의존성 리팩터링 및 스케줄링 성능 개선 #621

Merged
merged 22 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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