Conversation
Test Results 19 files 19 suites 6s ⏱️ Results for commit 825ce7f. ♻️ This comment has been updated with latest results. |
rladmstn
left a comment
There was a problem hiding this comment.
흠 근데 드는 생각이 이 부분은 프론트에서 요청을 할 때 일관적으로 포맷 통일해서 보내주는게 좋지 않을까요?
아래에 코멘트로 남겨뒀는데 이에 대한 의논과 답변이 먼저 필요할 것 같아서 추가 코멘트는 더 안달았습니다!
저 이야기에 대한 답변 먼저 해주시면 추가 리뷰 할게요!
| 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/"; |
There was a problem hiding this comment.
백준 URL이 맞네요! 그냥 BOJ_URL로 수정해주시면 감사하겠습니다 ㅎㅎ
/problem 붙은 url은 BOJ_PROBLEM_URL로 해주시면 될 것 같아요!
|
|
||
| @Builder | ||
| public record CreateEdgeCaseRequest(@NotBlank(message = "문제 링크 입력은 필수입니다.") String link, | ||
| public record CreateEdgeCaseRequest(@NotBlank(message = "문제 링크 또는 문제 번호 입력은 필수입니다.") String linkOrProblemNumber, |
There was a problem hiding this comment.
흠 근데 드는 생각이 이 부분은 프론트에서 요청을 할 때 일관적으로 포맷 통일해서 보내주는게 좋지 않을까요?
문제 링크와 번호 입력 모두 지원한다는 것이 결국은 사용자에게 편리함을 제공하기 위한거라면,
백엔드 비즈니스 로직보단 UX 관점에서 가져 가야 할 역할일거라고 생각했습니다.
어차피 문제 번호는 백준 문제 URL 뒤에 넣어주면 되니까 문제 링크로만 요청 보내는건 프론트에서도 충분히 처리할 수 있지 않을까 싶었습니다!
value가 두 개로 쪼개지는거면 모를까, String request param 하나로 이렇게 링크 또는 문제 번호를 받는 것도 API 명세 자체를 모호하게 만드는 원인이라고 생각합니다!
There was a problem hiding this comment.
저도 동의해요! 이 부분은 그럼 프론트 분들과 논의를 해봐야하는 걸까요?
There was a problem hiding this comment.
백준 문제 URL 받는 거로 통일시켰습니다~!
| } | ||
|
|
||
| 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) { |
There was a problem hiding this comment.
여기 실수로 공백 제거 하신 것 같아요..!
| 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)) |
There was a problem hiding this comment.
이건 단순 궁금증인데, parts.length < 3 을 해준 이유가 url 형식 때문인 걸까요? 기존 url 형식이 어떤 형식인지 궁금해요!
There was a problem hiding this comment.
네네
기존 URL형식이 https://www.acmicpc.net/problem/1000 처럼 들어와서 https://www.acmicpc.net 이 부분까지 있는지 확인하고 백준 url이 맞는지 확인하는 부분입니다 !.!
|
고생하셨읍니다 👍 |
📌 Related Issue
refactor/be-47
🚀 Description
📢 Review Point
📚Etc (선택)