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 @@ -126,9 +126,9 @@ private void applyStructuredField(ImportData data, String header, String fieldNa
"유효하지 않은 파견 가능 학기입니다. 가능한 값: " + validEnumValues(SemesterAvailableForDispatch.values()));
}
}
case "semesterRequirement" -> applyWithLength(value, 100, s -> data.semesterRequirement = s);
case "detailsForLanguage" -> applyWithLength(value, 2000, s -> data.detailsForLanguage = s);
case "gpaRequirement" -> applyWithLength(value, 100, s -> data.gpaRequirement = s);
case "semesterRequirement" -> applyWithLength(value, 2000, s -> data.semesterRequirement = s);
case "detailsForLanguage" -> applyWithLength(value, 4000, s -> data.detailsForLanguage = s);
case "gpaRequirement" -> applyWithLength(value, 2000, s -> data.gpaRequirement = s);
Comment on lines +129 to +131

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 4 \
  '`@Size`|semesterRequirement|detailsForLanguage|gpaRequirement|AdminUnivApplyInfo(Create|Update)Request' \
  src/main/java

Repository: solid-connection/solid-connect-server

Length of output: 50393


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate DTO and service files =="
fd 'AdminUnivApplyInfo(Create|Update)Request\.java|AdminUnivApplyInfoService\.java|AdminUnivApplyInfoRowSaver\.java|UnivApplyInfoImportRequest\.java' src/main/java -X sh -c 'echo "--- $1"; wc -l "$1"; sed -n "1,180p" "$1"' sh {}

echo
echo "== service call sites =="
rg -n -C 3 'createUnivApplyInfo|updateUnivApplyInfo|semesterRequirement|detailsForLanguage|gpaRequirement' src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoService.java

Repository: solid-connection/solid-connect-server

Length of output: 10593


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== AdminUnivApplyInfoCreateRequest.java =="
sed -n '1,120p' src/main/java/com/example/solidconnection/admin/university/dto/AdminUnivApplyInfoCreateRequest.java

echo
echo "== AdminUnivApplyInfoUpdateRequest.java =="
sed -n '1,140p' src/main/java/com/example/solidconnection/admin/university/dto/AdminUnivApplyInfoUpdateRequest.java

echo
echo "== UnivApplyInfo entity =="
sed -n '1,140p' src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java

Repository: solid-connection/solid-connect-server

Length of output: 5965


1. 직접 생성·수정 경로의 문자열 길이 검증을 추가해 주세요.

  1. AdminUnivApplyInfoCreateRequestAdminUnivApplyInfoUpdateRequestsemesterRequirement, detailsForLanguage, gpaRequirement@Size가 없습니다.
  2. 엔티티는 해당 컬럼을 length=2000, 4000, 2000으로 제한해 둡니다.
  3. 엔티티를 생성하거나 update(...) 호출 때 같은 검증을 공통 로직으로 추가해 주세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoRowSaver.java`
around lines 129 - 131, Add shared length validation for semesterRequirement,
detailsForLanguage, and gpaRequirement in the AdminUnivApplyInfoCreateRequest
and AdminUnivApplyInfoUpdateRequest flows before entity creation or update(...).
Enforce maximum lengths of 2000, 4000, and 2000 respectively, matching the
entity column constraints and the existing applyWithLength handling.

case "gpaRequirementCriteria" -> applyWithLength(value, 100, s -> data.gpaRequirementCriteria = s);
case "detailsForAccommodation" -> applyWithLength(value, 2000, s -> data.detailsForAccommodation = s);
default -> data.extraInfo.put(header, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public class UnivApplyInfo extends BaseEntity {
@Enumerated(EnumType.STRING)
private SemesterAvailableForDispatch semesterAvailableForDispatch;

@Column(name = "semester_requirement", length = 100)
@Column(name = "semester_requirement", length = 2000)
private String semesterRequirement;

@Column(name = "details_for_language", length = 2000)
@Column(name = "details_for_language", length = 4000)
private String detailsForLanguage;

@Column(name = "gpa_requirement", length = 100)
@Column(name = "gpa_requirement", length = 2000)
private String gpaRequirement;

@Column(name = "gpa_requirement_criteria", length = 100)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE university_info_for_apply
MODIFY COLUMN gpa_requirement VARCHAR(2000) NULL,
MODIFY COLUMN semester_requirement VARCHAR(2000) NULL,
MODIFY COLUMN details_for_language VARCHAR(4000) NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class UnivApplyInfo를_임포트한다 {
@Test
void 길이_제한을_초과하는_값이_들어오면_전체가_실패한다() {
// given
String tooLongValue = "a".repeat(101);
String tooLongValue = "a".repeat(2001);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

1. 세 필드의 경계값과 초과값을 모두 검증해 주세요.

현재 테스트는 semesterRequirement의 2001자 초과만 검증합니다. detailsForLanguage의 4001자 초과, gpaRequirement의 2001자 초과, 각 필드의 최대 허용 길이 저장도 추가해 주세요.

또한 Line [405]의 String tooLong = "a".repeat(101)은 새 제한에서 더 이상 초과값이 아닙니다. 해당 테스트가 길이 오류도 검증하려면 2001자로 변경해야 합니다.

제안
-            String tooLong = "a".repeat(101);
+            String tooLong = "a".repeat(2001);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoServiceTest.java`
at line 385, Update the relevant tests in AdminUnivApplyInfoServiceTest to cover
maximum-length boundary values and over-limit values for semesterRequirement and
gpaRequirement at 2000/2001 characters, and detailsForLanguage at 4000/4001
characters. Change the existing tooLong value currently using 101 characters to
2001 so it still exercises the length-validation error.

String markdown = String.format("""
| 대학명 | 학기요건 |
|--------|----------|
Expand Down
Loading