Skip to content

Commit

Permalink
fix : 이슈 저장에 상태 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouon committed Sep 3, 2024
1 parent 54d8082 commit ed89635
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/linkode/api_server/domain/GithubIssue.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.linkode.api_server.domain;

import com.linkode.api_server.domain.base.BaseStatus;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -19,17 +20,20 @@ public class GithubIssue {
private String body;
private String url;
private String state;

@Enumerated(EnumType.STRING)
@Column(nullable = false, columnDefinition = "VARCHAR(10)")
private BaseStatus status;
@ManyToOne(fetch = LAZY)
@JoinColumn(name = "studyroom_id")
private Studyroom studyroom;

@Builder
public GithubIssue(String title, String body, String url, String state,Studyroom studyroom) {
public GithubIssue(String title, String body, String url, String state,BaseStatus status,Studyroom studyroom) {
this.title = title;
this.body = body;
this.url = url;
this.state = state;
this.status = status;
this.studyroom=studyroom;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

Expand All @@ -29,6 +30,7 @@ public class GithubIssueService {
private final StudyroomRepository studyroomRepository;
private final MemberstudyroomRepository memberstudyroomRepository;

@Transactional
public GithubIssueResponse saveGithubIssue(Long studyroomId, String payload) {


Expand Down Expand Up @@ -58,6 +60,7 @@ public GithubIssueResponse saveGithubIssue(Long studyroomId, String payload) {
.url(prUrl)
.state("opened")
.studyroom(studyroom)
.status(BaseStatus.ACTIVE)
.state("opened") // 상태를 하드코딩하거나 필요한 상태로 대체
.build();

Expand Down

0 comments on commit ed89635

Please sign in to comment.