refactor: 미사용 클래스 정리

dev
Lim Jonguk 3 years ago
parent 76870854e8
commit 3ed67a3bd7

@ -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<? extends RestResponse> save(@RequestBody CmmAddress cmmAddress){
// return ResponseEntity.ok().body(RestResult.of(cmmAddressMgtService.save(cmmAddress));
// }
//
// @Operation(description = "주소 조회")
// @GetMapping
// public ResponseEntity<? extends RestResponse> findAll(){
// return ResponseEntity.ok().body(RestResult.of(cmmAddressMgtService.findAll());
//
// }
//}

@ -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;
/**
* <pre>
* ResponseEntity(HttpStatus status)
* ResponseEntity(MultiValueMap<String, String> headers, HttpStatus status)
* ResponseEntity(@Nullable T body, @Nullable MultiValueMap<String, String> headers, HttpStatus status)
*
* ResponseEntity set ::
* MultiValueMap<String, String> header = new LinkedMultiValueMap<>();
* header.add("token", "xxxx");
* header.add("authcode", "xxxxx");
* return new ResponseEntity(header, HttpStatus.OK)
* </pre>
*/
@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<? extends IRestResponse> findAll() {
return RestResponse.of(cmmBoardService.findAll());
}
/*
Page<MovieCharacter> 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<? extends IRestResponse> findAllPage(final Pageable pageable) {
Page<CmmBoard> 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<CmmBoard> list = page.getContent();
return RestResponse.of(page);
}
@Operation(summary = "게시물 상세 조회" , description = "등록된 게시물 상세")
@GetMapping(value = "/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findByBoardId(@PathVariable Long boardId) {
Optional<CmmBoard> board = cmmBoardService.findById(boardId);
return RestResponse.of(board.get());
}
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveBoard(@RequestBody CmmBoard board) {
return RestResponse.of(cmmBoardService.save(board));
}
@PutMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> updateBoard(@RequestBody CmmBoard board) {
return RestResponse.of(cmmBoardService.update(board));
}
@DeleteMapping(value="/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> deleteBoard(@PathVariable Long boardId) {
cmmBoardService.deleteById(boardId);
return RestResponse.of(HttpStatus.NO_CONTENT);
}
}

@ -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;
/**
* <pre>
* ResponseEntity(HttpStatus status)
* ResponseEntity(MultiValueMap<String, String> headers, HttpStatus status)
* ResponseEntity(@Nullable T body, @Nullable MultiValueMap<String, String> headers, HttpStatus status)
*
* ResponseEntity set ::
* MultiValueMap<String, String> header = new LinkedMultiValueMap<>();
* header.add("token", "xxxx");
* header.add("authcode", "xxxxx");
* return new ResponseEntity(header, HttpStatus.OK)
* </pre>
*/
@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<MovieCharacter> 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<CmmBoard> 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<CmmBoard> 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<Page<Board>> findByBoardIdGreaterThan(PageRequest pageRequest) {
// Page<Board> 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<? extends IRestResponse> findByBoardId(@PathVariable final Long boardId) {
Optional<CmmBoard> board = cmmBoardService.findById(boardId);
return RestResponse.of(board.get());
}
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveBoard(@RequestBody CmmBoard board) {
return RestResponse.of(cmmBoardService.save(board));
}
@PutMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> updateBoard(@RequestBody CmmBoard board) {
return RestResponse.of(cmmBoardService.update(board));
}
@DeleteMapping(value="/{boardId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> deleteBoard(@PathVariable final Long boardId) {
cmmBoardService.deleteById(boardId);
return RestResponse.of(HttpStatus.NO_CONTENT);
}
@PostMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> 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<? extends IRestResponse> findAllApi() {
return RestResponse.of(cmmBoardService.findAll());
//return ResponseEntity.ok(boardService.findAll(), HttpStatus.OK);
}
/*
Page<MovieCharacter> 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<? extends IRestResponse> findAllPageApi(final Pageable pageable) {
// Page<Board> 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<Board> list = page.getContent();
// return ResponseEntity.ok(page);
return RestResponse.of(cmmBoardService.findAll(pageable));
}
}

@ -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<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends IRestResponse> saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) {
return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp));
}

@ -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<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends IRestResponse> 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:/";
}
}

@ -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<? extends IRestResponse> findAll() {
return RestResponse.of(cmmRoleUserService.findAll());
}
// @Operation(description = "권한 메뉴 목록 조회")
// @GetMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends RestResponse> 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<? extends RestResponse> save(@RequestBody CmmRoleUer cmmRoleUer) {
//
// return RestResult.of(cmmRoleUserService.save(cmmRoleUer));
//
// }
//
// @Operation(description = "권한 메뉴 삭제")
// @DeleteMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends RestResponse> deleteByCmmUserId(@PathVariable final String cmmUserId) {
// cmmRoleUserService.deleteById(cmmUserId);
// return RestResult.of(HttpStatus.OK);
//
// }
}

@ -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<? extends IRestResponse> findAll() {
return RestResponse.of(cmmRoleService.findAll());
}
// @Operation(summary = "권한 목록 조회")
// @GetMapping(value="/page", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends RestResponse> findAllPage(final Pageable pageable) {
//
// Page<CmmRoleGrp> 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<? extends IRestResponse> findByRoleId(@PathVariable final String roleId) {
return RestResponse.of(cmmRoleService.findById(roleId));
}
@Operation(summary = "권한 추가")
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> save(@RequestBody CmmRole cmmRole) {
return RestResponse.of(cmmRoleService.save(cmmRole));
}
@Operation(summary = "궘한 정보 변경")
@PutMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends RestResponse> findUserMstByroleId(
// @Parameter(name = "roleId", description = "권한그룹 ID", example = "1")
// @PathVariable final String roleId) {
// return RestResult.of(cmmRoleUserService.findById(roleId));
// }
}

@ -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<? extends IRestResponse> findAll() {
return RestResponse.of(cmmRoleUserService.findAll());
}
// @Operation(description = "사용자 권한 목록 조회")
// @GetMapping(value="/page", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends RestResponse> findAllPage(final Pageable pageable) {
//
// Page<CmmUserRole> 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<? extends RestResponse> 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<? extends IRestResponse> save(@RequestBody CmmRoleUer cmmRoleUer) {
return RestResponse.of(cmmRoleUserService.save(cmmRoleUer));
}
// @Operation(description = "사용자 권한 삭제")
// @DeleteMapping(value="/{roleId}", produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends RestResponse> deleteByCmmUserId(@PathVariable final String cmmUserId) {
// cmmRoleUserService.deleteById(cmmUserId);
// return RestResult.of(HttpStatus.OK);
//
// }
}

@ -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<? extends IRestResponse> findAll(@Parameter(hidden = true) final Pageable pageable) {
//Page<CmmUser> 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<? extends IRestResponse> 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<? extends IRestResponse> findByCmmUserId(
@PathVariable final String cmmUserId) {
return RestResponse.of(cmmUserService.findById(cmmUserId));
}
@Operation(summary = "사용자 등록" , description = "신규 사용자 등록")
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends IRestResponse> 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<? extends IRestResponse> findRoleGroupByCmmUserId(
@Parameter(name = "cmmUserId", description = "사용자 ID(PK)", example = "1")
@PathVariable final Long cmmUserId) {
return RestResponse.of(cmmRoleUerService.findById(cmmUserId));
}
}

@ -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());
// }
}

@ -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;
}

@ -13,6 +13,7 @@ import java.io.Serializable;
*/
@Schema(name = "CmmCodeDto", description = "공통코드 DTO")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder

@ -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;
}

