Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#24 quick scan bug fix #28

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import sopt.univoice.domain.notice.dto.*;
import sopt.univoice.domain.notice.entity.Notice;
import sopt.univoice.domain.notice.service.NoticeService;
import sopt.univoice.infra.common.dto.SuccessMessage;
import sopt.univoice.infra.common.dto.SuccessStatusResponse;
Expand Down Expand Up @@ -74,24 +75,34 @@ public ResponseEntity<SuccessStatusResponse<Object>> viewCount(@PathVariable Lon
.body(SuccessStatusResponse.of(SuccessMessage.VIEW_NOTICE_SUCCESS, null));
}

@GetMapping("/quickhead")
public ResponseEntity<SuccessStatusResponse<Object>> quickhead() {
QuickScanDTO response = noticeService.quickhead();
return ResponseEntity.status(HttpStatus.OK)
.body(SuccessStatusResponse.of(SuccessMessage.GET_ALL_NOTICE_SUCCESS, response));
}

@GetMapping("/all")
public ResponseEntity<SuccessStatusResponse<Object>> getAllNoticeByUserUniversity() {
GetAllNoticesResponseDTO response = noticeService.getAllNoticeByUserUniversity();
List<NoticeDTO> response = noticeService.getAllNoticeByUserUniversity();
return ResponseEntity.status(HttpStatus.OK)
.body(SuccessStatusResponse.of(SuccessMessage.GET_ALL_NOTICE_SUCCESS, response));
}



@GetMapping("/university")
public ResponseEntity<SuccessStatusResponse<Object>> getUniversityNoticeByUserUniversity() {
GetMainNoticesResponseDTO response = noticeService.getUniversityNoticeByUserUniversity();
List<NoticeDTO> response = noticeService.getUniversityNoticeByUserUniversity();
return ResponseEntity.status(HttpStatus.OK)
.body(SuccessStatusResponse.of(SuccessMessage.GET_ALL_UNIVERSITY_NOTICE_SUCCESS, response));
}



@GetMapping("/college-department")
public ResponseEntity<SuccessStatusResponse<Object>> getCollegeDepartmentNoticeByUserUniversity() {
GetMainNoticesResponseDTO response = noticeService.getCollegeDepartmentNoticeByUserUniversity();
List<NoticeResponseDTO> response = noticeService.getCollegeDepartmentNoticeByUserUniversity();


return ResponseEntity.status(HttpStatus.OK)
Expand All @@ -100,7 +111,7 @@ public ResponseEntity<SuccessStatusResponse<Object>> getCollegeDepartmentNoticeB

@GetMapping("/department")
public ResponseEntity<SuccessStatusResponse<Object>> getDepartmentNoticeByUserUniversity() {
GetMainNoticesResponseDTO response = noticeService.getDepartmentNoticeByUserUniversity();
List<NoticeResponseDTO> response = noticeService.getDepartmentNoticeByUserUniversity();


return ResponseEntity.status(HttpStatus.OK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@NoArgsConstructor
@AllArgsConstructor
public class GetMainNoticesResponseDTO {
private QuickScanResponseDTO quickScans;
// private QuickScanResponseDTO quickScans;
private QuickScanDTO quickScans;
private List<NoticeResponseDTO> notices;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NoticeResponseDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public interface NoticeRepository extends JpaRepository<Notice, Long> {
@Query("SELECT n FROM Notice n WHERE n.member.universityName = :universityName")
List<Notice> findAllByMemberUniversityName(String universityName);

long countByMemberUniversityNameAndMemberAffiliationAffiliation(String universityName, String affiliation);
long countByMemberCollegeDepartmentNameAndMemberAffiliationAffiliation(String collegeDepartmentName, String affiliation);
long countByMemberDepartmentNameAndMemberAffiliationAffiliation(String departmentName, String affiliation);
List<Notice> findByMemberUniversityNameAndMemberAffiliationAffiliation(String universityName, String affiliation);


Expand Down
Loading
Loading