diff --git a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java index ddbddcf..a7a517c 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java @@ -165,7 +165,7 @@ public class ResidentAndDisabledController { return RestResponse.of(service.findJudgeResults(dto)); } - //@Secured(policy = SecurityPolicy.TOKEN) + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "관리자 심사기준 적용 심사 처리" , description = "관리자 심사기준 적용 심사 처리") @PostMapping(value="/admin/judge", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveJudgeStds( @@ -176,6 +176,12 @@ public class ResidentAndDisabledController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) + @Operation(summary = "dashboard" , description = "dashboard") + @GetMapping(value="/admin/dashboard", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getDashboard() { + return RestResponse.of(service.findDashboard()); + } //--------------------------------------------------------------------------------- // 심사자 //--------------------------------------------------------------------------------- diff --git a/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java index bd2977a..1cf2212 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java @@ -80,6 +80,8 @@ public interface IResidentAndDisabledService { void saveJudgeStds(final JudgeStdDto dto); + Map findDashboard(); + //--------------------------------------------------------------------------------- // 심사자 //--------------------------------------------------------------------------------- diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java index 29b106b..d638203 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java @@ -10,6 +10,7 @@ import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.entity.*; import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper; import com.xit.biz.ctgy.repository.*; +import com.xit.biz.ctgy.service.IPublicBoardService; import com.xit.biz.ctgy.service.IResidentAndDisabledService; import com.xit.core.constant.ErrorCode; import com.xit.core.exception.CustomBaseException; @@ -63,6 +64,8 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { private final IParkingRepository parkingRepository; private final ICmmFileService fileService; + private final IPublicBoardService pBoardService; + private final EntityManager entityManager; //--------------------------------------------------------------------------------- @@ -343,6 +346,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { }); } + @Transactional(readOnly = true) + public Map findDashboard(){ + Map resultMap = new HashMap<>(); + resultMap.put("pBoardList", pBoardService.findAll(MinInfoBoard680.builder().build(), PageRequest.of(0, 6))); + return resultMap; + } + private void setFileInfoAndFileUpload(GnRecallScDto dto, MultipartFile[] mfs, String setMethodName) { String makePath = fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]); //makePath = makePath + File.separator; diff --git a/src/main/java/com/xit/core/oauth2/api/controller/UserController.java b/src/main/java/com/xit/core/oauth2/api/controller/UserController.java index 12662f2..890ec21 100644 --- a/src/main/java/com/xit/core/oauth2/api/controller/UserController.java +++ b/src/main/java/com/xit/core/oauth2/api/controller/UserController.java @@ -74,7 +74,7 @@ public class UserController { @Operation(summary = "사용자 정보 조회" , description = "등록된 사용자 정보 조회") - //@Secured(policy = SecurityPolicy.TOKEN) + @Secured(policy = SecurityPolicy.TOKEN) @GetMapping("/me") public ResponseEntity getMyMemberInfo() { return RestResponse.of(userService.getMyInfo());