Skip to content

Commit

Permalink
Merge pull request #225 from kookmin-sw/feature/be/#216-TimerAOP
Browse files Browse the repository at this point in the history
Feature/be/#216 timer aop
  • Loading branch information
mclub4 authored May 17, 2024
2 parents be41d9e + 6b0a3c3 commit a815df7
Show file tree
Hide file tree
Showing 16 changed files with 98 additions and 8 deletions.
2 changes: 2 additions & 0 deletions back/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ dependencies {
testImplementation "org.testcontainers:junit-jupiter:1.19.7"
testImplementation "org.testcontainers:mysql:1.19.7"

implementation 'org.springframework.boot:spring-boot-starter-aop'

//QueryDSL
implementation "com.querydsl:querydsl-core"
implementation "com.querydsl:querydsl-collections"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-04-30T01:59:17+0900",
date = "2024-05-17T01:46:23+0900",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.9 (JetBrains s.r.o.)"
)
public class AnnouncementMapperImpl implements AnnouncementMapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-04-30T01:59:17+0900",
date = "2024-05-17T01:46:24+0900",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 17.0.9 (JetBrains s.r.o.)"
)
public class UserMapperImpl implements UserMapper {
Expand All @@ -22,6 +22,7 @@ public User signupReqeustToUser(SignupRequest request) {

user.id( request.uuid() );
user.email( request.email() );
user.bigmajor( request.bigmajor() );
user.major( request.major() );
user.country( request.country() );
user.name( request.name() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.example.capstone.domain.announcement.service.AnnouncementSearchService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.error.exception.BusinessException;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down Expand Up @@ -42,6 +43,7 @@ ResponseEntity<?> test(
.ok("");
}

@Timer
@GetMapping("")
@Operation(summary = "공지사항 받아오기", description = "커서기반으로 공지사항을 받아옵니다")
@ApiResponses(value = {
Expand All @@ -50,7 +52,7 @@ ResponseEntity<?> test(
})
ResponseEntity<ApiResult<AnnouncementListWrapper>> getAnnouncementList(
@Parameter(description = "공지사항 유형입니다. 입력하지 않으면 전체를 받아옵니다.")
@RequestParam(defaultValue = "all", value = "type") String type,
@RequestParam(defaultValue = "전체", value = "type") String type,
@Parameter(description = "공지사항 언어입니다. 입력하지 않으면 한국어로 받아옵니다.")
@RequestParam(defaultValue = "KO", value = "language") String language,
@Parameter(description = "어디까지 로드됐는지 가르키는 커서입니다. 입력하지 않으면 처음부터 10개 받아옵니다.")
Expand All @@ -74,6 +76,7 @@ ResponseEntity<ApiResult<AnnouncementListWrapper>> getAnnouncementList(
.ok(new ApiResult<>("Successfully load announcement list", response));
}

@Timer
@GetMapping("/{announcementId}")
@Operation(summary = "공지사항 세부정보 받아오기", description = "공지사항의 세부적인 내용을 받아옵니다.")
@ApiResponses(value = {
Expand All @@ -86,6 +89,7 @@ ResponseEntity<ApiResult<Announcement>> getAnnouncementDetail(@PathVariable(valu
.ok(new ApiResult<>("Successfully load announcement", announcement));
}

@Timer
@GetMapping("/search")
@Operation(summary = "공지사항 검색기반으로 가져오기", description = "검색한 공지사항을 커서기반으로 받아옵니다. 2글자 이상으로만 검색됩니다.")
@ApiResponses(value = {
Expand All @@ -94,7 +98,7 @@ ResponseEntity<ApiResult<Announcement>> getAnnouncementDetail(@PathVariable(valu
})
ResponseEntity<ApiResult<AnnouncementListWrapper>> getAnnouncementSearchList(
@Parameter(description = "공지사항 유형입니다. 입력하지 않으면 전체를 받아옵니다.")
@RequestParam(defaultValue = "all", value = "type") String type,
@RequestParam(defaultValue = "전체", value = "type") String type,
@Parameter(description = "공지사항 언어입니다. 입력하지 않으면 한국어로 받아옵니다.")
@RequestParam(defaultValue = "KO", value = "language") String language,
@Parameter(description = "어디까지 로드됐는지 가르키는 커서입니다. 입력하지 않으면 처음부터 10개 받아옵니다.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.capstone.domain.announcement.dto;

@Deprecated
public record AnnouncementSearchListRequest(
String word
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Deprecated
public class AnnouncementFile {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Slice<AnnouncementListResponse> getFilteredAnnouncementsWithPaging(Long c
predicate = predicate.and(eqCursorId(cursorId));
predicate = predicate.and(announcement.language.eq(language));

if(!type.equals("all")){
if(!type.equals("전체")){
predicate = predicate.and(announcement.type.eq(type));
}

Expand Down Expand Up @@ -60,7 +60,7 @@ public Slice<AnnouncementListResponse> getFilteredSearchAnnouncementsWithPaging(
predicate = predicate.and(eqCursorId(cursorId));
predicate = predicate.and(announcement.language.eq(language));

if(!type.equals("all")){
if(!type.equals("전체")){
predicate = predicate.and(announcement.type.eq(type));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.capstone.domain.help.service.HelpService;
import com.example.capstone.domain.jwt.JwtTokenProvider;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand All @@ -19,6 +20,7 @@ public class HelpController {

private final HelpService helpService;

@Timer
@PostMapping(value = "/create")
@Operation(summary = "헬퍼글 생성", description = "request 정보를 기반으로 헬퍼글을 생성합니다.")
@ApiResponse(responseCode = "200", description = "request 정보를 기반으로 생성된 헬퍼글을 반환됩니다.")
Expand All @@ -31,6 +33,7 @@ public ResponseEntity<ApiResult<HelpResponse>> createHelp(@RequestHeader("X-User
.ok(new ApiResult<>("Successfully create help", helpResponse));
}

@Timer
@GetMapping("/read")
@Operation(summary = "헬퍼글 불러오기", description = "id를 통해 해당 글을 가져옵니다.")
@ApiResponse(responseCode = "200", description = "해당 id의 글을 반환합니다.")
Expand All @@ -42,6 +45,7 @@ public ResponseEntity<ApiResult<HelpResponse>> readHelp(
.ok(new ApiResult<>("Successfully read help", helpResponse));
}

@Timer
@PutMapping("/update")
@Operation(summary = "헬퍼글 수정", description = "request 정보를 기반으로 글을 수정합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 리턴합니다.")
Expand All @@ -53,6 +57,7 @@ public ResponseEntity<ApiResult<Integer>> updateHelp(@RequestHeader("X-User-ID")
.ok(new ApiResult<>("Successfully update help", 200));
}

@Timer
@DeleteMapping("/erase")
@Operation(summary = "헬퍼글 삭제", description = "id를 기반으로 해당 글을 삭제합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 리턴합니다.")
Expand All @@ -64,6 +69,7 @@ public ResponseEntity<ApiResult<Integer>> eraseHelp(
.ok(new ApiResult<>("Successfully delete help", 200));
}

@Timer
@PostMapping("/list")
@Operation(summary = "헬퍼글 미리보기 리스트 생성", description = "request 정보를 기반으로 페이지네이션이 적용된 헬퍼글 리스트를 반환합니다.")
@ApiResponse(responseCode = "200", description = "request 조건에 맞는 헬퍼글 리스트를 반환합니다.")
Expand All @@ -76,6 +82,7 @@ public ResponseEntity<ApiResult<HelpSliceResponse>> listHelp(
.ok(new ApiResult<>("Successfully create help list", response));
}

@Timer
@PutMapping("/done")
@Operation(summary = "헬퍼글 모집 종료", description = "id에 맞는 헬퍼글을 모집 종료합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.capstone.domain.menu.service.MenuSearchService;
import com.example.capstone.domain.menu.service.MenuUpdateService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.json.JsonArray;
import lombok.RequiredArgsConstructor;
Expand All @@ -24,6 +25,7 @@ public class MenuController {
private final MenuSearchService menuSearchService;
private final MenuUpdateService menuUpdateService;

@Timer
@GetMapping("/daily")
public ResponseEntity<ApiResult<List<Object>>> getMenuByDate(@RequestParam LocalDate date, @RequestParam String language){
List<Object> menu = menuSearchService.findMenuByDate(date, language);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.capstone.domain.qna.service.AnswerService;
import com.example.capstone.domain.like.service.LikeService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand All @@ -19,6 +20,7 @@ public class AnswerController {
private final AnswerService answerService;
private final LikeService likeService;

@Timer
@PostMapping("/create")
@Operation(summary = "댓글 생성", description = "request 정보를 기반으로 댓글을 생성합니다.")
@ApiResponse(responseCode = "200", description = "생성된 댓글을 반환합니다.")
Expand All @@ -30,6 +32,7 @@ public ResponseEntity<ApiResult<AnswerResponse>> createAnswer(@RequestHeader("X-
.ok(new ApiResult<>("Successfully create answer",answer));
}

@Timer
@PostMapping("/list")
@Operation(summary = "댓글 리스트 생성", description = "request 정보를 기반으로 댓글의 리스트를 생성합니다.")
@ApiResponse(responseCode = "200", description = "request 정보를 기반으로 생성된 댓글의 리스트가 반환됩니다.")
Expand All @@ -41,6 +44,7 @@ public ResponseEntity<ApiResult<AnswerSliceResponse>> listAnswer(@RequestHeader(
.ok(new ApiResult<>("Successfully create answer list", response));
}

@Timer
@PutMapping("/update")
@Operation(summary = "댓글 수정", description = "request 정보를 기반으로 댓글을 수정합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환됩니다.")
Expand All @@ -52,6 +56,7 @@ public ResponseEntity<ApiResult<Integer>> updateAnswer(@RequestHeader("X-User-ID
.ok(new ApiResult<>("Successfully update answer", 200));
}

@Timer
@DeleteMapping("/erase")
@Operation(summary = "질문글 삭제", description = "댓글 id를 통해 해당글을 삭제합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200이 반환됩니다.")
Expand All @@ -62,6 +67,7 @@ public ResponseEntity<ApiResult<Integer>> eraseAnswer( @Parameter(description
.ok(new ApiResult<>("Successfully delete answer", 200));
}

@Timer
@PutMapping("/like")
@Operation(summary = "댓글 추천", description = "해당 id의 댓글을 추천합니다. 현재 추천 댓글 여부를 관리하지 않습니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환합니다.")
Expand All @@ -75,6 +81,7 @@ public ResponseEntity<ApiResult<Integer>> upLikeCount(@RequestHeader("X-User-ID"
.ok(new ApiResult<>("Successfully like answer", 200));
}

@Timer
@PutMapping("/unlike")
@Operation(summary = "댓글 추천 해제", description = "해당 id의 댓글을 추천 해제합니다. 현재 추천 댓글 여부를 관리하지 않습니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.example.capstone.domain.qna.service.FAQService;
import com.example.capstone.domain.qna.service.ImageService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand All @@ -30,7 +31,7 @@ public class FAQController {

private final ImageService imageService;


@Timer
@PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@Operation(summary = "FAQ글 생성", description = "request 정보를 기반으로 FAQ글을 생성합니다. imgList 정보를 통해 이미지 파일을 업로드 합니다")
@ApiResponse(responseCode = "200", description = "request 정보를 기반으로 생성된 FAQ글과 imgList을 통해 업로드된 이미지 파일의 url 정보가 함께 반환됩니다.")
Expand All @@ -49,6 +50,7 @@ public ResponseEntity<ApiResult<FAQEntireResponse>> createFAQ(
.ok(new ApiResult<>("Successfully create FAQ", new FAQEntireResponse(faq, urlList)));
}

@Timer
@GetMapping("/read")
@Operation(summary = "FAQ글 읽기", description = "FAQ글을 읽어 반환합니다.")
@ApiResponse(responseCode = "200", description = "FAQ글의 내용이 담긴 faqResponse와 첨부이미지 주소가 담긴 imgUrl이 반환됩니다.")
Expand All @@ -60,6 +62,7 @@ public ResponseEntity<ApiResult<FAQEntireResponse>> readFAQ( @Parameter(descri
.ok(new ApiResult<>("Successfully read FAQ", new FAQEntireResponse(faqResponse, urlList)));
}

@Timer
@PutMapping("/update")
@Operation(summary = "FAQ글 수정", description = "FAQ글을 수정합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환합니다.")
Expand All @@ -70,6 +73,7 @@ public ResponseEntity<ApiResult<Integer>> updateFAQ( @Parameter(description = "F
.ok(new ApiResult<>("Successfully update FAQ", 200));
}

@Timer
@DeleteMapping("/erase")
@Operation(summary = "FAQ글 삭제", description = "FAQ글을 삭제합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 반환합니다.")
Expand All @@ -85,6 +89,7 @@ public ResponseEntity<ApiResult<Integer>> eraseFAQ( @Parameter(description = "
.ok(new ApiResult<>("Successfully delete FAQ", 200));
}

@Timer
@PostMapping("/list")
@Operation(summary = "FAQ글의 미리보기 리스트 생성", description = "FAQ글 리스트를 생성하여 반환합니다.")
@ApiResponse(responseCode = "200", description = "FAQ글의 미리보기 리스트가 반환됩니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.example.capstone.domain.qna.service.ImageService;
import com.example.capstone.domain.qna.service.QuestionService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand All @@ -28,6 +29,7 @@ public class QuestionController {
private final QuestionService questionService;
private final ImageService imageService;

@Timer
@PostMapping(value = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@Operation(summary = "질문글 생성", description = "request 정보를 기반으로 질문글을 생성합니다. imgList 정보를 통해 이미지 파일을 업로드 합니다")
@ApiResponse(responseCode = "200", description = "request 정보를 기반으로 생성된 질문글과 imgList을 통해 업로드된 이미지 파일의 url 정보가 함께 반환됩니다.")
Expand All @@ -45,6 +47,7 @@ public ResponseEntity<ApiResult<QuestionEntireResponse>> createQuestion(@Request
.ok(new ApiResult<>("Successfully create question", new QuestionEntireResponse(quest, urlList)));
}

@Timer
@GetMapping("/read")
@Operation(summary = "질문글 불러오기", description = "id를 통해 해당 질문글을 가져옵니다.")
@ApiResponse(responseCode = "200", description = "해당 id의 질문글과 이미지 url을 반환합니다.")
Expand All @@ -57,6 +60,7 @@ public ResponseEntity<ApiResult<QuestionEntireResponse>> readQuestion(
.ok(new ApiResult<>("Successfully read question", new QuestionEntireResponse(questionResponse, urlList)));
}

@Timer
@PutMapping("/update")
@Operation(summary = "질문글 수정", description = "request 정보를 기반으로 질문글을 수정합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 리턴합니다.")
Expand All @@ -68,6 +72,7 @@ public ResponseEntity<ApiResult<Integer>> updateQuestion(@RequestHeader("X-User-
.ok(new ApiResult<>("Successfully update question", 200));
}

@Timer
@DeleteMapping("/erase")
@Operation(summary = "질문글 삭제", description = "id를 기반으로 해당 질문글을 삭제합니다.")
@ApiResponse(responseCode = "200", description = "완료시 200을 리턴합니다.")
Expand All @@ -84,6 +89,7 @@ public ResponseEntity<ApiResult<Integer>> eraseQuestion(
.ok(new ApiResult<>("Successfully delete question", 200));
}

@Timer
@PostMapping("/list")
@Operation(summary = "질문글 미리보기 리스트 생성", description = "request 정보를 기반으로 페이지네이션이 적용된 질문글 리스트를 반환합니다.")
@ApiResponse(responseCode = "200", description = "request 조건에 맞는 질문글 리스트를 반환합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.example.capstone.domain.speech.dto.SpeechRequest;
import com.example.capstone.domain.speech.service.SpeechService;
import com.example.capstone.global.dto.ApiResult;
import com.example.capstone.global.util.Timer;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import lombok.RequiredArgsConstructor;
Expand All @@ -25,6 +26,7 @@
public class SpeechController {
private final SpeechService speechService;

@Timer
@PostMapping(value = "/test",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "발음평가 매서드", description = "발음평가 음성파일(.wav)과 비교문을 통해 발음평가 결과를 반환합니다.")
Expand Down
Loading

0 comments on commit a815df7

Please sign in to comment.