Skip to content

Commit

Permalink
Merge pull request EveryUniv#43 from EveryUniv/dev
Browse files Browse the repository at this point in the history
Release dev_deploy
  • Loading branch information
gutanbug authored Jan 4, 2024
2 parents c97a53a + 1acc239 commit fde4a79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
@RequestMapping("with-dankook/study")
@RequiredArgsConstructor
public class StudyController {

private final StudyService studyService;

/**
Expand Down Expand Up @@ -116,4 +115,16 @@ public void delete(AppAuthentication auth,
@PathVariable Long id) {
studyService.delete(id, auth.getUserId(), auth.isAdmin());
}

/**
* 단터디 게시글 모집 완료 처리
* 유저가 처리하거나 관리자가 강제로 처리할 수 있습니다.
*
* @param id 게시글 id
*/
@PatchMapping("/{id}")
@UserAuth
public void close(AppAuthentication auth, @PathVariable Long id) {
studyService.close(id, auth.getUserId());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.dku.council.domain.with_dankook.repository;

import com.dku.council.domain.with_dankook.model.dto.list.SummarizedTradeDto;
import com.dku.council.domain.with_dankook.model.entity.WithDankook;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -59,8 +58,8 @@ public interface WithDankookRepository<T extends WithDankook> extends JpaReposit
"where w.id = :withDankookId and (w.withDankookStatus in ('FULL', 'CLOSED'))")
int findWithClosedOrFullByIdToCreateReview(@Param("withDankookId") Long withDankookId);

@Query("select COUNT(*) from WithDankook w " +
"where w.id = :withDankookId and " +
"((w.withDankookStatus in ('FULL', 'CLOSED')) or (w.withDankookStatus = 'ACTIVE' and w.endTime <= CURRENT_TIMESTAMP)) ")
@Query(value = "select COUNT(*) from with_dankook w " +
"where w.with_dankook_id = :withDankookId and " +
"((w.with_dankook_status in ('FULL', 'CLOSED')) or (w.with_dankook_status = 'ACTIVE' and w.end_time <= CURRENT_TIMESTAMP())) ", nativeQuery = true)
int findWithClosedOrFullOrActiveByIdToCreateReview(@Param("withDankookId") Long withDankookId);
}

0 comments on commit fde4a79

Please sign in to comment.