diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmAddressMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmAddressMgtController.java deleted file mode 100644 index 50b06bc..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmAddressMgtController.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.xit.biz.cmm.controller; - -//import com.xit.biz.cmm.domain.CmmAddress; -//import com.xit.biz.cmm.service.impl.CmmAddressMgtService; -//import com.xit.core.api.ApiResponseDto; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import lombok.RequiredArgsConstructor; -//import org.springframework.web.bind.annotation.*; -// -///** -// * @author Lim, Jong Uk (minuk926) -// * @since 2021-07-16 -// */ -// -//@RestController -//@RequiredArgsConstructor -//@RequestMapping("/api/biz/cmm/addr") -//@Api(tags = "CmmAddressMgtController") -//public class CmmAddressMgtController { -// -// private final CmmAddressMgtService cmmAddressMgtService; -// -// @Operation(description = "주소 등록") -// @PostMapping -// public ResponseEntity save(@RequestBody CmmAddress cmmAddress){ -// return ResponseEntity.ok().body(RestResult.of(cmmAddressMgtService.save(cmmAddress)); -// } -// -// @Operation(description = "주소 조회") -// @GetMapping -// public ResponseEntity findAll(){ -// return ResponseEntity.ok().body(RestResult.of(cmmAddressMgtService.findAll()); -// -// } -//} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmBoardMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmBoardMgtController.java deleted file mode 100644 index 00cf096..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmBoardMgtController.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.entity.CmmBoard; -import com.xit.biz.cmm.service.ICmmBoardService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.Optional; - -/** - *
- * ResponseEntity(HttpStatus status)
- * ResponseEntity(MultiValueMap headers, HttpStatus status)
- * ResponseEntity(@Nullable T body, @Nullable MultiValueMap headers, HttpStatus status)
- *
- * ResponseEntity 에 헤더값 set ::
- * MultiValueMap header = new LinkedMultiValueMap<>();
- * header.add("token", "xxxx");
- * header.add("authcode", "xxxxx");
- * return new ResponseEntity(header, HttpStatus.OK)
- * 
- */ - -@Tag(name = "CmmBoardMgtController", description = "게시판 관리") -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/board") -public class CmmBoardMgtController { - - private final ICmmBoardService cmmBoardService; - - //private CmmBoardMapstruct mapstruct = Mappers.getMapper(CmmBoardMapstruct.class); - - @Operation(summary = "게시판 목록 조회" , description = "등록된 게시판 목록 전체 조회") - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAll() { - return RestResponse.of(cmmBoardService.findAll()); - } -/* - Page loadCharactersPage( - @PageableDefault(page = 0, size = 20) - @SortDefault.SortDefaults({ - @SortDefault(sort = "name", direction = Sort.Direction.DESC), - @SortDefault(sort = "id", direction = Sort.Direction.ASC) - }) Pageable pageable) -*/ - - /** - * - * @param pageable - * @return - */ - @Operation(summary = "게시판 목록 조회(페이징)" , description = "등록된 게시판 목록 전체 조회(페이징)") - //@@Parameters({ - // @Parameter(name = "pageNumber", value = "조회할 페이지", required = false), // dataType = "Pageable", paramType = "Integer", defaultValue = "0"), - // @Parameter(name = "pageSize", value = "페이지당 갯수", required = false) //, dataType = "Pageable", paramType = "Integer", defaultValue = "10") - //}) - @GetMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAllPage(final Pageable pageable) { - - Page page = cmmBoardService.findAll(pageable); - //log.debug("Page : {}", page); - log.debug("Page number : {}", page.getNumber()); - log.debug("Page size : {}", page.getSize()); - log.debug("Total size : {}", page.getTotalPages()); - log.debug("Total count : {}", page.getTotalElements()); - log.debug("Prev : {}", page.hasPrevious()); - log.debug("Next : {}", page.hasNext()); - List list = page.getContent(); - return RestResponse.of(page); - } - - @Operation(summary = "게시물 상세 조회" , description = "등록된 게시물 상세") - @GetMapping(value = "/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findByBoardId(@PathVariable Long boardId) { - Optional board = cmmBoardService.findById(boardId); - return RestResponse.of(board.get()); - } - - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity saveBoard(@RequestBody CmmBoard board) { - return RestResponse.of(cmmBoardService.save(board)); - } - - - @PutMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateBoard(@RequestBody CmmBoard board) { - return RestResponse.of(cmmBoardService.update(board)); - } - - @DeleteMapping(value="/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteBoard(@PathVariable Long boardId) { - cmmBoardService.deleteById(boardId); - return RestResponse.of(HttpStatus.NO_CONTENT); - } -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmBoardWebController.java b/src/main/java/com/xit/biz/cmm/controller/CmmBoardWebController.java deleted file mode 100644 index fe1445f..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmBoardWebController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.xit.biz.cmm.controller; - -//import com.xit.biz.adm.mapstruct.BoardJpaMapper; - -import com.xit.biz.cmm.entity.CmmBoard; -import com.xit.biz.cmm.service.ICmmBoardService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.Optional; - -/** - *
- * ResponseEntity(HttpStatus status)
- * ResponseEntity(MultiValueMap headers, HttpStatus status)
- * ResponseEntity(@Nullable T body, @Nullable MultiValueMap headers, HttpStatus status)
- *
- * ResponseEntity 에 헤더값 set ::
- * MultiValueMap header = new LinkedMultiValueMap<>();
- * header.add("token", "xxxx");
- * header.add("authcode", "xxxxx");
- * return new ResponseEntity(header, HttpStatus.OK)
- * 
- */ -@Slf4j -@Controller -@RequiredArgsConstructor -@RequestMapping("/web/biz/cmm/board") -public class CmmBoardWebController { - - private final ICmmBoardService cmmBoardService; - - //private CmmBoardMapstruct mapstruct = Mappers.getMapper(CmmBoardMapstruct.class); - - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public String boardForm(Model model) { - return "/biz/adm/boardManagement"; - } -/* - Page loadCharactersPage( - @PageableDefault(page = 0, size = 20) - @SortDefault.SortDefaults({ - @SortDefault(sort = "name", direction = Sort.Direction.DESC), - @SortDefault(sort = "id", direction = Sort.Direction.ASC) - }) Pageable pageable) -*/ - - /** - * - * @param pageable Pageable - * @return String - */ - @GetMapping(value = "/page") //, produces = MediaType.APPLICATION_JSON_VALUE) - public String findAllPage(final Pageable pageable, Model model) { - - Page page = cmmBoardService.findAll(pageable); - //log.debug("Page : {}", page); - log.debug("Page number : {}", page.getNumber()); - log.debug("Page size : {}", page.getSize()); - log.debug("Total size : {}", page.getTotalPages()); - log.debug("Total count : {}", page.getTotalElements()); - log.debug("Prev : {}", page.hasPrevious()); - log.debug("Next : {}", page.hasNext()); - List list = page.getContent(); - model.addAttribute("data", list); - model.addAttribute("pagination", page.getPageable()); - model.addAttribute("title", "djdjjdjdjjd"); - return "biz/adm/boardManagement"; - } - -// @GetMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity> findByBoardIdGreaterThan(PageRequest pageRequest) { -// Page page = boardService.findByBoardIdGreaterThan(dto, pageRequest); -// log.debug("Page : {}", page); -// log.debug("Page number : {}", page.getNumber()); -// log.debug("Page size : {}", page.getSize()); -// log.debug("Total size : {}", page.getTotalPages()); -// log.debug("Total count : {}", page.getTotalElements()); -// log.debug("Prev : {}", page.hasPrevious()); -// log.debug("Next : {}", page.hasNext()); -// return ResponseEntity.ok(page); -// } - - @GetMapping(value = "/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findByBoardId(@PathVariable final Long boardId) { - Optional board = cmmBoardService.findById(boardId); - return RestResponse.of(board.get()); - } - - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity saveBoard(@RequestBody CmmBoard board) { - return RestResponse.of(cmmBoardService.save(board)); - } - - - @PutMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity updateBoard(@RequestBody CmmBoard board) { - return RestResponse.of(cmmBoardService.update(board)); - } - - @DeleteMapping(value="/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteBoard(@PathVariable final Long boardId) { - cmmBoardService.deleteById(boardId); - return RestResponse.of(HttpStatus.NO_CONTENT); - } - - - - - - @PostMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity saveBoardApi(@RequestBody CmmBoard board) { - return RestResponse.of(cmmBoardService.save(board)); - //return ResponseEntity.ok(boardService.save(board)); - } - - @GetMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAllApi() { - return RestResponse.of(cmmBoardService.findAll()); - //return ResponseEntity.ok(boardService.findAll(), HttpStatus.OK); - } - /* - Page loadCharactersPage( - @PageableDefault(page = 0, size = 20) - @SortDefault.SortDefaults({ - @SortDefault(sort = "name", direction = Sort.Direction.DESC), - @SortDefault(sort = "id", direction = Sort.Direction.ASC) - }) Pageable pageable) - */ - @GetMapping(value = "/api/page", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAllPageApi(final Pageable pageable) { - -// Page page = boardService.findAllPage(pageable); -// //log.debug("Page : {}", page); -// log.debug("Page number : {}", page.getNumber()); -// log.debug("Page size : {}", page.getSize()); -// log.debug("Total size : {}", page.getTotalPages()); -// log.debug("Total count : {}", page.getTotalElements()); -// log.debug("Prev : {}", page.hasPrevious()); -// log.debug("Next : {}", page.hasNext()); -// List list = page.getContent(); -// return ResponseEntity.ok(page); - - return RestResponse.of(cmmBoardService.findAll(pageable)); - } - -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java index 6ba1bf2..ab19b68 100644 --- a/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java +++ b/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java @@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; @@ -30,7 +31,7 @@ public class CmmCodeMgtController { private final ICmmCodeService cmmCodeService; @Operation(summary = "콤보코드조회" , description = "콤보코드를 조회") - @GetMapping("/combo") + @GetMapping(value="/combo", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findComboCodes(@Nonnull final CmmCodeSIds searchKeyDto) { Assert.notNull(searchKeyDto, "조회할 콤보코드 대상이 없습니다."); Assert.notNull(searchKeyDto.getCodeGrpId(), "조회할 대분류 코드를 선택해 주세요."); @@ -57,7 +58,7 @@ public class CmmCodeMgtController { @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), }) - @GetMapping("/grp") + @GetMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findCmmCodeGrps( @Parameter(hidden = true) final CmmCodeDto codeDto, @@ -68,8 +69,8 @@ public class CmmCodeMgtController { @Operation(summary = "코드 목록 조회") @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "G_CODE"), - @Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = " "), + @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "TRAFFIC"), + @Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = "GANGNAM_SIMSA"), @Parameter(in = ParameterIn.QUERY, name = "codeMcd", description = "중분류코드", required = false, example = " "), @Parameter(in = ParameterIn.QUERY, name = "codeCd", description = "코드", required = false, example = " "), @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드명", required = false, example = " "), @@ -83,13 +84,13 @@ public class CmmCodeMgtController { @Parameter(in = ParameterIn.QUERY, name = "createdDate", hidden = true), @Parameter(in = ParameterIn.QUERY, name = "modifiedDate", hidden = true) }) - @GetMapping + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findCmmCodes(@Parameter(hidden = true) @Nonnull final CmmCodeDto codeDto) { return RestResponse.of(cmmCodeService.findCmmCodes(codeDto)); } @Operation(summary = "코드그룹저장" , description = "코드그룹저장") - @PostMapping("/grp") + @PostMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) { return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp)); } diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmFileMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmFileMgtController.java deleted file mode 100644 index d59018b..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmFileMgtController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.entity.CmmFileMst; -import com.xit.biz.cmm.dto.CmmFileDto; -import com.xit.biz.cmm.service.ICmmFileService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import com.xit.core.util.AssertUtils; -import com.xit.core.util.Checks; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.lang.NonNull; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Nonnull; - -@Tag(name = "CmmFileMgtController", description = "파일 관리") -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/file") -public class CmmFileMgtController { - private final ICmmFileService cmmFileService; - - @Operation(summary = "파일 조회" , description = "등록된 파일 조회") - @GetMapping("/{id}") - public ResponseEntity findFiles(@PathVariable("id") @NonNull final String fileMstId) { - AssertUtils.isTrue(!Checks.isEmpty(fileMstId), "대상 파일[fileMstId]을 선택해 주세요."); - return RestResponse.of(cmmFileService.findFiles(fileMstId)); - } - - //@Operation(summary = "파일 저장" , description = "파일 저장") - //@PostMapping() - public ResponseEntity saveFiles2(CmmFileMst cmmFileMst, @RequestParam("files") MultipartFile[] files) { - AssertUtils.isTrue(!Checks.isEmpty(cmmFileMst), "파일 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(cmmFileMst.getFileCtgCd()), "파일 구분 코드[fileCtgCd] 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(cmmFileMst.getFileBizId()), "파일 업무 ID[fileBizId] 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(files), "대상 파일이 존재하지 않습니다."); - return RestResponse.of(cmmFileService.saveFiles(cmmFileMst, files)); - -// RedirectAttributes redirectAttributes -// redirectAttributes.addFlashAttribute("message", -// "You successfully uploaded " + file.getOriginalFilename() + "!"); -// -// return "redirect:/"; - } - - @Operation(summary = "파일 저장" , description = "파일 저장") - @PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public ResponseEntity saveFiles(@ModelAttribute @Nonnull CmmFileDto cmmFileDto) { - AssertUtils.isTrue(!Checks.isEmpty(cmmFileDto), "파일 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(cmmFileDto.getFileCtgCd()), "파일 구분 코드[fileCtgCd] 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(cmmFileDto.getFileBizId()), "파일 업무 ID[fileBizId] 정보가 존재하지 않습니다."); - AssertUtils.isTrue(!Checks.isEmpty(cmmFileDto.getFiles()), "대상 파일이 존재하지 않습니다."); - CmmFileMst cmmFileMst = CmmFileMst.builder() - .fileMstId(cmmFileDto.getFileMstId()) - .fileCtgCd(cmmFileDto.getFileCtgCd()) - .fileBizId(cmmFileDto.getFileBizId()) - .build(); - return RestResponse.of(cmmFileService.saveFiles(cmmFileMst, cmmFileDto.getFiles())); - -// RedirectAttributes redirectAttributes -// redirectAttributes.addFlashAttribute("message", -// "You successfully uploaded " + file.getOriginalFilename() + "!"); -// -// return "redirect:/"; - } -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmRoleMenuMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmRoleMenuMgtController.java deleted file mode 100644 index c5dd931..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmRoleMenuMgtController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.service.ICmmRoleMenuService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -@Tag(name = "CmmRoleMenuMgtController", description = "권한별 메뉴 관리") -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/role/menu") -public class CmmRoleMenuMgtController { - private final ICmmRoleMenuService cmmRoleUserService; - - @Operation(description = "권한별 메뉴 목록") - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAll() { - - return RestResponse.of(cmmRoleUserService.findAll()); - - } - -// @Operation(description = "권한 메뉴 목록 조회") -// @GetMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity findByCmmUserId( -// @Parameter(name="roleId", description = "권한ID", example = "") -// @PathVariable final String cmmUserId) { -// return RestResult.of(cmmRoleUserService.findById(cmmUserId)); -// } -// -// @Operation(description = "권한 메뉴 추가") -// @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity save(@RequestBody CmmRoleUer cmmRoleUer) { -// -// return RestResult.of(cmmRoleUserService.save(cmmRoleUer)); -// -// } -// -// @Operation(description = "권한 메뉴 삭제") -// @DeleteMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity deleteByCmmUserId(@PathVariable final String cmmUserId) { -// cmmRoleUserService.deleteById(cmmUserId); -// return RestResult.of(HttpStatus.OK); -// -// } -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmRoleMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmRoleMgtController.java deleted file mode 100644 index 24cbd1d..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmRoleMgtController.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.entity.CmmRole; -import com.xit.biz.cmm.service.ICmmRoleService; -import com.xit.biz.cmm.service.ICmmRoleUserService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -@Tag(name = "CmmRoleMgtController", description = "권한 관리") -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/role") -public class CmmRoleMgtController { - private final ICmmRoleService cmmRoleService; - private final ICmmRoleUserService cmmRoleUserService; - - @Operation(summary = "권한 목록 조회") - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAll() { - - return RestResponse.of(cmmRoleService.findAll()); - - } - -// @Operation(summary = "권한 목록 조회") -// @GetMapping(value="/page", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity findAllPage(final Pageable pageable) { -// -// Page page = cmmRoleRepository.findAll(PageRequest.of(pageable.getPageNumber(), pageable.getPageSize())); -// return ResponseEntity.ok().body(RestResult.of(page); -// -// } - - @Operation(summary = "권한 정보 조회") - @GetMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findByRoleId(@PathVariable final String roleId) { - return RestResponse.of(cmmRoleService.findById(roleId)); - } - - @Operation(summary = "권한 추가") - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity save(@RequestBody CmmRole cmmRole) { - - return RestResponse.of(cmmRoleService.save(cmmRole)); - - } - - @Operation(summary = "궘한 정보 변경") - @PutMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity modify(@PathVariable final String roleId, @RequestBody CmmRole cmmRoleEntity) { - return RestResponse.of(cmmRoleService.save(cmmRoleEntity)); - } - - @Operation(summary = "권한 삭제") - @DeleteMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteByRoleId(@PathVariable final String roleId) { - cmmRoleService.deleteById(roleId); - return RestResponse.of(HttpStatus.OK); - - } - -// @Operation(summary = "권한그룹 사용자 목록 조회") -// @GetMapping(value="/user/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity findUserMstByroleId( -// @Parameter(name = "roleId", description = "권한그룹 ID", example = "1") -// @PathVariable final String roleId) { -// return RestResult.of(cmmRoleUserService.findById(roleId)); -// } -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmRoleUserMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmRoleUserMgtController.java deleted file mode 100644 index e81c5b1..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmRoleUserMgtController.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.entity.CmmRoleUer; -import com.xit.biz.cmm.service.ICmmRoleUserService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -@Tag(name = "CmmRoleUserMgtController", description = "권한별 사용자 관리") -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/role/user") -public class CmmRoleUserMgtController { - private final ICmmRoleUserService cmmRoleUserService; - - @Operation(description = "사용자 권한 목록 조회") - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAll() { - - return RestResponse.of(cmmRoleUserService.findAll()); - - } - -// @Operation(description = "사용자 권한 목록 조회") -// @GetMapping(value="/page", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity findAllPage(final Pageable pageable) { -// -// Page page = cmmUserRoleRepository.findAll(PageRequest.of(pageable.getPageNumber(), pageable.getPageSize())); -// return RestResult.of(page); -// -// } - -// @Operation(description = "사용자 권한 그룹 목록 조회") -// @GetMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity findByCmmUserId( -// @Parameter(name="cmmUserId", description = "사용자 ID(PK)", example = "1") -// @PathVariable final String cmmUserId) { -// return RestResult.of(cmmRoleUserService.findById(cmmUserId)); -// } - - @Operation(description = "사용자 권한 추가") - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity save(@RequestBody CmmRoleUer cmmRoleUer) { - - return RestResponse.of(cmmRoleUserService.save(cmmRoleUer)); - - } - -// @Operation(description = "사용자 권한 삭제") -// @DeleteMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public ResponseEntity deleteByCmmUserId(@PathVariable final String cmmUserId) { -// cmmRoleUserService.deleteById(cmmUserId); -// return RestResult.of(HttpStatus.OK); -// -// } -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmUserMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmUserMgtController.java deleted file mode 100644 index 6b6527c..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmUserMgtController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.dto.struct.CmmUserMapstruct; -import com.xit.biz.cmm.entity.CmmUser; -import com.xit.biz.cmm.dto.CmmUserDto; -import com.xit.biz.cmm.service.ICmmRoleUserService; -import com.xit.biz.cmm.service.ICmmUserService; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.mapstruct.factory.Mappers; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -@Tag(name = "CmmUserMgtController", description = "사용자 관리") -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/api/biz/cmm/user") -public class CmmUserMgtController { - private final ICmmUserService cmmUserService; - private final ICmmRoleUserService cmmRoleUerService; - private final PasswordEncoder encoder; - - private CmmUserMapstruct cmmUserMapstruct = Mappers.getMapper(CmmUserMapstruct.class); - - @Operation(summary = "사용자 전체 목록 조회" , description = "등록된 사용자 전체 목록 조회") - @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), - @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") - }) - @GetMapping(value="/page1", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findAll(@Parameter(hidden = true) final Pageable pageable) { - //Page page = cmmUserRepository.findAll(PageRequest.of(paging.getPage(), paging.getSize())); - return RestResponse.of(cmmUserService.findAll(pageable)); - - } - - @Operation(summary = "사용자 목록 조회" , description = "등록된 사용자 목록 조회") -// @Parameter(description="CmmUserDto to add. Cannot null or empty.", -// required=true, schema=@Schema(implementation = CmmUserDto.class)) -// @Parameter(description="Pageable to add. Cannot null or empty.", -// required=true, schema=@Schema(implementation = Pageable.class)) - @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "userId", description = "사용자id", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "userName", description = "사용자이름", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "userMbl", description = "전화(핸드폰)번호", required = false, example = " "), - @Parameter(name = "userEmail", hidden = true), - @Parameter(name = "userPswd", hidden = true), - @Parameter(name = "authority", hidden = true), - @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), - @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") - //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), - }) - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findCmmUsers( - @Parameter(hidden = true) - @ModelAttribute("cmmUserDto") - final CmmUserDto cmmUserDto, - @Parameter(hidden = true) - final Pageable pageable) { - return RestResponse.of(cmmUserService.findCmmUsers(cmmUserMapstruct.toEntity(cmmUserDto), pageable)); - } - - @Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회") - @Parameter(in = ParameterIn.PATH, name = "cmmUserId", description = "사용자 ID(PK)", example = "1") - @GetMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findByCmmUserId( - @PathVariable final String cmmUserId) { - return RestResponse.of(cmmUserService.findById(cmmUserId)); - } - - @Operation(summary = "사용자 등록" , description = "신규 사용자 등록") - @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity save(@RequestBody @Valid CmmUser cmmUser) { - cmmUser.setPassword(encoder.encode(cmmUser.getPassword())); - return RestResponse.of(cmmUserService.save(cmmUser)); - - } - - @Operation(summary = "사용자 정보 변경" , description = "사용자 정보 변경") - @PutMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity modify( - @Parameter(name = "cmmUserId", description = "사용자 ID(PK)", example = "1", required = true) - @PathVariable final Long cmmUserId, @RequestBody CmmUser cmmUser) { - return RestResponse.of(cmmUserService.save(cmmUser)); - } - - @Operation(summary = "사용자 삭제" , description = "사용자 제거") - @DeleteMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity deleteById( - @Parameter(name = "cmmUserId", description = "사용자 ID(PK)", example = "1") - @PathVariable final String cmmUserId) { - cmmUserService.deleteByCmmUserId(cmmUserId); - return RestResponse.of(HttpStatus.OK); - - } - - @Operation(summary = "사용자 권한 그룹 목록 조회") - @GetMapping(value="/role/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findRoleGroupByCmmUserId( - @Parameter(name = "cmmUserId", description = "사용자 ID(PK)", example = "1") - @PathVariable final Long cmmUserId) { - return RestResponse.of(cmmRoleUerService.findById(cmmUserId)); - } - - -} diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmUserWebController.java b/src/main/java/com/xit/biz/cmm/controller/CmmUserWebController.java deleted file mode 100644 index 840ba87..0000000 --- a/src/main/java/com/xit/biz/cmm/controller/CmmUserWebController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xit.biz.cmm.controller; - -import com.xit.biz.cmm.service.ICmmUserService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -@Slf4j -@Controller -@RequiredArgsConstructor -@RequestMapping("/web/biz/cmm/user") -public class CmmUserWebController { - - private final ICmmUserService cmmUserService; - - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public String userForm() { - return "/biz/cmm/userManagement"; - } - -// @Operation(summary = "사용자 정보 조회", description = "사용자 정보 조회") -// @GetMapping(value = "/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public Mono findByCmmUserId(@PathVariable final Long cmmUserId) { -// CmmUser cmmUser = cmmUserRepository.findByCmmUserId(cmmUserId); -// return Mono.just( -// Rendering.view("/biz/cmm/userManagement.html") -// .modelAttribute("data", cmmUserRepository.findByCmmUserId(cmmUserId)) -// .build()); -// } -} diff --git a/src/main/java/com/xit/biz/cmm/dto/CmmBoardDto.java b/src/main/java/com/xit/biz/cmm/dto/CmmBoardDto.java deleted file mode 100644 index f282525..0000000 --- a/src/main/java/com/xit/biz/cmm/dto/CmmBoardDto.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.xit.biz.cmm.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.springframework.data.domain.Sort; - -/** - * MapStruct 사용을 위해 아래 사항 반드시 지킬 것 - * 1. @NoArgsConstructor - * 2. @Builder 사용 - * --> @Setter이 필요하나 사용을 지양하는 추세이므로 Builder 방식으로 generate 되도록 한다 - */ -@Schema(name = "CmmBoardDto", description = "게시판 관리용 DTO") -@Getter -@NoArgsConstructor -@AllArgsConstructor // Builder 사용시 필요 -@Builder -public class CmmBoardDto { - - @Schema(name = "board ID") - private Long boardId; - private String ctgCd; - private String title; - private String content; - private String fileBizId; - private String fileId; - private String filePath; - - private int pageNum; - private int pageSize; - private Sort.Direction direction; - private String[] sortArr; -} diff --git a/src/main/java/com/xit/biz/cmm/dto/CmmCodeDto.java b/src/main/java/com/xit/biz/cmm/dto/CmmCodeDto.java index fc1ac0a..63111bd 100644 --- a/src/main/java/com/xit/biz/cmm/dto/CmmCodeDto.java +++ b/src/main/java/com/xit/biz/cmm/dto/CmmCodeDto.java @@ -13,6 +13,7 @@ import java.io.Serializable; */ @Schema(name = "CmmCodeDto", description = "공통코드 DTO") @Getter +@Setter @NoArgsConstructor @AllArgsConstructor @Builder diff --git a/src/main/java/com/xit/biz/cmm/dto/CmmFileDto.java b/src/main/java/com/xit/biz/cmm/dto/CmmFileDto.java deleted file mode 100644 index d1d8bdb..0000000 --- a/src/main/java/com/xit/biz/cmm/dto/CmmFileDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xit.biz.cmm.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.springframework.web.multipart.MultipartFile; - -import java.io.Serializable; - -/** - * MapStruct 사용을 위해 아래 사항 반드시 지킬 것 - * 1. @NoArgsConstructor - * 2. @Builder 사용 - * --> @Setter이 필요하나 사용을 지양하는 추세이므로 Builder 방식으로 generate 되도록 한다 - */ -@Schema(name = "CmmFileDto", description = "파일 관리용 DTO") -@Getter -@NoArgsConstructor -@AllArgsConstructor // Builder 사용시 필요 -@Builder -public class CmmFileDto implements Serializable { - private static final long SerialVersionUID = 1L; - - @Schema(title = "파일 마스터 ID", description = "변경시 nonNull") - private String fileMstId; - - @Schema(required = true, title = "파일구분코드", example = "BOARD", description = "파일분류구분코드") - private String fileCtgCd; - - @Schema(required = true, title = "파일업무ID", example = "BOARD001", description = "업무테이블 PK조합") - private String fileBizId; - - @Schema(required = true, title = "파일객체", example = "null", description = "업로드 파일 객체") - private MultipartFile[] files; -} diff --git a/src/main/java/com/xit/biz/cmm/dto/CmmUserDto.java b/src/main/java/com/xit/biz/cmm/dto/CmmUserDto.java index 9913b4d..509ab01 100644 --- a/src/main/java/com/xit/biz/cmm/dto/CmmUserDto.java +++ b/src/main/java/com/xit/biz/cmm/dto/CmmUserDto.java @@ -28,6 +28,7 @@ import java.io.Serializable; */ @Schema(name = "CmmUserDto", description = "사용자 Dto") //, parent = AuditEntity.class) @Getter +@Setter @NoArgsConstructor @AllArgsConstructor @Builder diff --git a/src/main/java/com/xit/biz/cmm/dto/struct/CmmBoardMapstruct.java b/src/main/java/com/xit/biz/cmm/dto/struct/CmmBoardMapstruct.java deleted file mode 100644 index 26ccf94..0000000 --- a/src/main/java/com/xit/biz/cmm/dto/struct/CmmBoardMapstruct.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.xit.biz.cmm.dto.struct; - -import com.xit.biz.cmm.entity.CmmBoard; -import com.xit.biz.cmm.dto.CmmBoardDto; -import com.xit.core.support.jpa.mapstruct.IMapstruct; -import com.xit.core.support.jpa.mapstruct.MapStructMapperConfig; -import org.mapstruct.Builder; -import org.mapstruct.Mapper; - -@Mapper(config = MapStructMapperConfig.class) -public interface CmmBoardMapstruct extends IMapstruct { -} \ No newline at end of file diff --git a/src/main/java/com/xit/biz/cmm/entity/AddressType.java b/src/main/java/com/xit/biz/cmm/entity/AddressType.java deleted file mode 100644 index edd0351..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/AddressType.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import lombok.AllArgsConstructor; - -import java.util.Map; -import java.util.Objects; -import java.util.stream.Stream; - -import static java.util.stream.Collectors.toMap; - -@AllArgsConstructor -public enum AddressType { - STREET("STREET"), // 도로명 - LOT("LOT"); - // 지번 - private final String code; - - /** - * Serialization을 위해 반드시 필요 - * 미정의시 JSON parser 에러 발생 - throw HttpMessageNotReadableException - * @param symbol String - * @return RoleType - */ - @JsonCreator - public static AddressType fromString(String symbol){ - return stringToEnum.get(symbol); - } - - /** - * Deserialization을 위해 반드시 필요 - * 미정의시 JSON parser 에러 발생 - throw HttpMessageNotReadableException - * @return String - */ - @JsonValue - public String getCode(){ - return code; - } - - private static final Map stringToEnum = Stream.of(values()) - .collect(toMap(Objects::toString, e -> e)); - -} \ No newline at end of file diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmAddress.java b/src/main/java/com/xit/biz/cmm/entity/CmmAddress.java deleted file mode 100644 index 0b7b185..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmAddress.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.xit.biz.cmm.entity.ids.CmmAddressIds; -import com.xit.core.constant.XitConstants; -import com.xit.core.oauth2.oauth.entity.ProviderType; -import com.xit.core.support.jpa.AuditEntity; -import com.xit.core.support.valid.EnumNamePattern; -import com.xit.core.support.valid.Enums; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -@Schema(name = "CmmAddress", description = "주소") -@Table(name = "tb_cmm_address") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -@IdClass(CmmAddressIds.class) -public class CmmAddress extends AuditEntity implements Serializable { - private static final long SerialVersionUID = 1L; - - @Id - @JoinColumn(name = "cmm_user_id") - private String cmmUserId; - - @Id - @Schema(required = true, title = "주소일련번호", example = "001", description = "사용자별 일련번호") - @Column(name = "addr_seq", nullable = false, length = 3) - private String addrSeq; - -// @MapsId("userId") -// @ManyToOne -// @JoinColumn(name = "user_id") -// private CmmUser cmmUser; -// -// @EmbeddedId -// private CmmAddressIds addrSeq; - - @Schema(required = true, title = "주소 구분", example = "STREET", description = "지번 / 도로명") - @Column(nullable = false, length = 10) - @Enumerated(EnumType.STRING) - @EnumNamePattern(regexp = "STREET|LOT", message = "{auth.user.address.pattern.AddressType}") - private AddressType addressType; - - @Schema(required = true, title = "우편번호", example = "03001", description = "우편번호") - @Column(nullable = false, length = 6) - private String zipCode; - - @Schema(required = true, title = "기본 주소", example = "경기도 일산 동구 호수로 336", description = "기본 주소") - @Column(nullable = false, length = 100) - private String address1; - - @Schema(title = "상세 주소", example = "xxx아파트 xx동 xx호", description = "상세 주소") - @Column(nullable = false, length = 100) - private String address2; - - @Schema(title = "부가 주소", example = "null", description = "부가 주소 - 외국 주소인 경우 필요") - @Column(nullable = false, length = 100) - private String address3; - - @Schema(title = "기본주소 여부", example = "Y", description = "기본주소 여부") - //@Column(name = "default_yn", columnDefinition = "CHAR(1)", nullable = false, length = 1) - @Column(name = "default_yn", nullable = false, length = 1) - private String defaultYn; - -// public void setCmmUser(CmmUser cmmUser){ -// this.cmmUser = cmmUser; -// } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmAddress that = (CmmAddress) o; - - if (!Objects.equals(cmmUserId, that.cmmUserId)) return false; - return Objects.equals(addrSeq, that.addrSeq); - } - - @Override - public int hashCode() { - int result = Objects.hashCode(cmmUserId); - result = 31 * result + (Objects.hashCode(addrSeq)); - return result; - } -} diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmBoard.java b/src/main/java/com/xit/biz/cmm/entity/CmmBoard.java deleted file mode 100644 index 2d3d01d..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmBoard.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -@Schema(name = "CmmBoard", description = "게시판") -@Table( - name = "tb_cmm_board", - indexes = { - @Index(name = "idx_tb_cmm_board_01", columnList ="ctg_cd,title") - } -) -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmBoard extends AuditEntity implements Serializable{ - - private static final long SerialVersionUID = 1L; - - @Schema(required = true, title = "게시판 ID", example = " ", description = "자동부여") - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "board_id") - private Long boardId; - - @Schema(required = true, title = "카테고리 구분 코드", example = "ctg_1") - @Column(name = "ctg_cd", length = 20, nullable = false) - private String ctgCd; - - @Schema(required = true, title = "게시판 제목", example = "제목") - @Column(length = 128, nullable = false) - private String title; - - @Schema(required = true, title = "게시판 내용", example = "내용") - //@Column(columnDefinition = "TEXT", nullable = false) - @Column(nullable = false) - @Lob - private String content; - - - -/* - - @Transient - private int pageNum; - @Transient - private int pageSize; - @Transient - private int totalPage; - @Transient - private int totalCount; - - @Transient // DB에 저장도 조회도 하지 않는다 - private String firstName; - - @Transient - private String lastName; - - @Access(AccessType.PROPERTY) // FULLNAME 컬럼에 firstName+lastName의 결과가 저장됨 getter를 이용해서 접근한다. - public String getFullName(){ - return firstName + lastName; - } -*/ - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmBoard cmmBoard = (CmmBoard) o; - - return Objects.equals(boardId, cmmBoard.boardId); - } - - @Override - public int hashCode() { - return 1566954134; - } -} diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmFileDtl.java b/src/main/java/com/xit/biz/cmm/entity/CmmFileDtl.java deleted file mode 100644 index c389f08..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmFileDtl.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.xit.biz.cmm.entity.ids.CmmFileDtlIds; -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -@Schema(name = "CmmFileDtl", description = "파일 상세") //, parent = AuditEntity.class) -@Table( - name = "tb_cmm_file_dtl" -) -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -@IdClass(CmmFileDtlIds.class) -public class CmmFileDtl extends AuditEntity implements Serializable { - private static final long serialVersionUID = -543086850590535341L; - -// @MapsId(value = "fileMstId") - @Id - @Schema(required = true, title = "파일MstID", example = " ", description = "FileMst ID") - @Column(name = "file_mst_id", nullable = false) - private String fileMstId; -// -// @EmbeddedId - @Id - @Schema(required = true, title = "파일ID", example = " ", description = "UUID로 자동 생성") - @Column(name = "file_id", nullable = false, length = 50) - private String fileId;// = CommUtil.getStringFromUUID(); - -// @EmbeddedId -// private CmmFileDtlIds cmmFileDtlIds; - - @Schema(required = true, title = "원본파일명", example = "sample.jpg", description = "서버에서 처리") - @Column(name = "org_file_nm", nullable = false, length = 100) - private String orgFileNm; - - @Schema(required = true, title = "파일콘텐츠타입", example = "image/jpeg", description = "서버에서 처리") - @Column(name = "content_type", nullable = false, length = 200) - private String contentType; - - @Schema(required = true, title = "파일확장자", example = "jpg", description = "서버에서 처리") - @Column(name = "file_ext", nullable = false, length = 50) - private String fileExt; - - @Schema(required = true, title = "파일용량", example = " ", description = "서버에서 처리") - @Column(name = "file_size", nullable = false) - private Long fileSize; - - @Schema(required = true, title = "파일경로", example = " ", description = "서버에서 처리") - @Column(name = "file_upld_path", nullable = false, length = 100) - private String fileUpldPath; - - @Transient - @JsonIgnore - @ManyToOne - private CmmFileMst cmmFileMst; - - public void setCmmFileMst(CmmFileMst cmmFileMst){ - this.cmmFileMst = cmmFileMst; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmFileDtl that = (CmmFileDtl) o; - - if (!Objects.equals(fileMstId, that.fileMstId)) return false; - return Objects.equals(fileId, that.fileId); - } - - @Override - public int hashCode() { - int result = Objects.hashCode(fileMstId); - result = 31 * result + (Objects.hashCode(fileId)); - return result; - } -} \ No newline at end of file diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmFileMst.java b/src/main/java/com/xit/biz/cmm/entity/CmmFileMst.java deleted file mode 100644 index 45b9d0e..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmFileMst.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -@Schema(name = "CmmFileMst", description = "파일 마스터") //, parent = AuditEntity.class) -@Table( - name = "tb_cmm_file_mst", - indexes = { - @Index(unique = true, name = "idx_tb_file_mst_01", columnList ="file_ctg_cd, file_biz_id") - } -) -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmFileMst extends AuditEntity implements Serializable { - private static final long serialVersionUID = 5741919760452445573L; - - @Schema(required = true, title = "파일 마스터 ID", example = " ", description = "UUID로 생성") - @Id - @Setter - @Column(name = "file_mst_id", nullable = false, length = 40) - private String fileMstId; - - @Schema(required = true, title = "파일분류코드", example = "BOARD", description = "업무별분류코드") - @Column(name = "file_ctg_cd", nullable = false, length = 50) - private String fileCtgCd; - - @Schema(required = true, title = "파일업무ID", example = "1", description = "각업무테이블PK조합") - @Column(name = "file_biz_id", nullable = false, length = 50) - private String fileBizId; - - @Transient - @JsonIgnore - @OneToMany(targetEntity = CmmFileDtl.class, mappedBy = "cmmFileMst") - @Builder.Default - private Set cmmFileDtls = new HashSet<>(); - - public void setCmmFileDtls(CmmFileDtl cmmFileDtl){ - this.getCmmFileDtls().add(cmmFileDtl); - } - - public void addCmmFileDtls(CmmFileDtl cmmFileDtl){ - this.getCmmFileDtls().add(cmmFileDtl); - cmmFileDtl.setCmmFileMst(this); - } - - public void removeCmmFileDtls(CmmFileDtl cmmFileDtl){ - this.getCmmFileDtls().remove(cmmFileDtl); - cmmFileDtl.setCmmFileMst(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmFileMst that = (CmmFileMst) o; - - return Objects.equals(fileMstId, that.fileMstId); - } - - @Override - public int hashCode() { - return 761862093; - } -} \ No newline at end of file diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmMenu.java b/src/main/java/com/xit/biz/cmm/entity/CmmMenu.java deleted file mode 100644 index 6654262..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmMenu.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; -import org.hibernate.annotations.ColumnDefault; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -@Schema(name = "CmmMenu", description = "메뉴") //, parent = AuditEntity.class) -@Table(name = "tb_cmm_menu") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmMenu extends AuditEntity implements Serializable { - - @Schema(required = true, title = "메뉴ID", example = "C000000000", description = "메뉴ID") - @Id - @Column(name = "menu_id", nullable = false, length = 10) - private String menuId; - - @Schema(required = true, title = "상위메뉴ID", example = "ROOT", description = "ROOT - 최상위메뉴는 null") - @Column(name = "upr_menu_id", length = 10) - private String uprMenuId; - - @Schema(required = true, title = "메뉴명", example = "파일관리") - @Column(name = "menu_nm", nullable = false, length = 20) - private String menuNm; - - @Schema(required = true, title = "메뉴상세", example = "파일관리메뉴") - @Column(name = "menu_remark", length = 20) - private String menuRemark; - - @Schema(required = true, title = "메뉴URL", example = "/api/biz/cmm/file") - @Column(name = "menu_url", length = 200) - private String menuUrl; - - @Schema(required = true, title = "노출여부", example = "Y") - @Column(name = "expo_yn", nullable = false, length = 1) //, columnDefinition = "char(1)") - @ColumnDefault(value = "'Y'") - @Builder.Default - private String expoYn = "Y"; - - @Schema(required = true, title = "메뉴정렬순서", example = "99") - @Column(name = "menuOrdr", nullable = false, length = 3) //columnDefinition = "int(3)") - @ColumnDefault(value = "99") - private Integer menuOrdr; - - @Schema(hidden = true) - @Transient - @JsonIgnore - @OneToMany(targetEntity = CmmRoleMenu.class, mappedBy = "cmmMenuGrp") - @Builder.Default - private Set cmmRoles = new HashSet<>(); - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmMenu cmmMenu = (CmmMenu) o; - - return Objects.equals(menuId, cmmMenu.menuId); - } - - @Override - public int hashCode() { - return 1856257695; - } -} - -/* - , BTN_GRP_ID - , BTN_GRP_NM - , BTN_CSS_NM - , EVNT_NM - , DEL_YN -*/ - - diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmRole.java b/src/main/java/com/xit/biz/cmm/entity/CmmRole.java deleted file mode 100644 index ab65d2b..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmRole.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -@Schema(name = "CmmRole", description = "권한") -@Table(name = "tb_cmm_role") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmRole extends AuditEntity implements Serializable { - private static final long SerialVersionUID = 1L; - - @Schema(required = true, title = "권한ID", example = "ADMIN_01") - @Id - @Column(name = "role_id", length = 10, nullable = false) - private String roleId; - - @Schema(required = true, title = "권한 이름", example = "ROLE_ADMIN") - @Column(name = "role_name", length = 20, nullable = false) - private String roleName; - - @Schema(name = "권한 설명", example = "관리자") - @Column(name = "role_remark", length = 100, nullable = true) - private String roleRemark; - - @Transient - @JsonIgnore - @OneToMany(targetEntity = CmmUser.class, mappedBy = "cmmUserMst") - private final Set cmmUsers = new HashSet<>(); - - public void setCmmUsers(CmmUser cmmUser){ - this.getCmmUsers().add(cmmUser); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmRole cmmRole = (CmmRole) o; - - return Objects.equals(roleId, cmmRole.roleId); - } - - @Override - public int hashCode() { - return 904897982; - } -} diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmRoleMenu.java b/src/main/java/com/xit/biz/cmm/entity/CmmRoleMenu.java deleted file mode 100644 index 193f6ff..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmRoleMenu.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.xit.biz.cmm.entity; - -import com.xit.core.support.jpa.AuditEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -@Schema(name = "CmmRoleMenu", description = "권한별메뉴") -@Table(name = "tb_cmm_role_menu") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmRoleMenu extends AuditEntity implements Serializable { - private static final long SerialVersionUID = 1L; - -// @Schema(required = true, title = "메뉴그룹ID", example = "G_MENU_1", description = "메뉴그룹ID") -// @Id -// @Column(name = "menu_grp_id", nullable = false, length = 10) -// private String menuGrpId; -// -// @Schema(required = true, title = "메뉴ID", example = "C000000000", description = "메뉴ID") -// @Id -// @Column(name = "menu_id", nullable = false, length = 10) -// private String menuId; - - @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Schema(required = true, title = "권한ID", example = "ADMIN_01") - @Column(name = "role_id", nullable = false, length = 10) - private String roleId; - - @Schema(required = true, title = "메뉴ID", example = "C000000000") - @Column(name = "menu_id", nullable = false, length = 10) - private String menuId; - - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "role_id", insertable = false, updatable = false) - private CmmRole cmmRole; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "menu_id", insertable = false, updatable = false) - private CmmMenu cmmMenu; - -// @Schema(hidden = true) -// //@Transient -// @ManyToOne(targetEntity = CmmRole.class, fetch = FetchType.LAZY) -// @JoinColumn(name="role_id", insertable = false, updatable = false) -// private CmmRole cmmRole; -// -// @Schema(hidden = true) -// //@Transient -// @ManyToOne(targetEntity = CmmMenu.class, fetch = FetchType.LAZY) -// @JoinColumn(name = "menu_id", insertable = false, updatable = false) -// private CmmMenu cmmMenu; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmRoleMenu that = (CmmRoleMenu) o; - - return Objects.equals(id, that.id); - } - - @Override - public int hashCode() { - return 1632561512; - } -} diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmRoleUer.java b/src/main/java/com/xit/biz/cmm/entity/CmmRoleUer.java deleted file mode 100644 index 305066d..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/CmmRoleUer.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.xit.biz.cmm.entity; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.Hibernate; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - -@Schema(name = "CmmRoleUer", description = "권한별사용자") -@Table(name = "tb_cmm_role_user") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder -public class CmmRoleUer implements Serializable { - private static final long SerialVersionUID = 1L; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Schema(required = true, title = "권한ID", example = "ADMIN_01") - @Column(name = "role_id", nullable = false, length = 10) - private String roleId; - - @Schema(required = true, title = "시스템사용자ID", example = "W000000001") - @Column(name = "cmm_user_id", nullable = false, length = 10) - private String cmmUserId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "role_id", insertable = false, updatable = false) - private CmmRole cmmRole; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "cmm_user_id", insertable = false, updatable = false) - private CmmUser cmmUser; - -// @Schema(hidden = true) -// //@Transient -// @ManyToOne(targetEntity = CmmRole.class, fetch = FetchType.LAZY) -// @JoinColumn(name="role_id", insertable = false, updatable = false) -// private CmmRole cmmRole; -// -// @Schema(hidden = true) -// //@Transient -// @ManyToOne(targetEntity = CmmUser.class, fetch = FetchType.LAZY) -// @JoinColumn(name="cmm_user_id", insertable = false, updatable = false) -// private CmmUser cmmUser; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; - CmmRoleUer that = (CmmRoleUer) o; - - return Objects.equals(id, that.id); - } - - @Override - public int hashCode() { - return 2024097714; - } -} diff --git a/src/main/java/com/xit/biz/cmm/entity/ids/CmmAddressIds.java b/src/main/java/com/xit/biz/cmm/entity/ids/CmmAddressIds.java deleted file mode 100644 index d2210b2..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/ids/CmmAddressIds.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xit.biz.cmm.entity.ids; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import javax.persistence.Column; -import java.io.Serializable; - -//@Embeddable -@Getter -@Setter -@EqualsAndHashCode -@NoArgsConstructor -public class CmmAddressIds implements Serializable { - private String cmmUserId; - - @Schema(required = true, title = "주소일련번호", example = "001", description = "사용자별 일련번호") - @Column(name = "addr_seq", nullable = false, length = 3) - private String addrSeq; -} diff --git a/src/main/java/com/xit/biz/cmm/entity/ids/CmmFileDtlIds.java b/src/main/java/com/xit/biz/cmm/entity/ids/CmmFileDtlIds.java deleted file mode 100644 index 1513040..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/ids/CmmFileDtlIds.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.xit.biz.cmm.entity.ids; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - - -import javax.persistence.Column; -import java.io.Serializable; - -//@Embeddable -@Getter -@Setter -@EqualsAndHashCode -@NoArgsConstructor -public class CmmFileDtlIds implements Serializable { - - @Schema(required = true, title = "파일MstID", example = " ", description = "FileMst ID") - @Column(name = "file_mst_id", nullable = false) - private String fileMstId; - - @Schema(required = true, title = "파일ID", example = " ", description = "UUID로 생성") - @Column(name = "file_id", nullable = false, length = 50) - private String fileId; - -} diff --git a/src/main/java/com/xit/biz/cmm/entity/ids/CmmUserRolePK.java b/src/main/java/com/xit/biz/cmm/entity/ids/CmmUserRolePK.java deleted file mode 100644 index 852dd3b..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/ids/CmmUserRolePK.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.xit.biz.cmm.entity.ids; - -import lombok.*; - -import java.io.Serializable; - -@Getter -@NoArgsConstructor -@AllArgsConstructor -@Builder -@EqualsAndHashCode -public class CmmUserRolePK implements Serializable { - private static final long SerialVersionUID = 1L; - - private Long cmmUserId; - - private Long roleId; -} diff --git a/src/main/java/com/xit/biz/cmm/entity/ids/CodeCmmField.java b/src/main/java/com/xit/biz/cmm/entity/ids/CodeCmmField.java deleted file mode 100644 index bf89a63..0000000 --- a/src/main/java/com/xit/biz/cmm/entity/ids/CodeCmmField.java +++ /dev/null @@ -1,50 +0,0 @@ -//package com.xit.biz.cmm.domain.ids; -// -//import com.xit.core.support.jpa.AuditEntity; -//import io.swagger.v3.oas.annotations.media.Schema; -//import lombok.*; -//import org.hibernate.annotations.ColumnDefault; -// -//import javax.persistence.*; -//import java.io.Serializable; -// -//@Embeddable -//@Getter -//@Setter -//@NoArgsConstructor -//@EqualsAndHashCode(callSuper = false) -//public class CodeCmmField implements Serializable { -// -// @Schema(required = true, title = "코드명", example = "코드예제", description = "각 분류에 해당하는 코드명") -// @Column(name = "code_nm", nullable = false, length = 20) -// private String codeNm; -// -// @Schema(title = "코드상세", example = "공통 코드 상세 예제", description = "각 분류에 해당하는 코드 상세") -// @Column(name = "code_remark", length = 50) -// private String codeRemark; -// -// @Schema(title = "추가필드1") -// @Column(name = "code_meta_1", length = 10) -// private String codeMeta1; -// -// @Schema(title = "추가필드2") -// @Column(name = "code_meta_2", length = 10) -// private String codeMeta2; -// -// @Schema(title = "추가필드3") -// @Column(name = "code_meta_3", length = 10) -// private String codeMeta3; -// -// @Schema(title = "추가필드4") -// @Column(name = "code_meta_4", length = 10) -// private String codeMeta4; -// -// @Schema(title = "추가필드5") -// @Column(name = "code_meta_5", length = 10) -// private String codeMeta5; -// -// @Schema(required = true, title = "코드정렬순서", example = "99") -// @Column(name = "code_ordr", nullable = false, columnDefinition = "int(3)") @ColumnDefault(value = "99") -// private Integer codeOrdr; -// -//} diff --git a/src/main/java/com/xit/biz/cmm/mapper/ICmmBoardMapper.java b/src/main/java/com/xit/biz/cmm/mapper/ICmmBoardMapper.java deleted file mode 100644 index 737c53a..0000000 --- a/src/main/java/com/xit/biz/cmm/mapper/ICmmBoardMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.xit.biz.cmm.mapper; - -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; -import java.util.Map; - -@Mapper -public interface ICmmBoardMapper { - List> selectBoardList(Map map); -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmAddressRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmAddressRepository.java deleted file mode 100644 index daba6c8..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmAddressRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmAddress; -import com.xit.biz.cmm.entity.ids.CmmAddressIds; -import org.springframework.data.repository.CrudRepository; - -public interface ICmmAddressRepository extends CrudRepository { - -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmBoardRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmBoardRepository.java deleted file mode 100644 index bc21025..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmBoardRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmBoard; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface ICmmBoardRepository extends JpaRepository { -// Page findByBoardIdGreaterThan(final Long boardId, final Pageable paging); -// Optional findByBoardId(final Long boardId); -// void deleteByBoardId(Long boardId); -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmFileDtlRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmFileDtlRepository.java deleted file mode 100644 index 345665d..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmFileDtlRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmFileDtl; -import com.xit.biz.cmm.entity.ids.CmmFileDtlIds; -import org.springframework.data.repository.CrudRepository; - -import java.util.List; - -public interface ICmmFileDtlRepository extends CrudRepository { - List findByFileMstId(String fileMstId); - CmmFileDtl findByFileMstIdAndOrgFileNmIgnoreCase(String fileMstId, String OrgFileNm); - //List findAllById(CmmFileDtlIds cmmFileDtlIds); -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmFileMstRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmFileMstRepository.java deleted file mode 100644 index 12146ab..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmFileMstRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmFileMst; -import org.springframework.data.repository.CrudRepository; - -public interface ICmmFileMstRepository extends CrudRepository { -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleMenuRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmRoleMenuRepository.java deleted file mode 100644 index 21bf840..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleMenuRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmRoleMenu; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface ICmmRoleMenuRepository extends JpaRepository { -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmRoleRepository.java deleted file mode 100644 index 5db8b06..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmRole; -import org.springframework.data.repository.CrudRepository; - -public interface ICmmRoleRepository extends CrudRepository { -} diff --git a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleUserRepository.java b/src/main/java/com/xit/biz/cmm/repository/ICmmRoleUserRepository.java deleted file mode 100644 index 28a716a..0000000 --- a/src/main/java/com/xit/biz/cmm/repository/ICmmRoleUserRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xit.biz.cmm.repository; - -import com.xit.biz.cmm.entity.CmmRoleUer; -import org.springframework.data.repository.CrudRepository; - -public interface ICmmRoleUserRepository extends CrudRepository { -// List findByCmmUserId(Long cmmUserId); -// -// List findByRoleId(Long roleId); -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmAddressService.java b/src/main/java/com/xit/biz/cmm/service/ICmmAddressService.java deleted file mode 100644 index ab06d0f..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmAddressService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmAddress; -import com.xit.biz.cmm.entity.ids.CmmAddressIds; -import com.xit.core.support.jpa.IJpaOperation; - -/** - * @author Lim, Jong Uk (minuk926) - * @since 2021-07-16 - */ -public interface ICmmAddressService extends IJpaOperation { -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmBoardService.java b/src/main/java/com/xit/biz/cmm/service/ICmmBoardService.java deleted file mode 100644 index dd2fdbd..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmBoardService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmBoard; -import com.xit.core.support.jpa.IJpaOperation; - -import java.util.List; -import java.util.Map; - -public interface ICmmBoardService extends IJpaOperation { - /** - * use mybatis mapper - * @param map Map - * @return List - */ - List> selectBoardList(Map map); -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmFileService.java b/src/main/java/com/xit/biz/cmm/service/ICmmFileService.java deleted file mode 100644 index 247f40c..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmFileService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmFileMst; -import org.springframework.web.multipart.MultipartFile; - -/** - * @author Lim, Jong Uk (minuk926) - * @since 2021-07-16 - */ -public interface ICmmFileService { - CmmFileMst findFiles(String fileMstId); - - CmmFileMst saveFiles(CmmFileMst cmmFileMst, MultipartFile[] files); -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmRoleMenuService.java b/src/main/java/com/xit/biz/cmm/service/ICmmRoleMenuService.java deleted file mode 100644 index dff3c4e..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmRoleMenuService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmRoleMenu; -import com.xit.core.support.jpa.IJpaOperation; - -public interface ICmmRoleMenuService extends IJpaOperation { -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmRoleService.java b/src/main/java/com/xit/biz/cmm/service/ICmmRoleService.java deleted file mode 100644 index f46deaf..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmRoleService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmRole; -import com.xit.core.support.jpa.IJpaOperation; - -public interface ICmmRoleService extends IJpaOperation { - -} diff --git a/src/main/java/com/xit/biz/cmm/service/ICmmRoleUserService.java b/src/main/java/com/xit/biz/cmm/service/ICmmRoleUserService.java deleted file mode 100644 index 0b234ea..0000000 --- a/src/main/java/com/xit/biz/cmm/service/ICmmRoleUserService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.xit.biz.cmm.service; - -import com.xit.biz.cmm.entity.CmmRoleUer; -import com.xit.core.support.jpa.IJpaOperation; - -public interface ICmmRoleUserService extends IJpaOperation { - -} diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmAddressService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmAddressService.java deleted file mode 100644 index 8e419a7..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmAddressService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmAddress; -import com.xit.biz.cmm.entity.ids.CmmAddressIds; -import com.xit.biz.cmm.repository.ICmmAddressRepository; -import com.xit.biz.cmm.service.ICmmAddressService; -import com.xit.core.support.jpa.AbstractJpaCrudService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Service; - - -/** - * @author Lim, Jong Uk (minuk926) - * @since 2021-07-16 - */ -@Service -@RequiredArgsConstructor -@Slf4j -public class CmmAddressService extends AbstractJpaCrudService implements ICmmAddressService { - - private final ICmmAddressRepository cmmAddressRepository; - - @Override - protected CrudRepository getRepository() { - return cmmAddressRepository; - } -} diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmBoardService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmBoardService.java deleted file mode 100644 index e210a3d..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmBoardService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmBoard; -import com.xit.biz.cmm.repository.ICmmBoardRepository; -import com.xit.biz.cmm.service.ICmmBoardService; -import com.xit.biz.cmm.mapper.ICmmBoardMapper; -import com.xit.core.support.jpa.AbstractJpaService; -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Map; -import java.util.Optional; - -@Service -public class CmmBoardService extends AbstractJpaService implements ICmmBoardService { - private final ICmmBoardRepository boardRepository; - private final ICmmBoardMapper cmmBoardMapper; - - public CmmBoardService(ICmmBoardRepository boardRepository, ICmmBoardMapper cmmBoardMapper) { - this.boardRepository = boardRepository; - this.cmmBoardMapper = cmmBoardMapper; - } - - @Override - protected PagingAndSortingRepository getRepository() { - return boardRepository; - } - - @Transactional(readOnly = true) - public Optional findByBoardId(Long boardId) { - return boardRepository.findById(boardId); //.orElseThrow(() -> new NotFoundException("Board not found : " + boardId)); - } - @Transactional - public void deleteByBoardId(Long boardId) { - boardRepository.deleteById(boardId); - } - - - @Override - public List> selectBoardList(Map map) { - return cmmBoardMapper.selectBoardList(map); - } -} diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java deleted file mode 100644 index 52d16bb..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmFileDtl; -import com.xit.biz.cmm.entity.CmmFileMst; -import com.xit.biz.cmm.entity.ids.CmmFileDtlIds; -import com.xit.biz.cmm.repository.ICmmFileDtlRepository; -import com.xit.biz.cmm.repository.ICmmFileMstRepository; -import com.xit.biz.cmm.service.ICmmFileService; - -import com.xit.core.util.AssertUtils; -import com.xit.core.util.CommUtil; -import com.xit.core.util.DateUtil; -import io.jsonwebtoken.lang.Assert; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.IOException; -import java.util.*; - -@Slf4j -@Service -@RequiredArgsConstructor -public class CmmFileService implements ICmmFileService { - - @Value("${file.cmm.upload.path:/data/file/upload}") - private String uploadPath; - - @Value("${file.cmm.upload.allow.ext:}") - private String allowExt; - - @Value("${file.cmm.upload.max.size:1024}") - private long maxSize; - - private final ICmmFileMstRepository cmmFileMstRepository; - private final ICmmFileDtlRepository cmmFileDtlRepository; - - @Override - public CmmFileMst findFiles(String fileMstId) { - Assert.notNull(fileMstId, "대상 파일[fileMstId]을 선택해 주세요."); - - CmmFileMst cmmFileMst = cmmFileMstRepository.findById(fileMstId).orElse(null); -// CmmFileDtlIds cmmFileDtlIds = new CmmFileDtlIds(); -// cmmFileDtlIds.setFileMstId(cmmFileMst.getFileMstId()); - - if(cmmFileMst != null) cmmFileMst.getCmmFileDtls().addAll(cmmFileDtlRepository.findByFileMstId(cmmFileMst.getFileMstId())); - return cmmFileMst; - } - - /** - * 파일 등록 - * 신규등록시는 CmmFileMst.fileMstId가 null, 변경시 not null - * 변경시 동일한 파일 이름이 존재하면 DB 및 해당 파일 삭제후 신규로 생성 - * - * @param cmmFileMst CmmFileMst - * @param files MultipartFile[] - * @return CmmFileMst - */ - @Override - @Transactional - public CmmFileMst saveFiles(CmmFileMst cmmFileMst, MultipartFile[] files) { - Assert.notNull(cmmFileMst, "파일 정보가 존재하지 않습니다."); - Assert.notNull(cmmFileMst.getFileCtgCd(), "파일 구분 코드[fileCtgCd] 정보가 존재하지 않습니다."); - Assert.notNull(cmmFileMst.getFileBizId(), "파일 업무 ID[fileBizId] 정보가 존재하지 않습니다."); - Assert.notNull(files, "대상 파일이 존재하지 않습니다."); - - String makePath = ""; - boolean isCheckExists = StringUtils.hasText(cmmFileMst.getFileMstId()); - String fileMstId = null; - - // file Master key set - // file Master 생성 - if(isCheckExists) fileMstId = cmmFileMst.getFileMstId(); - else fileMstId = CommUtil.getStringFromUUID(); - cmmFileMst.setFileMstId(fileMstId); - CmmFileMst savedCmmFileMst = cmmFileMstRepository.save(cmmFileMst); - - makePath = File.separator + DateUtil.getToday(""); - String fileUploadPath = this.uploadPath + makePath; - File file = new File(fileUploadPath); - if(!file.exists()) file.mkdirs(); - - List cmmFileDtls = new ArrayList<>(); - for(MultipartFile mf : files){ - if(!mf.isEmpty()) { - String orgFileName = ""; - try { - orgFileName = StringUtils.cleanPath(Objects.requireNonNull(mf.getOriginalFilename())); - CmmFileDtl cmmFileDtl = CmmFileDtl.builder() - .fileMstId(savedCmmFileMst.getFileMstId()) - .fileId(CommUtil.getStringFromUUID()) - .fileUpldPath(makePath) - .contentType(mf.getContentType()) - .orgFileNm(orgFileName) - .fileExt(orgFileName.substring(orgFileName.lastIndexOf(".") + 1).toLowerCase()) - .fileSize(mf.getSize()) - .build(); - - if (StringUtils.hasText(allowExt) && !allowExt.contains(cmmFileDtl.getFileExt())) { - log.error("Not support extention :: {}", orgFileName); - //TODO : 에러처리 - //return RestError.of(String.format("Not support extention :: %s", orgFileName)); - AssertUtils.isTrue(false, String.format("Not support extention :: %s", orgFileName)); - } - if (cmmFileDtl.getFileSize() > (maxSize * 1024)) { - log.error("Over size :: {}[{}]", orgFileName, cmmFileDtl.getFileSize()); - //TODO : 에러처리 - //return RestError.of(String.format("Over size :: %s[%l]", orgFileName, cmmFileDtl.getFileSize())); - AssertUtils.isTrue(false, String.format("Over size :: %s[%d]", orgFileName, cmmFileDtl.getFileSize())); - } - - //동일파일 삭제후 정보 저장 - if(isCheckExists) removeExistsUploadFile(fileMstId, orgFileName); - CmmFileDtl savedCmmFileDtl = cmmFileDtlRepository.save(cmmFileDtl); - - // 파일 전송 - mf.transferTo(new File(fileUploadPath + File.separator + savedCmmFileDtl.getFileId())); - cmmFileDtls.add(savedCmmFileDtl); - - // inputStream을 가져와서 - // copyOfLocation (저장위치)로 파일을 쓴다. - // copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다 - //Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING); - - }catch(IOException e){ - String errMsg = String.format("File Upload Error :: %s", orgFileName); - //TODO : 에러처리 - //return RestError.of(String.format("File Upload Error :: %s", orgFileName)); - AssertUtils.isTrue(false, String.format("File Upload Error :: %s", orgFileName)); - } - } - } - savedCmmFileMst.getCmmFileDtls().addAll(cmmFileDtls); - return savedCmmFileMst; - } - - @Transactional - public void removeExistsUploadFile(String fileMstId, String orgFileNm){ - CmmFileDtl cmmFileDtl = cmmFileDtlRepository.findByFileMstIdAndOrgFileNmIgnoreCase(fileMstId, orgFileNm); - if(cmmFileDtl != null){ - CmmFileDtlIds cmmFileDtlIds = new CmmFileDtlIds(); - cmmFileDtlIds.setFileMstId(fileMstId); - cmmFileDtlIds.setFileId(cmmFileDtl.getFileId()); - cmmFileDtlRepository.deleteById(cmmFileDtlIds); - new File(this.uploadPath + cmmFileDtl.getFileUpldPath() + File.separator + cmmFileDtl.getFileId()).delete(); - } - } -} - -/* - // File.seperator 는 OS종속적이다. - // Spring에서 제공하는 cleanPath()를 통해서 ../ 내부 점들에 대해서 사용을 억제한다 - Path copyOfLocation = Paths.get(uploadDir + File.separator + StringUtils.cleanPath(multipartFile.getOriginalFilename())); - try { - // inputStream을 가져와서 - // copyOfLocation (저장위치)로 파일을 쓴다. - // copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다 - Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - e.printStackTrace(); - throw new FileStorageException("Could not store file : " + multipartFile.getOriginalFilename()); - } -*/ diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleMenuService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleMenuService.java deleted file mode 100644 index 426f9c9..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleMenuService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmRoleMenu; -import com.xit.biz.cmm.repository.ICmmRoleMenuRepository; -import com.xit.biz.cmm.service.ICmmRoleMenuService; -import com.xit.core.support.jpa.AbstractJpaService; -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.stereotype.Service; - -@Service -public class CmmRoleMenuService extends AbstractJpaService implements ICmmRoleMenuService { - - private final ICmmRoleMenuRepository cmmRoleMenuRepository; - - public CmmRoleMenuService(ICmmRoleMenuRepository cmmRoleMenuRepository) { - this.cmmRoleMenuRepository = cmmRoleMenuRepository; - } - - @Override - protected PagingAndSortingRepository getRepository() { - return cmmRoleMenuRepository; - } -} diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleService.java deleted file mode 100644 index cc1af3c..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmRole; -import com.xit.biz.cmm.repository.ICmmRoleRepository; -import com.xit.biz.cmm.service.ICmmRoleService; -import com.xit.core.support.jpa.AbstractJpaCrudService; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Service; - -@Service -public class CmmRoleService extends AbstractJpaCrudService implements ICmmRoleService { - private final ICmmRoleRepository cmmRoleRepository; - - public CmmRoleService(ICmmRoleRepository cmmRoleRepository) { - this.cmmRoleRepository = cmmRoleRepository; - } - - @Override - protected CrudRepository getRepository() { - return cmmRoleRepository; - } - - -} diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleUserService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleUserService.java deleted file mode 100644 index 4f6dde7..0000000 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmRoleUserService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.xit.biz.cmm.service.impl; - -import com.xit.biz.cmm.entity.CmmRoleUer; -import com.xit.biz.cmm.repository.ICmmRoleUserRepository; -import com.xit.biz.cmm.service.ICmmRoleUserService; -import com.xit.core.support.jpa.AbstractJpaCrudService; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Service; - -@Service -public class CmmRoleUserService extends AbstractJpaCrudService implements ICmmRoleUserService { - private final ICmmRoleUserRepository cmmRoleUserRepository; - - public CmmRoleUserService(ICmmRoleUserRepository cmmRoleUserRepository) { - this.cmmRoleUserRepository = cmmRoleUserRepository; - } - - @Override - protected CrudRepository getRepository() { - return cmmRoleUserRepository; - } - - -} diff --git a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java index 265006c..269753a 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -26,10 +26,9 @@ import javax.validation.Valid; @Tag(name = "ParkingController", description = "주정차 의견진술 관리") @RestController -@RequestMapping("/api/v1/ctgy/parking") -@Validated @RequiredArgsConstructor @Slf4j +@RequestMapping("/api/v1/ctgy/parking") public class ParkingController { private final IParkingService service; @@ -78,7 +77,7 @@ public class ParkingController { @Parameter(in = ParameterIn.QUERY, name = "rcSeq2", description = "접수번호-종료", required = true, example = "2022200899"), }) public ResponseEntity findSimsaTargets(@Parameter(hidden = true) final MinSimsaTargetDto dto){ - return RestResponse.of(service.findSimsaTargets(dto)); + return RestResponse.of(service.findSimsaTargets(dto)); } @Operation(summary = "주정차 의견진술 심의대상 등록" , description = "주정차 의견진술 심의대상 등록") @@ -124,3 +123,4 @@ public class ParkingController { // } } + diff --git a/src/main/java/com/xit/biz/ctgy/service/ICtgyFileService.java b/src/main/java/com/xit/biz/ctgy/service/ICtgyFileService.java index 735a980..e614fae 100644 --- a/src/main/java/com/xit/biz/ctgy/service/ICtgyFileService.java +++ b/src/main/java/com/xit/biz/ctgy/service/ICtgyFileService.java @@ -1,6 +1,5 @@ package com.xit.biz.ctgy.service; -import com.xit.biz.cmm.entity.CmmFileMst; import com.xit.biz.ctgy.entity.MinInfoBoard680; import org.springframework.web.multipart.MultipartFile; diff --git a/src/main/java/com/xit/biz/sample/Greeting.java b/src/main/java/com/xit/biz/sample/Greeting.java deleted file mode 100644 index 757af51..0000000 --- a/src/main/java/com/xit/biz/sample/Greeting.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.xit.biz.sample; - -public class Greeting { - - private final long id; - private final String content; - - public Greeting(long id, String content) { - this.id = id; - this.content = content; - } - - public long getId() { - return id; - } - - public String getContent() { - return content; - } -} \ No newline at end of file diff --git a/src/main/java/com/xit/biz/sample/_ignore/FluxCmmUserController.java b/src/main/java/com/xit/biz/sample/_ignore/FluxCmmUserController.java deleted file mode 100644 index ceb861c..0000000 --- a/src/main/java/com/xit/biz/sample/_ignore/FluxCmmUserController.java +++ /dev/null @@ -1,92 +0,0 @@ -//package com.xit.biz.sample.ignore; -// -//import com.xit.biz.cmm.domain.CmmUser; -//import com.xit.biz.cmm.service.ICmmUserMgtService; -//import io.swagger.v3.oas.annotations.Operation; -//import io.swagger.v3.oas.annotations.tags.Tag; -//import lombok.RequiredArgsConstructor; -//import lombok.extern.slf4j.Slf4j; -//import org.springframework.data.domain.PageRequest; -//import org.springframework.http.MediaType; -//import org.springframework.web.bind.annotation.*; -//import reactor.core.publisher.Flux; -//import reactor.core.publisher.Mono; -// -//@Tag(name = "FluxCmmUserController", description = "사용자 관리(Web-flux)") -//@Slf4j -//@RestController -//@RequiredArgsConstructor -//@RequestMapping("/api/biz/cmm/flux") -//public class FluxCmmUserController { -// private final ICmmUserMgtService cmmUserMgtService; -// -// @Operation(summary = "사용자 목록 조회" , description = "등록된 사용자 전체 목록 조회") -// @GetMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE) -// public Flux findAll() { -// return Flux.fromIterable(cmmUserMgtService.findAll()); -// //return new ResponseEntity>(cmmUserRepository.findAll(), HttpStatus.OK); -// -// } -// -// @Operation(summary = "사용자 목록 조회" , description = "등록된 사용자 전체 목록 조회") -// @GetMapping(value="/page", produces = MediaType.APPLICATION_JSON_VALUE) -// public Mono findAllPage() { -// -// return Mono.just(cmmUserMgtService.findAll(PageRequest.of(0, 2))); -// -// //Page page = cmmUserRepository.findAll(PageRequest.of(pageable.getPageNumber(), pageable.getPageSize())); -// //return xitApiResult.of(new ResponseEntity>(page, HttpStatus.OK)); -// -// } -// -// @Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회") -// @GetMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public Mono findByCmmUserId(@PathVariable final Long cmmUserId) { -// return Mono.just(cmmUserMgtService.findById(cmmUserId)); -// } -// -//// @Operation(summary = "사용자 정보 조회" , description = "사용자 정보 조회") -//// @GetMapping(value="/{userId}", produces = MediaType.TEXT_EVENT_STREAM_VALUE) -//// public Flux findByUserId(@PathVariable final String userId) { -//// return Flux.just(cmmUserRepository.findByUserId(userId)); -//// } -// -// @Operation(summary = "사용자 추가" , description = "사용자 등록") -// @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) -// public Mono save(@RequestBody CmmUser cmmUserEntity) { -// return Mono.just(cmmUserMgtService.save(cmmUserEntity)); -// } -// -// @Operation(summary = "사용자 정보 변경" , description = "사용자 정보 변경") -// @PutMapping(value="/{cmmUserId}", produces = MediaType.APPLICATION_JSON_VALUE) -// public Mono modify(@PathVariable final Long cmmUserId, @RequestBody CmmUser cmmUser) { -// return Mono.just(cmmUserMgtService.save(cmmUser)); -// } -// -//// @Operation(summary = "사용자 삭제" , description = "사용자 제거") -//// @DeleteMapping(value="/{cmmUserId}", produces = MediaType.TEXT_EVENT_STREAM_VALUE) -//// public Mono deleteById(@PathVariable final Long cmmUserId) { -//// cmmUserRepository.deleteById(cmmUserId); -//// return Mono.empty(); -//// -//// } -// -///* -// @Bean -// public RouterFunction monoRouterFunction(UserHandler userHandler) { -// return route(GET("/users/{userId}").and(accept(APPLICATION_JSON)), userHandler::getUser); -// } -// -// public Mono getUser(ServerRequest request) { -// // ... -// // request 로부터 userId를 뽑았다고 가정 -// -// Mono mono = Mono.just(userService.findById(userId)); -// return ServerResponse -// .ok() -// .contentType(MediaType.APPLICATION_JSON) -// .body(mono, User.class); -// } -//*/ -// -//} diff --git a/src/main/java/com/xit/biz/sample/_ignore/FluxSampleController.java b/src/main/java/com/xit/biz/sample/_ignore/FluxSampleController.java deleted file mode 100644 index 7bdfcfa..0000000 --- a/src/main/java/com/xit/biz/sample/_ignore/FluxSampleController.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.xit.biz.sample._ignore; - -import com.xit.biz.sample.Greeting; -import io.swagger.v3.oas.annotations.tags.Tag; -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; - -import java.util.concurrent.atomic.AtomicLong; - -@RestController -@RequestMapping("/api/sample/flux") -@Tag(name = "FluxSampleController", description = "Flux Rest Api Sample") -public class FluxSampleController { - - private static final String template = "Hello, %s!"; - private final AtomicLong counter = new AtomicLong(); - - @GetMapping("/greeting") - public Greeting greeting(@RequestParam(value = "name", required = false, defaultValue = "World") String name) { - return new Greeting(counter.incrementAndGet(), String.format(template, name)); - } - -// @GetMapping("/greeting2") -// public Mono greeting(@RequestParam(value = "name", defaultValue = "World") String name) { -// return new Greeting(counter.incrementAndGet(), String.format(template, name)); -// } -// -// @GetMapping("/getGreetings") -// public Flux getAllMargins() { -// return null;//marginRepository.findAll(); -// } -} diff --git a/src/main/java/com/xit/biz/sample/controller/RestSampleController.java b/src/main/java/com/xit/biz/sample/controller/RestSampleController.java deleted file mode 100644 index 7e55af7..0000000 --- a/src/main/java/com/xit/biz/sample/controller/RestSampleController.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.xit.biz.sample.controller; - -import com.xit.biz.cmm.service.ICmmBoardService; -import com.xit.biz.sample.Greeting; -import com.xit.core.api.IRestResponse; -import com.xit.core.api.RestResponse; -import com.xit.core.constant.ErrorCode; -import com.xit.core.exception.InvalidRequestException; -import com.xit.core.util.AssertUtils; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -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; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicLong; - -@Tag(name = "RestSampleController", description = "Rest API Sample") -@RequiredArgsConstructor -@RestController -@RequestMapping("/api/sample") -public class RestSampleController { - - private static final String template = "Hello, %s!"; - private final AtomicLong counter = new AtomicLong(); - - private final ICmmBoardService cmmBoardService; - - @GetMapping("/greeting") - public Greeting greeting(@RequestParam(value = "name", required = false, defaultValue = "World") String name) { - return new Greeting(counter.incrementAndGet(), String.format(template, name)); - } - - @Operation(summary = "Mybatis 예제") - @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "boardId", description = "게시글Id", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "title", description = "제목", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "content", description = "내용", required = false, example = " ") - //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), - }) - @GetMapping("/mybatis") - public List> mybatis(@RequestParam @Parameter(hidden = true) Map paramMap) { - return cmmBoardService.selectBoardList(paramMap); - } - - @Operation(summary = "에러 예제 - rtnMsg") - @GetMapping("/error1") - public ResponseEntity test1() { - AssertUtils.isTrue("조회할 콤보코드 대상이 없습니다."); - return RestResponse.of("test1"); - } -} diff --git a/src/main/java/com/xit/biz/sample/controller/WebSampleController.java b/src/main/java/com/xit/biz/sample/controller/WebSampleController.java deleted file mode 100644 index a467d36..0000000 --- a/src/main/java/com/xit/biz/sample/controller/WebSampleController.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.xit.biz.sample.controller; - -import com.xit.core.util.PoiExcelView; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.View; - -import java.util.*; -import java.util.concurrent.atomic.AtomicLong; - -@Controller -@RequestMapping("/web/sample") -public class WebSampleController { - - private static final String template = "Hello, %s!"; - private final AtomicLong counter = new AtomicLong(); - - @GetMapping("/sample-dark") - public String sampleDarkMode() { - return "thymeleaf/sample/sample-dark"; - } - - @GetMapping("/sample-admin") - public String sampleAdminMode() { - return "thymeleaf/sample/sample-admin"; - } - - @GetMapping("/greeting") - public String greeting(@RequestParam(value = "name", required = false, defaultValue = "World") String name, - Model model) { - model.addAttribute("name", String.format(template, name)); - return "thymeleaf/sample/greeting"; - } - - @GetMapping("/jsp") - public String jspTest(@RequestParam(value = "name", required = false, defaultValue = "World") String name, - Model model) { - model.addAttribute("name", String.format(template, name)); - return "Test"; - } - - @GetMapping("/exceltest") - public String exceltest() { - return "thymeleaf/sample/exceldown"; - } - - @PostMapping(value = "/exceldown")//, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) - public View excelDownTest(ModelMap modelMap) { - List titleList = Arrays.asList( "아이디", "이름", "생년월일", "핸드폰번호", "전화", "이메일"); - List fieldList = Arrays.asList( "ID", "MBR_NM", "BRTHDY", "HP_NO", "TEL_NO", "EMAIL"); - modelMap.addAttribute("titleList", titleList); - modelMap.addAttribute("fieldList", fieldList); - - List> listRes = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("MBR_NM", "fsafas"); - map.put("BRTHDY", "12341212"); - map.put("HP_NO", "01011112222"); - map.put("TEL_NO", "0311231234"); - map.put("EMAIL", "a@b.com"); - for(int i=0; i<10; i++) { - map.put("ID", i); - listRes.add(map); - } - modelMap.addAttribute("contentList", listRes); - return new PoiExcelView("exceltest.xlsx"); - - //modelMap.addAttribute("titleList", paramMap.get("titleList")); - //modelMap.addAttribute("fieldList", paramMap.get("fieldList")); - //return new PoiExcelView(paramMap.get("fileName").toString()); - } - - -// @GetMapping("/greeting2") -// public Mono greeting(@RequestParam(value = "name", defaultValue = "World") String name) { -// return new Greeting(counter.incrementAndGet(), String.format(template, name)); -// } -// -// @GetMapping("/getGreetings") -// public Flux getAllMargins() { -// return null;//marginRepository.findAll(); -// } -} diff --git a/src/main/java/com/xit/core/config/support/SpringDocApiConfig.java b/src/main/java/com/xit/core/config/support/SpringDocApiConfig.java index a99ffd2..be9eb89 100644 --- a/src/main/java/com/xit/core/config/support/SpringDocApiConfig.java +++ b/src/main/java/com/xit/core/config/support/SpringDocApiConfig.java @@ -79,7 +79,7 @@ public class SpringDocApiConfig { @Bean public GroupedOpenApi authorizeApi() { return GroupedOpenApi.builder() - .group("2. Authorize-API") + .group("3. Authorize-API") .pathsToMatch( "/api/v1/auth/**", "/api/v1/users/**" @@ -90,7 +90,7 @@ public class SpringDocApiConfig { @Bean public GroupedOpenApi commonApi() { return GroupedOpenApi.builder() - .group("3. common-API") + .group("2. common-API") .pathsToMatch( "/api/biz/cmm/**", "/api/v1/biz/cmm/**" @@ -101,14 +101,6 @@ public class SpringDocApiConfig { .build(); } - @Bean - public GroupedOpenApi sampleApi() { - return GroupedOpenApi.builder() - .group("4. Sample-API") - .pathsToMatch("/api/sample/**") - .build(); - } - // @Bean // public OpenApiCustomiser customerGlobalHeaderOpenApiCustomiser() { // return openApi -> { diff --git a/src/main/java/com/xit/core/init/JpaRunner.java b/src/main/java/com/xit/core/init/JpaRunner.java index 5f1d4d2..9cd2d81 100644 --- a/src/main/java/com/xit/core/init/JpaRunner.java +++ b/src/main/java/com/xit/core/init/JpaRunner.java @@ -1,123 +1,22 @@ package com.xit.core.init; -import com.xit.biz.cmm.entity.CmmRole; -import com.xit.biz.cmm.entity.CmmUser; -import org.hibernate.Session; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.transaction.annotation.Transactional; - -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import java.util.ArrayList; -import java.util.List; //@Component -@Transactional public class JpaRunner implements ApplicationRunner { - @PersistenceContext - EntityManager entityManager; - - private final PasswordEncoder encoder; - - public JpaRunner(PasswordEncoder encoder) { - this.encoder = encoder; - } +// @PersistenceContext +// EntityManager entityManager; +// +// private final PasswordEncoder encoder; +// +// public JpaRunner(PasswordEncoder encoder) { +// this.encoder = encoder; +// } @Override public void run(ApplicationArguments args) throws Exception { - List users = new ArrayList<>(); - - for(int idx = 0; idx<10; idx++){ - users.add( - CmmUser.builder() - .userId("minuk926-"+(idx+1)) - .userName("홍길동-"+(idx+1)) - .email("a"+(idx+1)+"@b.com") - .password(encoder.encode("minuk926")) - .build() - ); - } - Session session = entityManager.unwrap(Session.class); - - users.forEach(session::save); - - - List roles = new ArrayList<>(); - - for(int idx = 0; idx<10; idx++){ - roles.add( - CmmRole.builder() - .roleName("ROLE-0"+(idx+1)) - .roleRemark("권한-0"+(idx+1)) - .build() - ); - } - roles.forEach(session::save); - -// List userRoles = new ArrayList<>(); -// for(int idx = 0; idx<10; idx++){ -// userRoles.add( -// CmmRoleUer.builder() -// .cmmUserId(idx+1L) -// .roleId(idx+1L) -// .build() -// ); -// } -// userRoles.add( -// CmmRoleUer.builder() -// .cmmUserId(1L) -// .roleId(2L) -// .build() -// ); -// userRoles.add( -// CmmRoleUer.builder() -// .cmmUserId(1L) -// .roleId(3L) -// .build() -// ); -// userRoles.add( -// CmmRoleUer.builder() -// .cmmUserId(2L) -// .roleId(1L) -// .build() -// ); -// userRoles.add( -// CmmRoleUer.builder() -// .cmmUserId(3L) -// .roleId(1L) -// .build() -// ); -// -// userRoles.forEach(session::save); -// -// List addresses = new ArrayList<>(); -// addresses.add( -// CmmAddress.builder() -// .cmmUser(users.get(0)) -// .addressSeq("001") -// .addressType(XitCoreConstants.AddressType.STREET) -// .zipCode("12345") -// .address1("기본주소1") -// .address2("상세주소1") -// .address3("부가주소1") -// .defaultYn("Y") -// .build() -// ); -// addresses.add( -// CmmAddress.builder() -// .cmmUser(users.get(0)) -// .addressSeq("002") -// .addressType(XitCoreConstants.AddressType.STREET) -// .zipCode("12346") -// .address1("기본주소2") -// .address2("상세주소3") -// .address3("부가주소4") -// .defaultYn("N") -// .build() -// ); //addresses.forEach(session::save); } } diff --git a/src/main/resources/mybatis-mapper/biz/cmm/cmmBoard-mapper.xml b/src/main/resources/mybatis-mapper/biz/cmm/cmmBoard-mapper.xml deleted file mode 100644 index 8816dcc..0000000 --- a/src/main/resources/mybatis-mapper/biz/cmm/cmmBoard-mapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - /* board-mapper|insertBoard|julim */ - INSERT - INTO tb_cmm_board ( - title - , content - , ins_user_id - , ins_dt_tm - ) values ( - #{title} - , #{content} - , #{insUserId} - , #{insDtTm} - ) - - - \ No newline at end of file