Skip to content

Conversation

@gmltn9233
Copy link
Contributor

πŸ”§μ—°κ²°λœ 이슈

  • closed

πŸ› οΈμž‘μ—… λ‚΄μš©

    1. enum MajorName μ†Œν”„νŠΈμ›¨μ–΄ν•™κ³Ό, λ°μ΄ν„°μ‚¬μ΄μ–ΈμŠ€ν•™κ³Ό μΆ”κ°€
    1. mapToGonghakCoursesDomain λ©”μ„œλ“œ λ¦¬νŒ©ν† λ§

πŸ€·β€β™‚οΈPR이 ν•„μš”ν•œ 이유

1. enum MajorName

2ν•™κ³Όκ°€ μƒˆλ‘œ 좔가됨에 따라 μΆ”κ°€ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

2. mapToGonghakCoursesDomain λ©”μ„œλ“œ λ¦¬νŒ©ν† λ§

μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” κ°•μ˜

image
μœ„λŠ” μ†Œν”„νŠΈμ›¨μ–΄ν•™κ³Όμ˜ 17년도 κ΅κ³Όκ³Όμ •ν‘œμž…λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이쀑 κ³ κΈ‰μ‹€μ‹œκ°„κ·Έλž˜ν”½μŠ€ ,λ””μ§€ν„Έμ‚¬μš΄λ“œ 등은 μ‹€μ œ ꡐ과가 κ°œμ„€λ˜μ§€ μ•Šμ•„ 이λ₯Ό μ²˜λ¦¬ν•  둜직이 ν•„μš”ν–ˆμŠ΅λ‹ˆλ‹€.

CoursesDomain courseDomain = coursesDao.findByName(data[6].replaceAll("\\s+", ""));
if (courseDomain == null) {
    // Return an empty Optional if courseDomain is null
    return Optional.empty();
}
Optional<GonghakCoursesDomain> course = mapToGonghakCoursesDomain(data);
if (course.isPresent()) {
    // Save to repository only if the Optional contains a value
    gonghakCorusesDao.save(course.get());
    }

μ›λž˜λŠ” GongakCoursesDomain을 returnν•˜λŠ” mapToGonghakCoursesDomain λ©”μ„œλ“œλ₯Ό Optional 객체λ₯Ό return ν•˜λ„λ‘ λ¦¬νŒ©ν† λ§ν•˜μ—¬, ν•΄λ‹Ή 객체가 emptyλ©΄ μ €μž₯ν•˜μ§€ μ•Šκ³ , 이후 λΆˆν•„μš”ν•œ λ‘œμ§λ„ μ§„ν–‰ν•˜μ§€ μ•Šκ²Œ ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

데이터 ν¬λ§·νŒ…

μ•„λž˜λŠ” μ†Œν”„νŠΈμ›¨μ–΄ν•™κ³Όμ˜ λ°μ΄ν„°ν˜•μ‹μ΄κ³ ,
image

μ•„λž˜λŠ” μ „μžμ •λ³΄ν†΅μ‹ κ³΅ν•™κ³Όμ˜ 데이터 ν˜•μ‹μž…λ‹ˆλ‹€.
image

  • ꡐ과ꡬ뢄

ν•™κ³Όλ³„λ‘œ ꡐ과ꡬ뢄 ν•­λͺ©μ΄ μƒμ΄ν•˜μ—¬ csv νŒŒμΌλ“€μ„ μ‚΄νŽ΄λ³΄λ©° κ°€λŠ₯ν•œ λͺ¨λ“  경우의 수λ₯Ό μΆ”μŠ€λ €μ„œ 전문ꡐ양, BSM, 전곡 ,MSC 4κ°€μ§€ ν•­λͺ©μœΌλ‘œ ν†΅μΌμ‹œμΌ°μŠ΅λ‹ˆλ‹€.

switch (courseCategory) {
    case "μ€‘ν•΅ν•„μˆ˜", "κ΅μ–‘ν•„μˆ˜", "ꡐ양선택", "ꡐ양선택I", "ꡐ양":
        courseCategory = "전문ꡐ양";
        break;
    case "μ „κ³΅κΈ°μ΄ˆκ΅μ–‘", "ν•™λ¬ΈκΈ°μ΄ˆκ΅μ–‘":
        courseCategory = "BSM";
        break;
    case "μ „κ³΅ν•„μˆ˜", "전곡선택", "전곡(섀계)", "μ „κ³΅μ£Όμ œ", "μ „κ³΅κΈ°μ΄ˆ":
        courseCategory = "전곡";
        break;
    default:
        // κΈ°λ³Έμ μœΌλ‘œλŠ” λ³€κ²½ν•˜μ§€ μ•Šκ³  μ›λž˜ 값을 μœ μ§€
        break;
}
  • 인증ꡬ뢄

인증ꡬ뢄 데이터도 인선, 인필 ν˜•νƒœλ‘œ μ €μž₯λ˜λ„λ‘ substring을 μ μš©ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

