Skip to content

Commit

Permalink
[feat] : close api
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBean99 committed Sep 3, 2023
1 parent 29df409 commit 485858e
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 24 deletions.
Binary file modified .gradle/7.6.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.authorizeRequests()
.mvcMatchers(SwaggerPatterns)
.permitAll()
// .mvcMatchers("/v1/auth/oauth/**")
// .permitAll()
// .mvcMatchers("/v1/auth/token/refresh")
// .permitAll()
// .mvcMatchers(HttpMethod.GET,
// "/v1/events/{eventId:[0-9]*$}/ticketItems")
// .permitAll()
// .mvcMatchers(HttpMethod.GET,
// "/v1/events/{eventId:[0-9]*$}/comments/**")
// .permitAll()
.mvcMatchers(HttpMethod.GET, "/api/v1/token")
.permitAll()
.mvcMatchers(HttpMethod.POST, "/api/v1/questions")
Expand All @@ -90,9 +80,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.permitAll()
.mvcMatchers(HttpMethod.POST, "/api/v1/login")
.permitAll()
// TODO 임시로 모든 요청 permit -> 채승이가 로그인 로직 완성하면 수정
.mvcMatchers("/**")
.permitAll()
// .mvcMatchers("/**")
// .permitAll()
// 스웨거용 인메모리 유저의 권한은 SWAGGER 이다
// 따라서 스웨거용 인메모리 유저가 basic auth 필터를 통과해서 들어오더라도
// ( jwt 필터나 , basic auth 필터의 순서는 상관이없다.) --> 왜냐면 jwt는 토큰 여부 파악만하고 있으면 검증이고 없으면 넘김.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.econovation.recruit.api.interviewer.usecase.InterviewerUseCase;
import com.econovation.recruitcommon.annotation.ApiErrorExceptionsExample;
import com.econovation.recruitcommon.annotation.DevelopOnlyApi;
import com.econovation.recruitdomain.domains.dto.InterviewerResponseDto;
import com.econovation.recruitdomain.domains.interviewer.domain.Interviewer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -34,8 +35,8 @@ public ResponseEntity<Interviewer> findByApplicantId(
@Operation(description = "Interviewer 전체 조회", summary = "면접관 전체 조회")
@ApiErrorExceptionsExample(InterviewerExceptionDocs.class)
@GetMapping("/interviewers")
public ResponseEntity<List<Interviewer>> findAll() {
List<Interviewer> interviewers = interviewerUseCase.findAll();
public ResponseEntity<List<InterviewerResponseDto>> findAll() {
List<InterviewerResponseDto> interviewers = interviewerUseCase.findAll();
return new ResponseEntity(interviewers, HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.econovation.recruit.api.interviewer.helper.IdpHelper;
import com.econovation.recruit.api.interviewer.usecase.InterviewerUseCase;
import com.econovation.recruitdomain.domains.dto.InterviewerCreateDto;
import com.econovation.recruitdomain.domains.dto.InterviewerResponseDto;
import com.econovation.recruitdomain.domains.interviewer.domain.Interviewer;
import com.econovation.recruitdomain.domains.interviewer.domain.Role;
import com.econovation.recruitdomain.out.InterviewerLoadPort;
Expand Down Expand Up @@ -48,8 +49,9 @@ public void createInterviewersByName(List<String> names) {
}

@Override
public List<Interviewer> findAll() {
return interviewerLoadPort.findAll();
public List<InterviewerResponseDto> findAll() {
List<Interviewer> interviewers = interviewerLoadPort.findAll();
return interviewers.stream().map(InterviewerResponseDto::from).collect(Collectors.toList());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.econovation.recruit.api.interviewer.usecase;

import com.econovation.recruitcommon.annotation.UseCase;
import com.econovation.recruitdomain.domains.dto.InterviewerResponseDto;
import com.econovation.recruitdomain.domains.interviewer.domain.Interviewer;
import java.util.List;

Expand All @@ -14,7 +15,7 @@ public interface InterviewerUseCase {

void createInterviewersByName(List<String> names);

List<Interviewer> findAll();
List<InterviewerResponseDto> findAll();

void createTempInterviewers();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.econovation.recruitdomain.domains.dto;

import com.econovation.recruitdomain.domains.interviewer.domain.Interviewer;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;

@Data
@Getter
@Builder
public class InterviewerResponseDto {
private Long id;
private String name;
private Integer year;
private String email;
private String role;

public static InterviewerResponseDto from(Interviewer interviewer) {
return InterviewerResponseDto.builder()
.id(interviewer.getId())
.name(interviewer.getName())
.year(interviewer.getYear())
.email(interviewer.getEmail())
.role(interviewer.getRole().toString())
.build();
}
}
3 changes: 1 addition & 2 deletions server/Recruit-Domain/src/main/resources/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (3,
INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (4,NOW(),NOW(),"홍보 및 디자인팀");
INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (5,NOW(),NOW(),"지원자 대응팀");
INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (6,NOW(),NOW(),"OT 담당팀");
INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (7,NOW(),NOW(),"기타 참고");
INSERT INTO interviewer (idp_id, name, role, year, email, password) VALUES (0,"이서현_관리자","ROLE_TF", 21, "[email protected]","asldnwlq!@Tqwashg");
INSERT INTO navigation (navigation_id, created_at, updated_at, title) VALUES (7,NOW(),NOW(),"기타 참고");
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.services.ses.SesClient;
import software.amazon.awssdk.services.ses.model.Body;
import software.amazon.awssdk.services.ses.model.Content;
import software.amazon.awssdk.services.ses.model.Destination;
import software.amazon.awssdk.services.ses.model.Message;
import software.amazon.awssdk.services.ses.model.RawMessage;
import software.amazon.awssdk.services.ses.model.SendEmailRequest;
import software.amazon.awssdk.services.ses.model.SendEmailRequest.Builder;
import software.amazon.awssdk.services.ses.model.SendRawEmailRequest;

@Component
Expand Down

0 comments on commit 485858e

Please sign in to comment.