Skip to content

Commit

Permalink
[DEV-44] Lecture 테이블 pk 수정 반영 (#285)
Browse files Browse the repository at this point in the history
* refactor: Lecture 엔티티 pk 수정

* test: Lecture 엔티티 pk 수정에 따른 테스트 수정

* chore: codeowners 추가

* refactor: 전공 실습 과목 조회 로직 추가
  • Loading branch information
5uhwann authored Nov 20, 2024
1 parent 6b07cb9 commit ebd657a
Show file tree
Hide file tree
Showing 59 changed files with 437 additions and 463 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @stophwan @5uhwann @Hoya324
* @stophwan @5uhwann @k-kbk @tiemo0708
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
// implementation 'org.flywaydb:flyway-core:6.4.2'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.9'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
implementation 'io.sentry:sentry-logback:1.7.30'

runtimeOnly 'mysql:mysql-connector-java'
Expand All @@ -58,7 +58,13 @@ dependencies {
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'


testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.testcontainers:testcontainers:1.19.0'
testImplementation 'org.testcontainers:mysql:1.19.0'
testImplementation 'org.testcontainers:junit-jupiter:1.19.0'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.plzgraduate.myongjigraduatebe.core.meta.LoginUser;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import com.plzgraduate.myongjigraduatebe.core.meta.LoginUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;

@Tag(name = "CompletedCredit")
public interface FindCompletedCreditApiPresentation {

@Operation(summary = "기이수 학점 조회", description = "유저의 기이수 학점 조회 API")
@Parameter(name = "userId", description = "로그인한 유저의 PK값 - 자동 적용")
List<CompletedCreditResponse> getCompletedCredits(@LoginUser Long userId);
@SecurityRequirement(name = "AccessToken")
List<CompletedCreditResponse> getCompletedCredits(@Parameter(hidden = true) @LoginUser Long userId);
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
package com.plzgraduate.myongjigraduatebe.core.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI springOpenApi() {
return new OpenAPI().info(new Info()
.title("Myongji-Graduate API Documentation")
.description("졸업을 부탁해 서비스의 API 명세서입니다.")
.version("v2.0.0"));
}
@Bean
public OpenAPI springOpenApi() {
return new OpenAPI().info(new Info()
.title("Myongji-Graduate API Documentation")
.description("졸업을 부탁해 서비스의 API 명세서입니다.")
.version("v2.0.0"))
.components(securityComponents());
}

private Components securityComponents() {
return new Components()
.addSecuritySchemes(
"AccessToken",
new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.scheme("bearer")
.bearerFormat("JWT")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.plzgraduate.myongjigraduatebe.graduation.domain.model.GraduationCategory;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestParam;

Expand All @@ -13,6 +14,7 @@ public interface FindDetailGraduationApiPresentation {

@Operation(summary = "졸업 카테고리 상세 결과 조회", description = "유저의 각 졸업 카테고리 상세 결과를 조회한다.")
@Parameter(name = "graduationCategory", description = "상세 조회하고자 하는 졸업 카테고리")
DetailGraduationResultResponse getDetailGraduation(@LoginUser Long userId,
@SecurityRequirement(name = "AccessToken")
DetailGraduationResultResponse getDetailGraduation(@Parameter(hidden = true) @LoginUser Long userId,
@RequestParam GraduationCategory graduationCategory);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,23 @@
@Getter
public class LectureResponse {

@Schema(name = "id", example = "6")
private final Long id;
@Schema(name = "code", example = "KMA02103")
private final String code;
@Schema(name = "id", example = "KMA02103")
private final String id;
@Schema(name = "name", example = "종교와과학")
private final String name;
@Schema(name = "credit", example = "2")
private final int credit;

@Builder
private LectureResponse(Long id, String code, String name, int credit) {
private LectureResponse(String id, String name, int credit) {
this.id = id;
this.code = code;
this.name = name;
this.credit = credit;
}

public static LectureResponse from(Lecture lecture) {
return LectureResponse.builder()
.id(lecture.getId())
.code(lecture.getLectureCode())
.name(lecture.getName())
.credit(lecture.getCredit())
.build();
Expand Down
Loading

0 comments on commit ebd657a

Please sign in to comment.