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

Weekly_1주차 코드 #12

Merged
merged 38 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d969502
docs: 이슈, PR 템플릿 작성
rbm0524 Sep 15, 2024
abe30f0
Delete .github/ISSUE_TEMPLATE directory
rbm0524 Sep 15, 2024
48d64b0
docs: 이슈 템플릿 재작성
rbm0524 Sep 15, 2024
b1d78e8
docs: pull_request_template.md 작성
rbm0524 Sep 15, 2024
f39c71b
docs: 기능-요청-이슈-템플릿.md 수정
rbm0524 Sep 15, 2024
cdbe5cd
docs: PR 템플릿 수정
rbm0524 Sep 15, 2024
6e7f125
docs: 기능-요청-이슈-템플릿.md 재수정
rbm0524 Sep 15, 2024
eb7b6ba
docs: 템플릿 이름 수정
rbm0524 Sep 15, 2024
ce5f2c1
build: spring security 주석 처리, lombok 추가
rbm0524 Sep 18, 2024
65f3768
feat: Spot 엔티티 작성
rbm0524 Sep 18, 2024
4374ff8
feat: SpotDto 작성
rbm0524 Sep 18, 2024
a14f5f7
feat: SpotController 작성, 기본적인 CRUD 추가
rbm0524 Sep 18, 2024
cd9c672
feat: SpotService 작성, CRUD 로직 처리와 EntityToDto 기능 추가
rbm0524 Sep 18, 2024
c8c89ef
feat: SpotRepository 작성, Lat와 Lng로 튜플 찾는 기능 추가
rbm0524 Sep 18, 2024
64db012
rename: 패키지명 수정, spot이라는 상위 패키지 생성 후 패키지들 이동
rbm0524 Sep 19, 2024
9547064
chore: application 파일 확장자 yml 로 변경
nove1080 Sep 19, 2024
e0bd985
chore: Spotless 플러그인 추가
nove1080 Sep 19, 2024
ad97101
chore: lombok 의존성 추가
nove1080 Sep 19, 2024
8c48107
chore: pre-commit 스크립트 추가
nove1080 Sep 19, 2024
c4b4c05
chore: pre-commit 스크립트 실행 권한 Task 추가
nove1080 Sep 19, 2024
ecad4f0
style: Spotless 적용
nove1080 Sep 19, 2024
74c5ba7
Merge branch 'kakao-tech-campus-2nd-step3:Master' into feat/3/spotles…
nove1080 Sep 19, 2024
0fb2f33
Merge pull request #6 from nove1080/feat/3/spotless-apply
rbm0524 Sep 19, 2024
0ea24e4
chore: spotless 적용, properteis 파일 yml로 대체
rbm0524 Sep 20, 2024
565c6d7
feat: application.yml DB 연결 설정 및 로깅 레벨 설정
nove1080 Sep 20, 2024
ce9307c
feat: @EnableJpaAuditing 적용
nove1080 Sep 20, 2024
e1ea22e
feat: BaseEntity 정의
nove1080 Sep 20, 2024
d8223bf
feat: Product 정의
nove1080 Sep 20, 2024
a041aec
feat: PaymentOrderStatus 정의
nove1080 Sep 20, 2024
4163ec0
feat: PaymentOrder 정의
nove1080 Sep 20, 2024
5cb9823
feat: PaymentEvent 정의
nove1080 Sep 20, 2024
0896bfe
feat: PaymentOrder amount 필드 데이터 크기 지정
nove1080 Sep 20, 2024
b08604b
Merge pull request #8 from kakao-tech-campus-2nd-step3/feat/2/spot-crud
rbm0524 Sep 20, 2024
d33d011
Merge pull request #9 from nove1080/feat/7/payment-data-modeling
rbm0524 Sep 20, 2024
64d11a6
feat: member entity 구현
westzeroright Sep 20, 2024
6c782cd
Merge pull request #10 from kakao-tech-campus-2nd-step3/feat/1/kakao-…
rbm0524 Sep 20, 2024
007a02d
fix: 사용하지 않는 변수 삭제
rbm0524 Sep 20, 2024
bc4b4ec
Merge pull request #11 from kakao-tech-campus-2nd-step3/feat/2/spot-crud
rbm0524 Sep 20, 2024
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
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/기능-요청-이슈-템플릿.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: 기능 요청 이슈 템플릿
about: 기능 요청 이슈 템플릿입니다.
title: ''
labels: ''
assignees: ''

---

Add a title
관련 이슈 제목 작성 ex. 인프라 초기 세팅
---------------------------------------------------------------
## Description
- 어떤 이슈인지 설명하는 란 입니다.
## To Do
- [ ] 프론트 CI 속도 개선
- [ ] 백엔드 CD gradle 파일 캐시 개선
- [ ] AI는 모델 경량화 개선 작업

## ETC
- 행복하다
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/버그-리포트-이슈-템플릿.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 버그 리포트 이슈 템플릿
about: 버그 리포트 이슈 템플릿입니다.
title: ''
labels: ''
assignees: ''

---

## 🐛 버그 리포트 (Bug Report)

### 📋 개요 (Summary)
발생한 버그에 대한 간략한 설명을 적어주세요.

