Skip to content

Commit

Permalink
Merge pull request #36 from potenday-project/develop
Browse files Browse the repository at this point in the history
기명명 체크 하드코딩
  • Loading branch information
HwangHoYoon authored Dec 16, 2023
2 parents cd0c676 + 7859440 commit 0162b28
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions src/main/java/com/chwipoClova/recruit/service/RecruitService.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,39 @@ private String getRecruitTitle(String summary) {
String[] splitSummaryList = summary.split("\n");

// 기업명 고정
String targetWord = "기업 :";
String targetWord2 = "기업명 :";
String targetWord1 = "기업 :";
String targetWord2 = "기업:";
String targetWord3 = "기업명 :";
String targetWord4 = "기업명:";

for (String splitSummary : splitSummaryList) {
if (splitSummary.indexOf(".") != -1) {
String num = splitSummary.substring(0, splitSummary.indexOf("."));
if (org.apache.commons.lang3.StringUtils.isNumeric(num)) {
int index = splitSummary.indexOf(targetWord);
if (index != -1) {
title = splitSummary.substring(index + targetWord.length()).trim();
int index1 = splitSummary.indexOf(targetWord1);
int index2 = splitSummary.indexOf(targetWord2);
int index3 = splitSummary.indexOf(targetWord3);
int index4 = splitSummary.indexOf(targetWord4);

if (index1 != -1) {
index1 = splitSummary.indexOf(targetWord1);
if (index1 != -1) {
title = splitSummary.substring(index1 + targetWord1.length()).trim();
}
} else if (index2 != -1) {
index2 = splitSummary.indexOf(targetWord2);
if (index2 != -1) {
title = splitSummary.substring(index2 + targetWord2.length()).trim();
}
} else if (index3 != -1) {
index3 = splitSummary.indexOf(targetWord3);
if (index3 != -1) {
title = splitSummary.substring(index3 + targetWord3.length()).trim();
}
} else {
index = splitSummary.indexOf(targetWord2);
if (index != -1) {
title = splitSummary.substring(index + targetWord2.length()).trim();
index4 = splitSummary.indexOf(targetWord4);
if (index4 != -1) {
title = splitSummary.substring(index4 + targetWord4.length()).trim();
}
}
}
Expand Down

0 comments on commit 0162b28

Please sign in to comment.