소스 정리

thkim
Lim\jun 2024-02-27 13:36:11 +09:00
parent 144b6790a1
commit 3963007183
1 changed files with 1 additions and 63 deletions

View File

@ -1,6 +1,5 @@
package com.dbnt.kcscbackend.admin.dashboard;
//import com.dbnt.kcscbackend.admin.dashboard.dto.MonthlyUserLogDTO;
import com.dbnt.kcscbackend.admin.dashboard.service.AdminDashboardService;
import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.config.common.BaseController;
@ -13,17 +12,12 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigInteger;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@RequiredArgsConstructor
@ -71,7 +65,7 @@ public class AdminDashboardController extends BaseController {
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.POST, value = "/file", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO getfile(@AuthenticationPrincipal LoginVO user)
public ResultVO getFile(@AuthenticationPrincipal LoginVO user)
throws Exception {
ResultVO resultVO = new ResultVO();
@ -90,60 +84,4 @@ public class AdminDashboardController extends BaseController {
// @Operation(
// summary = "일별 사용자 현황 차트 조회",
// description = "일별 사용자 현황 차트 조회",
// tags = {"AdminDashboardController"}
// )
// @ApiResponses(value = {
// @ApiResponse(responseCode = "200", description = "조회 성공"),
// @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
// })
// @RequestMapping(method = RequestMethod.GET, value = "/daily-user-log-list", consumes = MediaType.APPLICATION_JSON_VALUE)
// public ResultVO getDailyUserLogList() throws Exception {
// ResultVO resultVO = new ResultVO();
// Map<String, Object> resultMap = new HashMap<>();
//
// // 현재 날짜
// // todo endDate 뒤에 .minus 지워야함
// LocalDate endDate = LocalDate.now().minusMonths(6);
// // 3개월 전 날짜 계산
// LocalDate startDate = endDate.minusMonths(3);
//
// resultMap.put("dailyUserLogList", adminDashboardService.selectDailyUserLogList(startDate, endDate));
// resultVO.setResult(resultMap);
// return resultVO;
// }
//
// @Operation(
// summary = "월별 사용자 현황 차트 조회",
// description = "월별 사용자 현황 차트 조회",
// tags = {"AdminDashboardController"}
// )
// @ApiResponses(value = {
// @ApiResponse(responseCode = "200", description = "조회 성공"),
// @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
// })
// @RequestMapping(method = RequestMethod.GET, value = "/monthly-user-log-list", consumes = MediaType.APPLICATION_JSON_VALUE)
// public ResultVO getMonthlyUserLogList() throws Exception {
// ResultVO resultVO = new ResultVO();
// Map<String, Object> resultMap = new HashMap<>();
//
// // 현재 날짜
// // todo endDate 뒤에 .minus 지워야함
// LocalDate endDate = LocalDate.now().minusMonths(6);
// // 3개월 전 날짜 계산
// LocalDate startDate = endDate.minusMonths(3);
//
// List<Object[]> result = adminDashboardService.selectMonthlyUserLogList(startDate, endDate);
// List<MonthlyUserLogDTO> monthlyUserLogDTOList = result.stream()
// .map(row -> new MonthlyUserLogDTO((String) row[0], (BigInteger) row[1]))
// .collect(Collectors.toList());
//
// resultMap.put("dailyUserLogList", monthlyUserLogDTOList);
// resultVO.setResult(resultMap);
// return resultVO;
// }
}