Skip to content

Commit

Permalink
Merge pull request #83 from GDSC-KNU/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
kwonssshyeon authored Aug 19, 2024
2 parents bed7ea2 + 7ed8aeb commit ea48d25
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Profile({"dev", "prod", "local"})
@Configuration
public class SwaggerConfig {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.gdsc_knu.official_homepage.annotation.TokenMember;
import com.gdsc_knu.official_homepage.authentication.jwt.JwtMemberDetail;
import com.gdsc_knu.official_homepage.dto.role.UserRoleRequest;
import com.gdsc_knu.official_homepage.service.PermissionSerivce;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
Expand All @@ -17,6 +17,7 @@
public class RoleController {
private final PermissionSerivce permissionSerivce;

@Hidden
@PatchMapping("core")
@Operation(summary="❗core 권한으로 테스트하기 위한 임시 API ❗", description = "매번 sql update 하기 번거로워서 임시로 만듦")
public ResponseEntity<String> coreMember(@TokenMember JwtMemberDetail jwtMemberDetail){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gdsc_knu.official_homepage.controller.admin;

import com.gdsc_knu.official_homepage.service.MailService;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
Expand All @@ -16,6 +17,7 @@
public class MailController {
private final MailService mailService;

@Hidden
@GetMapping("/mail")
@Operation(summary = "최종 합/불 지원자마다 메일 발송 API")
public void mailTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public interface ApplicationStatisticType {
Integer getTotal();
Integer getOpenCount();
Integer getApprovedCount();
Integer getRejectedCount();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ public interface ApplicationRepository extends JpaRepository<Application, Long>,

@Query("SELECT " +
"COUNT(CASE WHEN a.applicationStatus != 'TEMPORAL' THEN 1 END) AS total, " +
"COUNT(CASE WHEN a.isOpened = true THEN 1 END) AS openCount, " +
"COUNT(CASE WHEN a.applicationStatus = 'APPROVED' THEN 1 END) AS approvedCount " +
"COUNT(CASE WHEN a.isOpened = true AND a.applicationStatus != 'TEMPORAL' THEN 1 END) AS openCount, " +
"COUNT(CASE WHEN a.applicationStatus = 'APPROVED' THEN 1 END) AS approvedCount, " +
"COUNT(CASE WHEN a.applicationStatus = 'REJECTED' THEN 1 END) AS rejectedCount " +
"FROM Application a")
ApplicationStatisticType getStatistics();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ public class AdminApplicationService {
@Transactional(readOnly = true)
public AdminApplicationResponse.Statistics getStatistic() {
ApplicationStatisticType statistic = applicationRepository.getStatistics();
//TODO: Builder를 바로 사용하는게 가독성 좋을거 같음
return AdminApplicationResponse.Statistics.of(
statistic.getTotal(),
statistic.getOpenCount(),
statistic.getTotal() - statistic.getOpenCount(),
statistic.getApprovedCount(),
statistic.getTotal() - statistic.getApprovedCount());
statistic.getRejectedCount());
}


Expand Down

0 comments on commit ea48d25

Please sign in to comment.