Merge branch 'master' of http://118.219.150.34:50501/DBNT/kcscDev
commit
bf3a460610
|
|
@ -74,6 +74,31 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteBoard(bbs){
|
||||||
|
if(window.confirm("삭제하시겠습니까?")) {
|
||||||
|
EgovNet.requestFetch(
|
||||||
|
'/admin/boards/board-mgt',
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
'Content-type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(bbs)
|
||||||
|
},
|
||||||
|
(resp) => {
|
||||||
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
|
alert("삭제되었습니다.")
|
||||||
|
reloadFunction();
|
||||||
|
} else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) {
|
||||||
|
console.log("토큰 갱신중.")
|
||||||
|
} else {
|
||||||
|
alert(resp.result.resultMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log("------------------------------EgovAdminBoardEdit [End]");
|
console.log("------------------------------EgovAdminBoardEdit [End]");
|
||||||
console.groupEnd("EgovAdminBoardEdit");
|
console.groupEnd("EgovAdminBoardEdit");
|
||||||
|
|
||||||
|
|
@ -118,7 +143,7 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
|
||||||
<button type="submit" className="btn btn_skyblue_h46 w_100">저장
|
<button type="submit" className="btn btn_skyblue_h46 w_100">저장
|
||||||
</button>
|
</button>
|
||||||
{modeInfo.mode === CODE.MODE_MODIFY &&
|
{modeInfo.mode === CODE.MODE_MODIFY &&
|
||||||
<button className="btn btn_skyblue_h46 w_100">삭제</button>
|
<button type={"button"} className="btn btn_skyblue_h46 w_100" onClick={()=>{deleteBoard(props)}}>삭제</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,41 @@
|
||||||
import React from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
import URL from 'constants/url';
|
||||||
|
|
||||||
function Keywords(props) {
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
|
function StandardCodeMgt(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
Keywords
|
<div className="c_wrap">
|
||||||
|
{/* <!-- Location --> */}
|
||||||
|
<div className="location">
|
||||||
|
<ul>
|
||||||
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
|
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
|
||||||
|
<li>게시판현황</li>
|
||||||
|
<li>키워드 관리</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
|
<div className="layout">
|
||||||
|
{/* <!-- Navigation --> */}
|
||||||
|
<EgovLeftNav></EgovLeftNav>
|
||||||
|
{/* <!--// Navigation --> */}
|
||||||
|
|
||||||
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
|
<div className="top_tit">
|
||||||
|
<h1 className="tit_1">키워드 관리</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Keywords;
|
export default StandardCodeMgt;
|
||||||
|
|
@ -6,12 +6,9 @@ import URL from 'constants/url';
|
||||||
import CODE from 'constants/code';
|
import CODE from 'constants/code';
|
||||||
|
|
||||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
import EgovPaging from 'components/EgovPaging';
|
|
||||||
|
|
||||||
import { itemIdxByPage } from 'utils/calc';
|
|
||||||
import MenuModal from "../config/menuMgt/MenuModal";
|
|
||||||
import Modal from "react-bootstrap/Modal";
|
import Modal from "react-bootstrap/Modal";
|
||||||
import EgovAdminBoardEdit from "../board/EgovAdminBoardEdit";
|
import EgovAdminBoardEdit from "../board/EgovAdminBoardEdit";
|
||||||
|
import {format} from "date-fns";
|
||||||
|
|
||||||
function EgovAdminBoardList(props) {
|
function EgovAdminBoardList(props) {
|
||||||
console.group("EgovAdminBoardList");
|
console.group("EgovAdminBoardList");
|
||||||
|
|
@ -63,8 +60,8 @@ function EgovAdminBoardList(props) {
|
||||||
<div>{item.bbsId}</div>
|
<div>{item.bbsId}</div>
|
||||||
<div>{item.bbsTitle}</div>
|
<div>{item.bbsTitle}</div>
|
||||||
<div>{item.frstCrtId}</div>
|
<div>{item.frstCrtId}</div>
|
||||||
<div>{item.frstCrtDt}</div>
|
<div>{item.frstCrtDt ? format(item.frstCrtDt, "yyyy-MM-dd HH:mm") : ""}</div>
|
||||||
<div>{item.lastChgDt}</div>
|
<div>{item.lastChgDt ? format(item.lastChgDt, "yyyy-MM-dd HH:mm") : ""}</div>
|
||||||
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editBoard(item)}}>수정</button></div>
|
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editBoard(item)}}>수정</button></div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,41 @@
|
||||||
import React from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
import URL from 'constants/url';
|
||||||
|
|
||||||
function Posts(props) {
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
|
function StandardCodeMgt(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
Posts
|
<div className="c_wrap">
|
||||||
|
{/* <!-- Location --> */}
|
||||||
|
<div className="location">
|
||||||
|
<ul>
|
||||||
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
|
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
|
||||||
|
<li>게시판현황</li>
|
||||||
|
<li>게시물 관리</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
|
<div className="layout">
|
||||||
|
{/* <!-- Navigation --> */}
|
||||||
|
<EgovLeftNav></EgovLeftNav>
|
||||||
|
{/* <!--// Navigation --> */}
|
||||||
|
|
||||||
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
|
<div className="top_tit">
|
||||||
|
<h1 className="tit_1">게시물 관리</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Posts;
|
export default StandardCodeMgt;
|
||||||
|
|
@ -1,13 +1,41 @@
|
||||||
import React from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
import URL from 'constants/url';
|
||||||
|
|
||||||
function AboutSiteMgt(props) {
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
|
function StandardCodeMgt(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
AboutSiteMgt
|
<div className="c_wrap">
|
||||||
|
{/* <!-- Location --> */}
|
||||||
|
<div className="location">
|
||||||
|
<ul>
|
||||||
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
|
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
|
||||||
|
<li>환경설정</li>
|
||||||
|
<li>관련사이트 관리</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
|
<div className="layout">
|
||||||
|
{/* <!-- Navigation --> */}
|
||||||
|
<EgovLeftNav></EgovLeftNav>
|
||||||
|
{/* <!--// Navigation --> */}
|
||||||
|
|
||||||
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
|
<div className="top_tit">
|
||||||
|
<h1 className="tit_1">관련사이트 관리</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AboutSiteMgt;
|
export default StandardCodeMgt;
|
||||||
|
|
@ -1,11 +1,39 @@
|
||||||
import React from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
import URL from 'constants/url';
|
||||||
|
|
||||||
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
function StandardCodeMgt(props) {
|
function StandardCodeMgt(props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
StandardCodeMgt
|
<div className="c_wrap">
|
||||||
|
{/* <!-- Location --> */}
|
||||||
|
<div className="location">
|
||||||
|
<ul>
|
||||||
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
|
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
|
||||||
|
<li>환경설정</li>
|
||||||
|
<li>건설기준코드 관리</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
|
<div className="layout">
|
||||||
|
{/* <!-- Navigation --> */}
|
||||||
|
<EgovLeftNav></EgovLeftNav>
|
||||||
|
{/* <!--// Navigation --> */}
|
||||||
|
|
||||||
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
|
<div className="top_tit">
|
||||||
|
<h1 className="tit_1">건설기준코드 관리</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,9 @@ function InfoDisclosure(props) {
|
||||||
<div className="contents " id="contents">
|
<div className="contents " id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h1 className="tit_1">건설기준 관리</h1>
|
<h1 className="tit_1">건설기준 내용 관리</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 className="tit_2">건설기준 내용 관리</h2>
|
|
||||||
|
|
||||||
여기에 구현해주세요.
|
여기에 구현해주세요.
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,9 @@ function ReferenceCodes(props) {
|
||||||
<div className="contents " id="contents">
|
<div className="contents " id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h1 className="tit_1">건설기준 관리</h1>
|
<h1 className="tit_1">참조코드 관리</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 className="tit_2">참조코드 관리</h2>
|
|
||||||
|
|
||||||
여기에 구현해주세요.
|
여기에 구현해주세요.
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,9 @@ function SimilarityCheck(props) {
|
||||||
<div className="contents " id="contents">
|
<div className="contents " id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h1 className="tit_1">건설기준 관리</h1>
|
<h1 className="tit_1">유사성 검사</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 className="tit_2">유사성 검사</h2>
|
|
||||||
|
|
||||||
여기에 구현해주세요.
|
여기에 구현해주세요.
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class AdminBoardsController extends BaseController {
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "게시판 저장",
|
summary = "게시판 저장",
|
||||||
description = "게시판 저장",
|
description = "게시판 저장",
|
||||||
tags = {"AdminConfigController"}
|
tags = {"AdminBoardsController"}
|
||||||
)
|
)
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "저장 성공"),
|
@ApiResponse(responseCode = "200", description = "저장 성공"),
|
||||||
|
|
@ -83,4 +83,30 @@ public class AdminBoardsController extends BaseController {
|
||||||
}
|
}
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(
|
||||||
|
summary = "게시판 삭제",
|
||||||
|
description = "게시판 삭제",
|
||||||
|
tags = {"AdminBoardsController"}
|
||||||
|
)
|
||||||
|
@ApiResponses(value = {
|
||||||
|
@ApiResponse(responseCode = "200", description = "삭제 성공"),
|
||||||
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
|
})
|
||||||
|
@RequestMapping(method = RequestMethod.DELETE, value = "/board-mgt")
|
||||||
|
public ResultVO removeBoardMgt(@RequestBody TnBbs bbs, @AuthenticationPrincipal LoginVO user) {
|
||||||
|
ResultVO resultVO = new ResultVO();
|
||||||
|
if (user == null) {
|
||||||
|
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
||||||
|
} else {
|
||||||
|
String result = adminBoardsService.deleteBoard(bbs, user.getId());
|
||||||
|
if (result == null) {
|
||||||
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
|
} else if (result.equals("notFind")) {
|
||||||
|
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
||||||
|
resultVO.setResultMessage("대상이 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultVO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,13 @@ package com.dbnt.kcscbackend.admin.boards.repository;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.boards.entity.TnBbs;
|
import com.dbnt.kcscbackend.admin.boards.entity.TnBbs;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TnBbsRepository extends JpaRepository<TnBbs, Long> {
|
public interface TnBbsRepository extends JpaRepository<TnBbs, Long> {
|
||||||
|
|
||||||
|
@Query(value = "SELECT * FROM tn_bbs WHERE use_yn = 'Y' ORDER BY bbs_seq DESC", nativeQuery = true)
|
||||||
List<TnBbs> findAllByOrderByBbsSeqDesc();
|
List<TnBbs> findAllByOrderByBbsSeqDesc();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.dbnt.kcscbackend.admin.boards.service;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.boards.entity.TnBbs;
|
import com.dbnt.kcscbackend.admin.boards.entity.TnBbs;
|
||||||
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsRepository;
|
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsRepository;
|
||||||
|
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -17,13 +18,16 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
|
||||||
|
|
||||||
private final TnBbsRepository tnBbsRepository;
|
private final TnBbsRepository tnBbsRepository;
|
||||||
|
|
||||||
public List<TnBbs> selectBoardList() { return tnBbsRepository.findAllByOrderByBbsSeqDesc(); }
|
public List<TnBbs> selectBoardList() {
|
||||||
|
return tnBbsRepository.findAllByOrderByBbsSeqDesc();
|
||||||
|
}
|
||||||
|
|
||||||
public Optional<TnBbs> selectBoard(Long bbsSeq) { return tnBbsRepository.findById(bbsSeq); }
|
public Optional<TnBbs> selectBoard(Long bbsSeq) {
|
||||||
|
return tnBbsRepository.findById(bbsSeq);
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void saveBoard(TnBbs bbs, String userId) {
|
public void saveBoard(TnBbs bbs, String userId) {
|
||||||
|
|
||||||
if (bbs.getBbsSeq() == null) {
|
if (bbs.getBbsSeq() == null) {
|
||||||
bbs.setFrstCrtDt(LocalDateTime.now());
|
bbs.setFrstCrtDt(LocalDateTime.now());
|
||||||
bbs.setFrstCrtId(userId);
|
bbs.setFrstCrtId(userId);
|
||||||
|
|
@ -43,4 +47,18 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public String deleteBoard(TnBbs bbs, String userId) {
|
||||||
|
TnBbs savedBoard = tnBbsRepository.findById(bbs.getBbsSeq()).orElse(null);
|
||||||
|
if (savedBoard == null) {
|
||||||
|
return "notFind";
|
||||||
|
} else {
|
||||||
|
savedBoard.setUseYn("N");
|
||||||
|
savedBoard.setLastChgDt(LocalDateTime.now());
|
||||||
|
savedBoard.setLastChgId(userId);
|
||||||
|
tnBbsRepository.save(savedBoard);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue