Skip to content

docs(be): add admin/assignment, announcement jsdoc#3395

Open
westsunh wants to merge 23 commits intomainfrom
t2443-add-jsdocs-annonce-assign-service
Open

docs(be): add admin/assignment, announcement jsdoc#3395
westsunh wants to merge 23 commits intomainfrom
t2443-add-jsdocs-annonce-assign-service

Conversation

@westsunh
Copy link

@westsunh westsunh commented Feb 1, 2026

Description

admin/assignment, admin/announcement에 jsdoc 추가

Additional context


Before submitting the PR, please make sure you do the following

@westsunh westsunh requested review from RyuRaseul and hjkim24 February 1, 2026 16:23
@westsunh westsunh self-assigned this Feb 1, 2026
@westsunh westsunh changed the title docs(be): add admin/assignment, admin/announcement jsdoc docs(be): add admin/assignment, announcement jsdoc Feb 1, 2026
@skkuding-bot
Copy link

skkuding-bot bot commented Feb 2, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: 9b6d99946f0e30b492526b023a9d187a390f4b12
Health Status: Healthy

Open Preview | View in Argo CD

Comment on lines +392 to +405
/**
* 과제에 문제들을 추가합니다.
*
* @param groupId 그룹 ID
* @param assignmentId 과제 ID
* @param assignmentProblemInput 추가할 문제 정보들
* @returns 추가된 과제들 정보
* @throws {EntityNotExistException} 아래와 같은 경우 발생합니다.
* - 요청한 과제가 존재하지 않을 때
* @throws {ForbiddenAccessException} 아래와 같은 경우 발생합니다.
* - 요청한 그룹 ID와 과제에 해당하는 그룹 ID가 일치하지 않을 때
* @throws {UnprocessableDataException} 아래와 같은 경우 발생합니다.
* - 트랜잭션 처리 중 오류가 발생할 때
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

로직에 있는 몇몇 특이점들도 적어주면 좋을 것 같습니다
예를 들면, 이미 Import된 문제는 건너뛰는 것이나, visibleLockTime을 새로 설정 하는 등의 동작들도 있으니까요

Suggested change
/**
* 과제에 문제들을 추가합니다.
*
* @param groupId 그룹 ID
* @param assignmentId 과제 ID
* @param assignmentProblemInput 추가할 문제 정보들
* @returns 추가된 과제들 정보
* @throws {EntityNotExistException} 아래와 같은 경우 발생합니다.
* - 요청한 과제가 존재하지 않을
* @throws {ForbiddenAccessException} 아래와 같은 경우 발생합니다.
* - 요청한 그룹 ID와 과제에 해당하는 그룹 ID가 일치하지 않을
* @throws {UnprocessableDataException} 아래와 같은 경우 발생합니다.
* - 트랜잭션 처리 오류가 발생할
*/
/**
* 과제에 문제들을 추가합니다.
* @description
* 1. 과제와 그룹의 유효성을 검증합니다.
* 2. 이미 추가된 문제는 건너뛰고 새로운 문제만 트랜잭션으로 처리합니다.
* 3. 문제 추가 , 해당 문제의 '공개 제한 시간(visibleLockTime)' 과제 종료 시간으로 업데이트하고 그룹에 공유합니다.
* 4. 기존 과제 참여자들에 대해 해당 문제의 기록(AssignmentProblemRecord) 생성합니다.
* @param groupId 그룹 ID
* @param assignmentId 과제 ID
* @param assignmentProblemInput 추가할 문제 정보들
* @returns 추가된 과제들 정보
* @throws {EntityNotExistException} 아래와 같은 경우 발생합니다.
* - 요청한 과제가 존재하지 않을
* @throws {ForbiddenAccessException} 아래와 같은 경우 발생합니다.
* - 요청한 그룹 ID와 과제에 해당하는 그룹 ID가 일치하지 않을
* @throws {UnprocessableDataException} 아래와 같은 경우 발생합니다.
* - 트랜잭션 처리 오류가 발생할
*/

제미나이에 따르면 위처럼 적어주면 좋다고 하네요 @description 어노테이션을 쓰면 좋을 듯 합니다
이 API를 제외한 부분에는 visibleLockTime 업데이트에 대한 주석이 따로 있으니 신경 안써도 될 듯 합니다

