Skip to content

Commit

Permalink
[refactor/InhaBas#179] API 명세서와의 차이 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
whitem4rk committed Dec 16, 2023
1 parent 7992912 commit a3387e0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ boolean validate(Object value) {
if (Objects.isNull(value)) return true;
if (!(value instanceof Integer)) return false;
int o = (Integer) value;
return 1 <= o && o <= 5; // 1학년부터 5학년(초과학기)까지 가능, 0학년은 학생이 아닐때
return 0 <= o && o <= 5; // 1학년부터 5학년(초과학기)까지 가능, 0학년은 학생이 아닐때
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public SchoolInformation(String major, Integer generation, MemberType memberType
this.major = new Major(major);
this.generation = new Generation(generation);
this.memberType = memberType;
this.grade = new Grade(DEFAULT_GRADE);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ public void No_Such_Grade() {
IllegalArgumentException.class,
() -> new Grade(-1)
);
assertThrows(
IllegalArgumentException.class,
() -> new Grade(0)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/lecture/**").hasRole(DEACTIVATED.toString())

// 회원가입 일정 수정
.antMatchers(HttpMethod.PUT,"/signUp/schedule").hasRole(CHIEF.toString())
.antMatchers(HttpMethod.PUT,"/signUp/schedule").hasAnyRole(CHIEF.toString(), VICE_CHIEF.toString())

// 회원가입은 ANONYMOUS 권한은 명시적으로 부여받은 상태에서만 가능
.antMatchers("/signUp/**").hasRole(SIGNING_UP.toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.inhabas.api.web;

import com.inhabas.api.auth.domain.oauth2.majorInfo.dto.MajorInfoDto;
import com.inhabas.api.domain.questionnaire.dto.QuestionnaireDto;
import com.inhabas.api.domain.signUp.dto.AnswerDto;
import com.inhabas.api.domain.signUp.dto.SignUpDto;
import com.inhabas.api.domain.signUp.usecase.SignUpService;
import com.inhabas.api.domain.questionnaire.dto.QuestionnaireDto;
import com.inhabas.api.web.argumentResolver.Authenticated;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
Expand All @@ -13,7 +13,6 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -108,7 +107,7 @@ public ResponseEntity<List<AnswerDto>> loadAnswers(@Authenticated Long memberId)
@PostMapping("/signUp/answers")
@Operation(summary = "회원가입 시 자신이 작성한 답변을 임시 저장한다.")
@ApiResponses({
@ApiResponse(responseCode = "204"),
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "400", description = "답변이 길이제한을 초과했을 경우"),
@ApiResponse(responseCode = "403", description = "권한이 없습니다.")
})
Expand All @@ -117,7 +116,7 @@ public ResponseEntity<?> saveAnswers(

signUpService.saveAnswers(answers, memberId);

return ResponseEntity.noContent().build();
return ResponseEntity.ok().build();

}

Expand All @@ -128,7 +127,7 @@ public ResponseEntity<?> saveAnswers(
public ResponseEntity<?> finishSignUp(@Authenticated Long memberId, @Valid @RequestBody Optional<List<AnswerDto>> answers) {

signUpService.completeSignUp(answers.orElse(new ArrayList<>()), memberId);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
return ResponseEntity.noContent().build();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void getApprovedMembers() throws Exception {

}

@DisplayName("비활동 이상 멤버 권한을 변경할 때 가능한 권한이면 200, 아니면 400을 반환한다.")
@DisplayName("비활동 이상 멤버 권한을 변경할 때 가능한 권한이면 204, 아니면 400을 반환한다.")
@ParameterizedTest
@ValueSource(strings = {"ADMIN", "SIGNING_UP"})
public void updateApprovedMembers(String roleString) throws Exception {
Expand Down

0 comments on commit a3387e0

Please sign in to comment.