@ -28,6 +28,7 @@ import java.io.Serializable;
*/
@Schema(name = "CmmUserDto", description = "사용자 Dto") //, parent = AuditEntity.class)
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder

@ -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<CmmBoardDto, CmmBoard> {
}

@ -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<String, AddressType> stringToEnum = Stream.of(values())
.collect(toMap(Objects::toString, e -> e));
}

@ -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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -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<CmmFileDtl> 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;
}
}

@ -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<CmmRole> 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
*/

@ -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<CmmUser> 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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
//
//}

@ -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<Map<String, Object>> selectBoardList(Map<String, Object> map);
}

@ -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<CmmAddress, CmmAddressIds> {
}

@ -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<CmmBoard, Long> {
// Page<CmmBoard> findByBoardIdGreaterThan(final Long boardId, final Pageable paging);
// Optional<CmmBoard> findByBoardId(final Long boardId);
// void deleteByBoardId(Long boardId);
}

@ -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<CmmFileDtl, CmmFileDtlIds> {
List<CmmFileDtl> findByFileMstId(String fileMstId);
CmmFileDtl findByFileMstIdAndOrgFileNmIgnoreCase(String fileMstId, String OrgFileNm);
//List<CmmFileDtl> findAllById(CmmFileDtlIds cmmFileDtlIds);
}

@ -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<CmmFileMst, String> {
}

@ -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<CmmRoleMenu, Long> {
}

@ -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<CmmRole, String> {
}

@ -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<CmmRoleUer, Long> {
// List<CmmRole> findByCmmUserId(Long cmmUserId);
//
// List<CmmUser> findByRoleId(Long roleId);
}

@ -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<CmmAddress, CmmAddressIds> {
}

@ -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<CmmBoard, Long> {
/**
* use mybatis mapper
* @param map Map
* @return List
*/
List<Map<String, Object>> selectBoardList(Map<String, Object> map);
}

@ -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);
}

@ -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<CmmRoleMenu, Long> {
}

@ -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<CmmRole, String> {
}

@ -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<CmmRoleUer, Long> {
}

@ -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<CmmAddress, CmmAddressIds> implements ICmmAddressService {
private final ICmmAddressRepository cmmAddressRepository;
@Override
protected CrudRepository<CmmAddress, CmmAddressIds> getRepository() {
return cmmAddressRepository;
}
}

