Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit f7d168c

Browse files
committed
revise intoruction part
1 parent 1b0d414 commit f7d168c

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailFeederManager.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,19 @@ public void pushChallengeFeeder(ChallengeFeederParam param) throws SupplyExcepti
143143
requirement = challenge.getStudioDetailRequirements();
144144
}
145145

146-
String introduction = challenge.getIntroduction() != null ? "" : challenge.getIntroduction();
147-
if (challenge.getRound1Introduction() != null) {
148-
if (challenge.getRound1Introduction() != null) {
149-
introduction += String.format(ROUND_HEADER_HTML, "1") + challenge.getRound1Introduction();
150-
introduction += "\n";
151-
}
152-
}
153-
154-
if (challenge.getRound2Introduction() != null) {
155-
introduction += String.format(ROUND_HEADER_HTML, "2") + challenge.getRound2Introduction();
146+
String introduction = challenge.getIntroduction() == null ? "" : challenge.getIntroduction();
147+
String round1Introduction = challenge.getRound1Introduction() == null ? "" : challenge.getRound1Introduction();
148+
String round2Introduction = challenge.getRound2Introduction() == null ? "" : challenge.getRound2Introduction();
149+
150+
if (round1Introduction != "" && round2Introduction != "") {
151+
// two rounds
152+
introduction += "\n" +
153+
String.format(ROUND_HEADER_HTML, "1") + round1Introduction + "\n"
154+
+ String.format(ROUND_HEADER_HTML, "2") + round2Introduction;
155+
} else if (round1Introduction != "") {
156+
introduction += "\n" + round1Introduction;
157+
} else if (round2Introduction != "") {
158+
introduction += "\n" + round2Introduction;
156159
}
157160

158161
challenge.setIntroduction(introduction);

0 commit comments

Comments
 (0)