Skip to content

refactor : 반례게시판#402

Merged
sh0723 merged 4 commits intodevelopfrom
refactor/be-47
Oct 12, 2025
Merged

refactor : 반례게시판#402
sh0723 merged 4 commits intodevelopfrom
refactor/be-47

Conversation

@sh0723
Copy link
Contributor

@sh0723 sh0723 commented Sep 29, 2025

📌 Related Issue

refactor/be-47

🚀 Description

  • 반례게시판 등록할 때 문제 번호로도 등록할 수 있도록 했습니다.
  • 반례게시판의 반례들을 볼 때 등록 순으로 정렬했습니다.

📢 Review Point

  • 기존의 BOJ_PROBLEM_URL이 있긴 했는데 /problem/ 이 부분이 없어서 새로 만들어넣었어요! 근데 이거 이름이 왜 BOJ_PROBLEM_URL인지 궁금합니다..! 백준 url아닌가?!

📚Etc (선택)

@sh0723 sh0723 self-assigned this Sep 29, 2025
@sh0723 sh0723 added the refactoring 리팩토링 label Sep 29, 2025
@linear
Copy link

linear bot commented Sep 29, 2025

@channeltalk
Copy link

channeltalk bot commented Sep 29, 2025

@github-actions
Copy link

github-actions bot commented Sep 29, 2025

Test Results

 19 files   19 suites   6s ⏱️
318 tests 318 ✅ 0 💤 0 ❌
320 runs  320 ✅ 0 💤 0 ❌

Results for commit 825ce7f.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@rladmstn rladmstn left a comment

Choose a reason for hiding this comment

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

흠 근데 드는 생각이 이 부분은 프론트에서 요청을 할 때 일관적으로 포맷 통일해서 보내주는게 좋지 않을까요?

아래에 코멘트로 남겨뒀는데 이에 대한 의논과 답변이 먼저 필요할 것 같아서 추가 코멘트는 더 안달았습니다!
저 이야기에 대한 답변 먼저 해주시면 추가 리뷰 할게요!

public static final String SOLVED_AC_PROBLEM_API_URL = "https://solved.ac/api/v3/problem/lookup?problemIds=";
public static final String BOJ_USER_PROFILE_URL = "https://www.acmicpc.net/user/";
public static final String BOJ_PROBLEM_URL = "www.acmicpc.net";
public static final String BOJ_PROBLEM_FORMAT = "https://www.acmicpc.net/problem/";
Copy link
Contributor

Choose a reason for hiding this comment

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

백준 URL이 맞네요! 그냥 BOJ_URL로 수정해주시면 감사하겠습니다 ㅎㅎ
/problem 붙은 url은 BOJ_PROBLEM_URL로 해주시면 될 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵!


@Builder
public record CreateEdgeCaseRequest(@NotBlank(message = "문제 링크 입력은 필수입니다.") String link,
public record CreateEdgeCaseRequest(@NotBlank(message = "문제 링크 또는 문제 번호 입력은 필수입니다.") String linkOrProblemNumber,
Copy link
Contributor

Choose a reason for hiding this comment

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

흠 근데 드는 생각이 이 부분은 프론트에서 요청을 할 때 일관적으로 포맷 통일해서 보내주는게 좋지 않을까요?

문제 링크와 번호 입력 모두 지원한다는 것이 결국은 사용자에게 편리함을 제공하기 위한거라면,
백엔드 비즈니스 로직보단 UX 관점에서 가져 가야 할 역할일거라고 생각했습니다.

어차피 문제 번호는 백준 문제 URL 뒤에 넣어주면 되니까 문제 링크로만 요청 보내는건 프론트에서도 충분히 처리할 수 있지 않을까 싶었습니다!

value가 두 개로 쪼개지는거면 모를까, String request param 하나로 이렇게 링크 또는 문제 번호를 받는 것도 API 명세 자체를 모호하게 만드는 원인이라고 생각합니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저도 동의해요! 이 부분은 그럼 프론트 분들과 논의를 해봐야하는 걸까요?

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.

백준 문제 URL 받는 거로 통일시켰습니다~!

Copy link
Contributor

@junggyo1020 junggyo1020 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 :)

}

private void saveEdgeCase(User author, CreateEdgeCaseRequest request, int level, String title, int number) {
private void saveEdgeCase(User author, CreateEdgeCaseRequest request,int level, String title, int number) {
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 실수로 공백 제거 하신 것 같아요..!

private String getProblemId(String url) {
String[] parts = url.split("/");
if (parts.length < 3 || !parts[2].equals(BOJ_PROBLEM_URL))
if (parts.length < 3 || !parts[2].equals(BOJ_URL))
Copy link
Contributor

Choose a reason for hiding this comment

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

이건 단순 궁금증인데, parts.length < 3 을 해준 이유가 url 형식 때문인 걸까요? 기존 url 형식이 어떤 형식인지 궁금해요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네네
기존 URL형식이 https://www.acmicpc.net/problem/1000 처럼 들어와서 https://www.acmicpc.net 이 부분까지 있는지 확인하고 백준 url이 맞는지 확인하는 부분입니다 !.!

Copy link
Contributor

@rladmstn rladmstn left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 👍 굿

@s-hwan
Copy link
Contributor

s-hwan commented Oct 12, 2025

고생하셨읍니다 👍

@sh0723 sh0723 merged commit 27de1b4 into develop Oct 12, 2025
2 of 3 checks passed
hwangjokim pushed a commit that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants