Browse Source

QnA업데이트 시간 추가

pull/10/head
lkd9125(이경도) 11 months ago
parent
commit
f20ada92ab
  1. 9
      pav-server/src/main/java/com/palnet/biz/api/cns/qna/service/CnsQnaService.java

9
pav-server/src/main/java/com/palnet/biz/api/cns/qna/service/CnsQnaService.java

@ -99,13 +99,20 @@ public class CnsQnaService {
CnsQnaBas entity = cnsQnaBasRepository.findFirstByQnaSnoAndTargetSnoAndDelYnAndExpsrYn(qnaSno, 0, "N", "Y"); CnsQnaBas entity = cnsQnaBasRepository.findFirstByQnaSnoAndTargetSnoAndDelYnAndExpsrYn(qnaSno, 0, "N", "Y");
if(entity == null) throw new CustomException(ErrorCode.DATA_NOTFIND); if(entity == null) throw new CustomException(ErrorCode.DATA_NOTFIND);
List<MultipartFile> files = rq.getFiles(); List<MultipartFile> files = rq.getFiles();
if(files != null && files.size() > 0) comnFileService.fileUpload(files, entity.getFileGroupNo()); // File 업로드 if(files != null && files.size() > 0) comnFileService.fileUpload(files, entity.getFileGroupNo()); // File 업로드
if(rq.getCategory() != null) entity.setCategory(rq.getCategory()); if(rq.getCategory() != null) entity.setCategory(rq.getCategory());
if(rq.getContent() != null) entity.setContent(rq.getContent()); if(rq.getContent() != null) entity.setContent(rq.getContent());
if(rq.getTitle() != null) entity.setTitle(rq.getTitle()); if(rq.getTitle() != null) entity.setTitle(rq.getTitle());
String userId = jwtTokenUtil.getUserIdByToken();
if (userId == null) userId = "NONE";
entity.setUpdateDt(Instant.now());
entity.setUpdateUserId(userId);
cnsQnaBasRepository.save(entity); cnsQnaBasRepository.save(entity);
return true; return true;

Loading…
Cancel
Save