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

[fix] 빌드 오류 해결 #3

Closed
wants to merge 18 commits into from
Closed
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
9 changes: 7 additions & 2 deletions .github/workflows/pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ jobs:
run: chmod +x ./gradlew
shell: bash

- name: Gradle로 프로젝트 Build
run: ./gradlew build
# - name: Gradle로 프로젝트 Build
# run: ./gradlew build
- name: Gradle 캐시 삭제
run: rm -rf ~/.gradle/caches

- name: Gradle로 프로젝트 Build 및 Test
run: ./gradlew build -Dspring.profiles.active=test --info

- name: 테스트 결과를 PR 코멘트로 출력
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ out/
.DS_Store

### application*.yml ###
src/main/resources/*.yml
src/main/resources/*.yml

### generated ###
src/main/generated/
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,24 @@ dependencies {

// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'

// Hibernate-spatial
implementation 'org.hibernate:hibernate-spatial:6.6.3.Final'

// Mapstuct
implementation 'org.mapstruct:mapstruct:1.6.3'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'

// QueryDSL
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.programmers.signalbuddy.domain.basetime;


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;

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

@CreatedDate
private LocalDateTime createdAt;

@LastModifiedDate
private LocalDateTime updatedAt;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.programmers.signalbuddy.domain.bookmark;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.locationtech.jts.geom.Point;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.Member;

@Entity(name = "bookmarks")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class Bookmark extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long bookmarkId;

@Column(nullable = false, columnDefinition = "Point")
private Point coordinate;

@Column(nullable = false)
private String address;

@ManyToOne
@JoinColumn(name = "member_id", nullable = false)
private Member member;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.programmers.signalbuddy.domain.comment;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.feedback.Feedback;
import org.programmers.signalbuddy.domain.member.Member;

@Entity(name = "comments")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@ToString
public class Comment extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long commentId;

@Column(nullable = false)
private String content;

@ManyToOne
@JoinColumn(name = "feedback_id", nullable = false)
private Feedback feedback;

@ManyToOne
@JoinColumn(name = "member_id", nullable = false)
private Member member;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.programmers.signalbuddy.domain.crossroad;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.locationtech.jts.geom.Point;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;

@Entity(name = "crossroads")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@ToString
public class Crossroad extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long crossroadId;

@Column(nullable = false, unique = true)
private String crossroadApiId;

@Column(nullable = false)
private String name;

@Column(nullable = false)
private Point coordinate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.crossroad.repository;

import org.programmers.signalbuddy.domain.crossroad.Crossroad;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CrossroadRepository extends JpaRepository<Crossroad, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.programmers.signalbuddy.domain.crossroad.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.crossroad.repository.CrossroadRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class CrossroadService {

private final CrossroadRepository crossroadRepository;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.programmers.signalbuddy.domain.feedback;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.Member;

@Entity(name = "feedbacks")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@ToString
public class Feedback extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long feedbackId;

@Column(nullable = false)
private String subject;

@Column(nullable = false)
private String content;

@Column(nullable = false)
private Long likeCount;

@ManyToOne
@JoinColumn(name = "member_id", nullable = false)
private Member member;
}
38 changes: 38 additions & 0 deletions src/main/java/org/programmers/signalbuddy/domain/like/Like.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.programmers.signalbuddy.domain.like;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.feedback.Feedback;
import org.programmers.signalbuddy.domain.member.Member;

@Entity(name = "likes")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@ToString
public class Like {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long likeId;

@ManyToOne
@JoinColumn(name = "member_id")
private Member member;

@ManyToOne
@JoinColumn(name = "feedback_id")
private Feedback feedback;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.programmers.signalbuddy.domain.member;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;

@Entity(name = "members")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@ToString
public class Member extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long memberId;

@Column(nullable = false)
private String email;

private String password;

@Column(nullable = false)
private String nickname;

private String profileImageUrl;

@Column(nullable = false)
private String role; // TODO: (USER, ADMIN) Enum 으로 변경

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private MemberStatus memberStatus;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.programmers.signalbuddy.domain.member;

import lombok.Getter;

@Getter
public enum MemberStatus {
ACTIVITY("활성"), WITHDRAWAL("탈퇴");

private final String status;

MemberStatus(String status) {
this.status = status;
}
}
Loading
Loading