@ -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<CmmBoard, Long> 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<CmmBoard, Long> getRepository() {
return boardRepository;
}
@Transactional(readOnly = true)
public Optional<CmmBoard> 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<Map<String, Object>> selectBoardList(Map<String, Object> map) {
return cmmBoardMapper.selectBoardList(map);
}
}

@ -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<CmmFileDtl> 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());
}
*/

@ -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<CmmRoleMenu, Long> implements ICmmRoleMenuService {
private final ICmmRoleMenuRepository cmmRoleMenuRepository;
public CmmRoleMenuService(ICmmRoleMenuRepository cmmRoleMenuRepository) {
this.cmmRoleMenuRepository = cmmRoleMenuRepository;
}
@Override
protected PagingAndSortingRepository<CmmRoleMenu, Long> getRepository() {
return cmmRoleMenuRepository;
}
}

@ -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<CmmRole, String> implements ICmmRoleService {
private final ICmmRoleRepository cmmRoleRepository;
public CmmRoleService(ICmmRoleRepository cmmRoleRepository) {
this.cmmRoleRepository = cmmRoleRepository;
}
@Override
protected CrudRepository<CmmRole, String> getRepository() {
return cmmRoleRepository;
}
}

@ -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<CmmRoleUer, Long> implements ICmmRoleUserService {
private final ICmmRoleUserRepository cmmRoleUserRepository;
public CmmRoleUserService(ICmmRoleUserRepository cmmRoleUserRepository) {
this.cmmRoleUserRepository = cmmRoleUserRepository;
}
@Override
protected CrudRepository<CmmRoleUer, Long> getRepository() {
return cmmRoleUserRepository;
}
}

@ -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;
@ -124,3 +123,4 @@ public class ParkingController {
// }
}

@ -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;

@ -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;
}
}

@ -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<Iterable<CmmUser>>(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<CmmUser> page = cmmUserRepository.findAll(PageRequest.of(pageable.getPageNumber(), pageable.getPageSize()));
// //return xitApiResult.of(new ResponseEntity<Page<CmmUser>>(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<ServerResponse> monoRouterFunction(UserHandler userHandler) {
// return route(GET("/users/{userId}").and(accept(APPLICATION_JSON)), userHandler::getUser);
// }
//
// public Mono<User> getUser(ServerRequest request) {
// // ...
// // request 로부터 userId를 뽑았다고 가정
//
// Mono<User> mono = Mono.just(userService.findById(userId));
// return ServerResponse
// .ok()
// .contentType(MediaType.APPLICATION_JSON)
// .body(mono, User.class);
// }
//*/
//
//}

@ -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> greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
// return new Greeting(counter.incrementAndGet(), String.format(template, name));
// }
//
// @GetMapping("/getGreetings")
// public Flux<Greeting> getAllMargins() {
// return null;//marginRepository.findAll();
// }
}

@ -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<Map<String,Object>> mybatis(@RequestParam @Parameter(hidden = true) Map<String,Object> paramMap) {
return cmmBoardService.selectBoardList(paramMap);
}
@Operation(summary = "에러 예제 - rtnMsg")
@GetMapping("/error1")
public ResponseEntity<? extends IRestResponse> test1() {
AssertUtils.isTrue("조회할 콤보코드 대상이 없습니다.");
return RestResponse.of("test1");
}
}

@ -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<String> titleList = Arrays.asList( "아이디", "이름", "생년월일", "핸드폰번호", "전화", "이메일");
List<String> fieldList = Arrays.asList( "ID", "MBR_NM", "BRTHDY", "HP_NO", "TEL_NO", "EMAIL");
modelMap.addAttribute("titleList", titleList);
modelMap.addAttribute("fieldList", fieldList);
List<Map<String, Object>> listRes = new ArrayList<>();
Map<String, Object> 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> greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
// return new Greeting(counter.incrementAndGet(), String.format(template, name));
// }
//
// @GetMapping("/getGreetings")
// public Flux<Greeting> getAllMargins() {
// return null;//marginRepository.findAll();
// }
}

@ -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 -> {

@ -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<CmmUser> 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<CmmRole> 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<CmmRoleUer> 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<CmmAddress> 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);
}
}

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xit.biz.cmm.mapper.ICmmBoardMapper">
<insert id="insertBoard" useGeneratedKeys="true" keyProperty="boardId" parameterType="com.xit.biz.cmm.entity.CmmBoard">
/* board-mapper|insertBoard|julim */
INSERT
INTO tb_cmm_board (
title
, content
, ins_user_id
, ins_dt_tm
) values (
#{title}
, #{content}
, #{insUserId}
, #{insDtTm}
)
</insert>
<select id="selectBoardList" parameterType="map" resultType="camelCaseLinkedMap">
/* board-mapper|selectBoard|julim */
SELECT *
FROM tb_cmm_board
<where>
<if test='boardId != null and boardId != ""'>
AND board_id = #{boardId}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save