Skip to content

Commit

Permalink
feat: 자기소개 조회 api 추가 - #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Dh3356 committed Feb 26, 2024
1 parent 84fd862 commit 71c5c89
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.mjulikelion.baker.controller;

import static org.mjulikelion.baker.constant.RegexPatterns.APPLICATION_STUDENT_ID_PATTERN;

import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import org.mjulikelion.baker.dto.response.ResponseDto;
import org.mjulikelion.baker.dto.response.introduce.IntroduceGetResponseData;
import org.mjulikelion.baker.service.introduce.IntroduceQueryService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("introduce")
public class IntroduceController {
private final IntroduceQueryService introduceQueryService;

@GetMapping()
@Cacheable(value = "applicationByStudentId", key = "#studentId")
public ResponseEntity<ResponseDto<IntroduceGetResponseData>> getStudentIntroduce(
@RequestParam(value = "studentId")
@Pattern(regexp = APPLICATION_STUDENT_ID_PATTERN, message = "학번이 형식에 맞지 않습니다.") String studentId
) {
return this.introduceQueryService.getStudentIntroduce(studentId);
}
}

0 comments on commit 71c5c89

Please sign in to comment.