passCategory(data[5].substring(0, 2))
  • ꡐ과λͺ©λͺ… 뢈일치

μ‹œκ°„ν‘œμƒμœΌλ‘œλŠ” "λŒ€ν•™μƒμ„μœ„ν•œμ§„λ‘œμ„€κ³„" 처럼 띄어쓰기가 주둜 μ—†μœΌλ©°, 곡학인증 ν™ˆνŽ˜μ΄μ§€μƒμœΌλ‘œλŠ” "λŒ€ν•™μƒμ„ μœ„ν•œ μ§„λ‘œμ„€κ³„" 처럼 띄어쓰기가 μ μš©λ˜μ–΄μžˆμ–΄ ν•™κ³Όλͺ©μ„ κ²€μƒ‰ν•˜λŠ”λ° μ—λŸ¬κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

μ‹œκ°„ν‘œμƒμœΌλ‘œλŠ” 가끔 띄어쓰기가 μ‘΄μž¬ν•˜λŠ” ν•­λͺ©λ„ 있고 λΆˆκ·œμΉ™μ μ΄λΌ, λͺ¨λ“  ꡐ과λͺ©μ— 띄어쓰기λ₯Ό 없애도둝 ν†΅μΌν•˜μ˜€μŠ΅λ‹ˆλ‹€.

CoursesDomain courseDomain = coursesDao.findByName(data[6].replaceAll("\\s+", ""));

βœ”οΈPR 체크리슀트

  • ν•„μš”ν•œ ν…ŒμŠ€νŠΈλ₯Ό μž‘μ„±ν–ˆλŠ”κ°€?
  • λ‹€λ₯Έ μ½”λ“œλ₯Ό κΉ¨λœ¨λ¦¬μ§€ μ•Šμ•˜λŠ”κ°€?
  • μ—°κ²°λœ 이슈 외에 λ‹€λ₯Έ 이슈λ₯Ό ν•΄κ²°ν•œ μ½”λ“œκ°€ λ‹΄κ²¨μžˆλŠ”κ°€?

'μ†Œν”„νŠΈμ›¨μ–΄ν•™κ³Ό', 'λ°μ΄ν„°μ‚¬μ΄μ–ΈμŠ€ν•™κ³Ό' μΆ”κ°€
1. μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” μ½”μŠ€λΌλ©΄ 빈 Optional 객체 λ°˜ν™˜ν•˜μ—¬ μ €μž₯ν•˜μ§€ μ•ŠμŒ
2. 각 ν•™κ³Όλ§ˆλ‹€ λ‹€λ₯Έ courseCategory, passCategory ν•­λͺ©μ„ 데이터 ν˜•μ‹μ— 맞게 λ³€ν™˜
Copy link
Contributor

@whxogus215 whxogus215 left a comment

Choose a reason for hiding this comment

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

μ½”λ“œ λ‘œμ§μƒ λ¬Έμ œλŠ” μ—†λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. μˆ˜κ³ ν–ˆμŠ΅λ‹ˆλ‹€ πŸ‘

// μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” course 라면 Optional.empty λ°˜ν™˜
CoursesDomain courseDomain = coursesDao.findByName(data[6].replaceAll("\\s+", ""));
if (courseDomain == null) {
// Return an empty Optional if courseDomain is null
Copy link
Contributor

Choose a reason for hiding this comment

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

ν•΄λ‹Ή 주석을 달아둔 μ˜λ„κ°€ μžˆμ„κΉŒμš”? μ½”λ“œ 이해λ₯Ό 돕기 μœ„ν•¨μΈκ±°λΌλ©΄ μ§€μ›Œλ„ 될 것 κ°™μŠ΅λ‹ˆλ‹€!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ν•΄λ‹Ή 주석을 달아둔 μ˜λ„κ°€ μžˆμ„κΉŒμš”? μ½”λ“œ 이해λ₯Ό 돕기 μœ„ν•¨μΈκ±°λΌλ©΄ μ§€μ›Œλ„ 될 것 κ°™μŠ΅λ‹ˆλ‹€!

λΆˆν•„μš”ν•œ 주석 μ‚­μ œν•œ ν›„ μ»€λ°‹ν•˜μ˜€μŠ΅λ‹ˆλ‹€. 의견 κ°μ‚¬ν•©λ‹ˆλ‹€~πŸ‘

@whxogus215 whxogus215 added πŸ”¨ λ¦¬νŒ©ν† λ§ λ¦¬νŒ©ν† λ§ μ„œλΉ„μŠ€ μ„œλΉ„μŠ€ 둜직 κ΄€λ ¨ 이슈 labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ”¨ λ¦¬νŒ©ν† λ§ λ¦¬νŒ©ν† λ§ μ„œλΉ„μŠ€ μ„œλΉ„μŠ€ 둜직 κ΄€λ ¨ 이슈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants