Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 24 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.5.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'com.diffplug.spotless' version '6.21.0'
id 'com.diffplug.spotless' version '8.1.0'
id 'org.flywaydb.flyway' version '11.11.2'
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
id 'org.jetbrains.kotlin.plugin.spring' version '2.2.21'
id 'org.jetbrains.kotlin.plugin.jpa' version '2.2.21'
// id 'org.jetbrains.kotlin.kapt' version '2.2.21'
}

group = 'com.ject'
Expand Down Expand Up @@ -52,6 +55,11 @@ dependencies {
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

// Querydsl (Kotlin용 – kapt 추가, Java용 Querydsl과 충돌이 발생하여 주석 처리)
// kapt "com.querydsl:querydsl-apt:5.0.0:jakarta"
// kapt "jakarta.annotation:jakarta.annotation-api"
// kapt "jakarta.persistence:jakarta.persistence-api"

// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

Expand All @@ -71,14 +79,20 @@ dependencies {
// Tika : 이미지 타입 검사
implementation 'org.apache.tika:tika-core:2.5.0'

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"
testImplementation "org.jetbrains.kotlin:kotlin-test"

// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testImplementation "org.mockito.kotlin:mockito-kotlin:6.1.0"
}

jar.enabled = false // 일반 JAR 파일 생성 비활성화
Expand All @@ -96,6 +110,13 @@ spotless {
endWithNewline() // 파일 끝부분 개행 처리
googleJavaFormat().aosp() // google java format 스타일 적용
}

kotlin {
target("**/*.kt") // 모든 .kt 파일에 적용
ktlint("1.8.0") // Kotlin 코드 스타일 검사 및 자동 포맷팅
trimTrailingWhitespace() // 공백 제거
endWithNewline() // 파일 끝부분 개행 처리
}
}

// pre-commit spotless check script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
@Getter
public abstract class BaseTimeEntity {

@CreatedDate
Expand All @@ -21,4 +19,20 @@ public abstract class BaseTimeEntity {
@LastModifiedDate private LocalDateTime updatedAt;

protected LocalDateTime deletedAt;

public boolean isDeleted() {
return deletedAt != null;
}

public LocalDateTime getCreatedAt() {
return createdAt;
}

public LocalDateTime getUpdatedAt() {
return updatedAt;
}

public LocalDateTime getDeletedAt() {
return deletedAt;
}
}
33 changes: 32 additions & 1 deletion src/main/java/com/ject/studytrip/member/domain/model/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@Builder(access = AccessLevel.PRIVATE)
public class Member extends BaseTimeEntity {

Expand Down Expand Up @@ -74,4 +73,36 @@ public void updateProfileImage(String profileImage) {
public void updateDeletedAt() {
this.deletedAt = LocalDateTime.now();
}

public MemberCategory getCategory() {
return category;
}

public String getEmail() {
return email;
}

public Long getId() {
return id;
}

public String getNickname() {
return nickname;
}

public String getProfileImage() {
return profileImage;
}

public MemberRole getRole() {
return role;
}

public String getSocialId() {
return socialId;
}

public SocialProvider getSocialProvider() {
return socialProvider;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@Builder(access = AccessLevel.PRIVATE)
public class DailyMission extends BaseTimeEntity {

Expand All @@ -32,4 +31,16 @@ public static DailyMission of(Mission mission, DailyGoal dailyGoal) {
public void updateDeletedAt() {
this.deletedAt = LocalDateTime.now();
}

public DailyGoal getDailyGoal() {
return dailyGoal;
}

public Long getId() {
return id;
}

public Mission getMission() {
return mission;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@Builder(access = AccessLevel.PRIVATE)
public class Mission extends BaseTimeEntity {

Expand Down Expand Up @@ -43,4 +42,20 @@ public void updateDeletedAt() {
public void updateCompleted() {
this.completed = true;
}

public boolean isCompleted() {
return completed;
}

public Long getId() {
return id;
}

public String getName() {
return name;
}

public Stamp getStamp() {
return stamp;
}
}

This file was deleted.

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 @@ -9,7 +9,6 @@
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@Builder(access = AccessLevel.PRIVATE)
public class Pomodoro extends BaseTimeEntity {

Expand Down Expand Up @@ -49,4 +48,28 @@ public void updateTotalFocusTimeInSeconds(int totalFocusTimeInSeconds) {
public void updateDeletedAt() {
this.deletedAt = LocalDateTime.now();
}

public Long getId() {
return id;
}

public DailyGoal getDailyGoal() {
return dailyGoal;
}

public int getFocusDurationInSeconds() {
return focusDurationInSeconds;
}

public int getFocusSessionCount() {
return focusSessionCount;
}

public int getBreakDurationInSeconds() {
return breakDurationInSeconds;
}

public int getTotalFocusTimeInSeconds() {
return totalFocusTimeInSeconds;
}
}
Loading