### 🔍 재현 절차 (Steps to Reproduce)
버그를 재현할 수 있는 방법을 단계별로 설명해주세요:
1. 첫 번째 단계
2. 두 번째 단계
3. ...

### 🖥️ 예상 동작 (Expected Behavior)
정상적으로 동작했을 때 어떤 결과가 나와야 하나요?

### ❌ 실제 동작 (Actual Behavior)
버그로 인해 실제로 발생한 결과를 적어주세요.

### 🖼️ 스크린샷 (Screenshots)
문제를 보여줄 수 있는 스크린샷이 있으면 첨부해주세요.

### 💻 환경 (Environment)
- OS: [e.g., Windows 10]
- 브라우저: [e.g., Chrome 91]
- 기타: [e.g., Node.js 14]

### 🔗 관련된 이슈들 (Related Issues)
- 이 버그와 관련된 이슈 번호가 있다면 적어주세요. (예: `#123`)
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pr제목 -> 관련 이슈 #4

📌 관련 이슈
---
프론트 CI 속도 개선

✨ PR 내용
---
프론트 CI 속도 개선했음!
34 changes: 32 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.3.3'
id 'io.spring.dependency-management' version '1.1.6'
id "com.diffplug.spotless" version '6.25.0'
}

group = 'com.ordertogether'
Expand All @@ -17,20 +18,49 @@ repositories {
mavenCentral()
}

apply {
from('./tasks/update-git-hooks.gradle')
}

dependencies {
/** spring boot starter */
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'

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

/** thymeleaf and spring security integration */
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'

/** lombok */
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

developmentOnly 'org.springframework.boot:spring-boot-devtools'

runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

spotless {
java {
importOrder()
indentWithTabs(2)
indentWithSpaces(4)
removeUnusedImports()
googleJavaFormat()
trimTrailingWhitespace()
endWithNewline()
}
}

tasks.named('test') {
useJUnitPlatform()
}
Empty file modified gradlew
100644 → 100755
Empty file.
13 changes: 13 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

#1. 변경된 파일들 이름만 추출하여 저장
stagedFiles=$(git diff --staged --name-only)
#2. SpotlessApply 실행
echo "Running spotlessApply. Formatting code..."
./gradlew spotlessApply
#3. 변경사항이 발생한 파일들 다시 git add
for file in $stagedFiles; do
if test -f "$file"; then
git add "$file"
fi
done
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@SpringBootApplication
public class Team14BeApplication {

public static void main(String[] args) {
SpringApplication.run(Team14BeApplication.class, args);
}

public static void main(String[] args) {
SpringApplication.run(Team14BeApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.ordertogether.team14_be.memebr.persistence.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;

@Entity
public class Member {

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

@Column(name = "email")
private String email;

@Column(name = "point")
private int point;

@Column(name = "phone_number")
private String phoneNumber;

@Column(name = "delivery_name")
private String deliveryName;

@Column(name = "platform")
private String platform;

protected Member() {}

public Member(String email, int point, String phoneNumber, String deliveryName,
String platform) {
this.email = email;
this.point = point;
this.phoneNumber = phoneNumber;
this.deliveryName = deliveryName;
this.platform = platform;
}

public Long getId() {
return id;
}

public String getEmail() {
return email;
}

public int getPoint() {
return point;
}

public String getPhoneNumber() {
return phoneNumber;
}

public String getDeliveryName() {
return deliveryName;
}

public String getPlatform() {
return platform;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.ordertogether.team14_be.payment.domain;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@SuperBuilder
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@ToString
@Getter
public abstract class BaseEntity {

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

@Column(nullable = false, updatable = false)
@CreatedDate
private LocalDateTime createdAt;

@Column(nullable = false)
@LastModifiedDate
private LocalDateTime updatedAt;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.ordertogether.team14_be.payment.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

@Entity
@Getter
@SuperBuilder
@ToString
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class PaymentEvent extends BaseEntity {

@Column(nullable = false)
private Long buyerId; // 구매자 식별자

@Column(nullable = false)
private String orderId;

private String orderName;

@Column(nullable = false)
private String paymentKey; // PSP 결제 식별자

@Builder.Default private Boolean isPaymentDone = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.ordertogether.team14_be.payment.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

@Entity
@Getter
@SuperBuilder
@ToString
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class PaymentOrder extends BaseEntity {

@Column(nullable = false)
private Long sellerId; // 판매자 식별자

@ManyToOne(fetch = FetchType.LAZY)
private Product productId;

@Column(nullable = false)
private String orderId;

@Column(precision = 10, scale = 2)
private BigDecimal amount; // 결제 금액

@Enumerated(EnumType.STRING)
@Builder.Default
private PaymentOrderStatus paymentOrderStatus = PaymentOrderStatus.READY;

@Builder.Default private Byte retryCount = 0; // 재시도 횟수

@Builder.Default private Byte retryThreshold = 5; // 재시도 허용 임계값
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.ordertogether.team14_be.payment.domain;

/** 결제 상태 */
public enum PaymentOrderStatus {
READY,
EXECUTING,
SUCCESS,
FAIL;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.ordertogether.team14_be.payment.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

@Entity
@Getter
@SuperBuilder
@ToString
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Product extends BaseEntity {

@Column(nullable = false)
private String name;

@Column(nullable = false)
private BigDecimal price;
}
Loading