Skip to content

Commit

Permalink
feat: 컨트롤러에 기능 추가
Browse files Browse the repository at this point in the history
- 캐릭터 총 개수 반환
- 전투력 1등 반환
- 레벨 1등 반환
- 유니온 1등 반환
  • Loading branch information
yechan-kim committed Nov 23, 2024
1 parent 72f9ca8 commit d2ec4c2
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.dpbr.dpbrbe.domain.character.presentation.dto.request.SearchRequest;
import com.dpbr.dpbrbe.domain.character.presentation.dto.request.UpdateRequest;
import com.dpbr.dpbrbe.domain.character.presentation.dto.response.AverageResponse;
import com.dpbr.dpbrbe.domain.character.presentation.dto.response.InfoResponse;
import com.dpbr.dpbrbe.domain.character.presentation.dto.response.RankingResponse;
import com.dpbr.dpbrbe.domain.character.presentation.dto.response.SearchResponse;
import com.dpbr.dpbrbe.domain.character.usecase.AverageStatisticsService;
Expand Down Expand Up @@ -151,4 +152,60 @@ public ResponseEntity<GlobalResponseDto<AverageResponse>> combatPowerAverage() {
return ResponseEntity.status(HttpStatus.OK)
.body(GlobalResponseDto.success(averageStatisticsService.combatPower(), SuccessCode.SUCCESS));
}

@Operation(summary = "레벨 1등 캐릭터", description = "전체 전투력 1등 캐릭터의 정보를 호출합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "401", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@GetMapping("/top/level")
public ResponseEntity<GlobalResponseDto<InfoResponse>> topLevel() {
return ResponseEntity.status(HttpStatus.OK)
.body(GlobalResponseDto.success(rankService.topLevel(), SuccessCode.SUCCESS));
}

@Operation(summary = "유니온 레벨 1등 캐릭터", description = "전체 유니온 레벨 1등 캐릭터의 정보를 호출합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "401", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@GetMapping("/top/union")
public ResponseEntity<GlobalResponseDto<InfoResponse>> topUnionLevel() {
return ResponseEntity.status(HttpStatus.OK)
.body(GlobalResponseDto.success(rankService.topUnionLevel(), SuccessCode.SUCCESS));
}

@Operation(summary = "전투력 1등 캐릭터", description = "전체 전투력 1등 캐릭터의 정보를 호출합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "401", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@GetMapping("/top/combat-power")
public ResponseEntity<GlobalResponseDto<InfoResponse>> topCombatPower() {
return ResponseEntity.status(HttpStatus.OK)
.body(GlobalResponseDto.success(rankService.topCombatPower(), SuccessCode.SUCCESS));
}

@Operation(summary = "캐릭터 수", description = "전체 캐릭터의 수를 호출합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "401", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@GetMapping("/count")
public ResponseEntity<GlobalResponseDto<Integer>> count() {
return ResponseEntity.status(HttpStatus.OK)
.body(GlobalResponseDto.success(averageStatisticsService.count(), SuccessCode.SUCCESS));
}
}

0 comments on commit d2ec4c2

Please sign in to comment.