* 1. 해당 대회의 존재 여부를 확인
* 2. 대회에 포함된 모든 문제 정보를 가져와 매핑 테이블(problemOrderMap : problem - index)을 생성
* 3. 공지 목록을 최신순으로 조회한 후
* 4. 각 공지의 problemOrderMap 매핑 테이블을 통해 '문제 순서(problemOrder)'대로 반환
Copy link
Contributor

Choose a reason for hiding this comment

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

line 68부터 71을 보면 index는 contestProblems의 forEach 배열 인덱스에요. 근데 뭔가 문제순서 ProblemOrder라고 쓰니까 contestProblem.order로 착각할 수 있을 것 같아서 아래처럼 수정하는게 뭔가 더 좋을 것 같아요!

  1. 대회에 포함된 모든 문제를 가져와 problemId → 배열 인덱스 매핑 테이블을 생성
  2. 공지 목록을 최신순으로 조회한 후
  3. 각 공지에 매핑 테이블을 통해 problemOrder(배열 인덱스)를 부여하여 반환

* 특정 대회 내의 기존 공지 정보 수정
*
* 1. 대회 및 공지 존재 여부를 확인
* 2. input으로 기반으로 공지 내용을 업데이트
Copy link
Contributor

Choose a reason for hiding this comment

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

input을(오타) 기반으로

* 1. UserGroup 중 AssignmentRecord이 없는 유저를 필터링
* 2. 대량 생성(Batch Create)
* - 신규 참가자들의 AssignmentRecord을 일괄 생성
* - 해당 유저들이 풀어야 할 각 AssignmentProblemRecord을 일괄 생성
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 이부분은 아래에 있는 inviteAllCourseMembersToAssignment랑 헷갈린 것 같아요! JSdoc이랑 autoFinalizeScore랑 실제 동작이랑 완전 달라요

}

/**
* 특정 유저의 특정 과제 내 문제 기록(제출 기록 및 점수 등)을 조회합니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

이것도 뭔가 헷갈리게 쓰여있는 것 같아요! 특정 유저의 과제 내 모든 문제가 채점 완료 되었는지 확인하는 메소드입니다

*
* @param {number} assignmentId 과제 ID
* @param {number} groupId 그룹 ID
* @returns 과제 상세 정보, 참가사 수
Copy link
Contributor

Choose a reason for hiding this comment

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

참가자 오타있어요

* 제출 내역(Submission)은 복사되지 않습니다.
*
* 1. assignment, assignmentProblem, assignmentRecord을 병렬 조회
* 2. 현재 시간을 기준으로 과제가 진행 중이면 새 과제를 즉시 공개(isVisible: true)로, 그 외에는 MAX_DATE로 설정
Copy link
Contributor

Choose a reason for hiding this comment

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

MAX_DATE는 여기서 안쓰여요. '그 외에는 비공개(isVisible: false)로 설정' 요걸로 바꿀까요

* @param {number} groupId 그룹 ID
* @param {number} take 가져올 레코드 개수
* @param {number | null} cursor 페이지네이션 커서
* @param {string} searchingName 검색 유저 이름 (선택사항)
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 공부해보다가 알았는데요. jsdoc에서는 옵셔널을 []로 표현한대요. 하하 저도 몰랐어요. 그래서 (선택사항) 이렇게 쓰기 보다는
@param {string} [searchingName] 검색 유저 이름
이렇게 쓰는게 더 좋대요.

혹시 나중에도 지나가다가 이런거 보이면 통일해주세요 ㅋㅋ 저도 첨알음

/**
* 문제 별 Accepted된 testcase의 개수 (latestSubmission 기준)
*/
// 문제 별 Accepted된 testcase의 개수 (latestSubmission 기준)
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 수정 좋은데요

/**
* 문제 별 score과 testcase 개수(전체, 정답)에 대한 집합 배열
*/
// 문제 별 score과 testcase 개수(전체, 정답)에 대한 집합 배열
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

Choose a reason for hiding this comment

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

고봉밥 리뷰 투척

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants