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
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class DecisionLineController {

private final NodeQueryService nodeQueryService;

// 가장 중요한: 인증 사용자별 결정 라인 목록(요약)
// 인증 사용자별 결정 라인 목록(요약)
@GetMapping
public ResponseEntity<DecisionLineListDto> list(@AuthenticationPrincipal CustomUserDetails me) {
if (me == null) throw new ApiException(ErrorCode.HANDLE_ACCESS_DENIED, "login required");
return ResponseEntity.ok(nodeQueryService.getDecisionLines(me.getId()));
}

// 가장 많이 사용하는: 특정 결정 라인 상세
// 특정 결정 라인 상세
@GetMapping("/{decisionLineId}")
public ResponseEntity<DecisionLineDetailDto> detail(@PathVariable Long decisionLineId) {
return ResponseEntity.ok(nodeQueryService.getDecisionLineDetail(decisionLineId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.springframework.web.bind.annotation.*;

import java.util.List;

// 이 컨트롤러는 현재 사용하지 않으며 향후 DVCS 를 이용한 라인, 노드 편집 기능이 추가될 때 활성화될 예정임
@RestController
@RequestMapping("/api/v1/dvcs")
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public record ForkFromDecisionRequest(
String situation, // 선택(교체)
String description // 선택(교체)
) {
// 가장 많이 사용하는: 구버전 호환(keepUntilParent/lineTitle을 받던 생성 시그니처 흡수)
// 구버전 호환(keepUntilParent/lineTitle을 받던 생성 시그니처 흡수)
public ForkFromDecisionRequest(Long userId,
Long parentDecisionNodeId,
Integer targetOptionIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class BaseNode extends BaseEntity {
@Column(columnDefinition = "TEXT")
private String description;

// ▼ 추가: 현재 적용 버전(Resolver가 우선 사용)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "current_version_id")
private NodeAtomVersion currentVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class DecisionNode extends BaseEntity {
@Column(columnDefinition = "TEXT")
private String description;

// ▼ 추가: 해석 정책/버전
@Enumerated(EnumType.STRING)
@Column(nullable = false)
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BaseLineService {

private final NodeMappers mappers;

// 가장 중요한: 라인 생성 + 루트 커밋 + 초기 패치
// 라인 생성 + 루트 커밋 + 초기 패치
@Transactional
public BaseLineBulkCreateResponse createBaseLineWithNodes(BaseLineBulkCreateRequest request) {

Expand Down Expand Up @@ -115,7 +115,7 @@ public BaseLineBulkCreateResponse createBaseLineWithNodes(BaseLineBulkCreateRequ
main.moveHeadTo(root);
branchRepo.save(main);

// 가장 많이 사용하는: 생성된 노드들에 대한 초기 패치 저장
// 생성된 노드들에 대한 초기 패치 저장
for (BaseNode bn : createdEntities) {
NodeAtomVersion v = bn.getCurrentVersion();
if (v == null) continue;
Expand Down Expand Up @@ -147,15 +147,15 @@ public PivotListDto getPivotBaseNodes(Long baseLineId) {

@Transactional
public void deleteBaseLineDeep(Long userId, Long baseLineId) {
// 가장 많이 사용하는 호출: 소유자/존재 여부 검증
// 소유자/존재 여부 검증
boolean owned = baseLineRepository.existsByIdAndUser_Id(baseLineId, userId);
if (!owned) throw new ApiException(ErrorCode.BASE_LINE_NOT_FOUND, "baseline not found or not owned");

// 가장 많이 사용하는 호출: 결정노드 → 결정라인
// 결정노드 → 결정라인
decisionNodeRepository.deleteByDecisionLine_BaseLine_Id(baseLineId);
decisionLineRepository.deleteByBaseLine_Id(baseLineId);

// 가장 많이 사용하는 호출: DVCS 역순(Patch→Commit→Branch)
// DVCS 역순(Patch→Commit→Branch)
patchRepo.deleteByCommit_Branch_BaseLine_Id(baseLineId);
branchRepo.clearHeadByBaseLineId(baseLineId);
commitRepo.deleteByBranch_BaseLine_Id(baseLineId);
Expand Down Expand Up @@ -184,7 +184,7 @@ public void deleteBaseLineDeep(Long userId, Long baseLineId) {
em.flush();
em.clear();

// 가장 많이 사용하는 호출: 베이스노드 베이스라인
// 베이스노드 -> 베이스라인
baseNodeRepository.deleteByBaseLine_Id(baseLineId);
baseLineRepository.deleteByIdAndUser_Id(baseLineId, userId);
}
Expand Down
Loading