Compare commits
No commits in common. "a23833a00bf46ef3b25b20d97aa0287a921698a0" and "f519a8af382ba667c601090a2f48c4daf9a3463e" have entirely different histories.
a23833a00b
...
f519a8af38
|
|
@ -1,58 +0,0 @@
|
||||||
import React, { useEffect } from 'react';
|
|
||||||
|
|
||||||
import Button from '@mui/material/Button';
|
|
||||||
import Dialog from '@mui/material/Dialog';
|
|
||||||
import DialogActions from '@mui/material/DialogActions';
|
|
||||||
import DialogContent from '@mui/material/DialogContent';
|
|
||||||
import DialogContentText from '@mui/material/DialogContentText';
|
|
||||||
import DialogTitle from '@mui/material/DialogTitle';
|
|
||||||
import Slide from '@mui/material/Slide';
|
|
||||||
|
|
||||||
const Transition = React.forwardRef(function Transition(props, ref) {
|
|
||||||
return <Slide direction="up" ref={ref} {...props} />;
|
|
||||||
});
|
|
||||||
|
|
||||||
export default function AlertDialogSlide({confirm, setConfirm}) {
|
|
||||||
|
|
||||||
useEffect(function () {
|
|
||||||
if( confirm ) {
|
|
||||||
setConfirm({
|
|
||||||
...confirm,
|
|
||||||
//open: !confirm.open && false,
|
|
||||||
//title: !confirm.title && "중요",
|
|
||||||
///yes: !confirm.yes && "예",
|
|
||||||
//no: !confirm.no && "아니요",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
setConfirm({...confirm, open: false});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<React.Fragment>
|
|
||||||
{confirm &&
|
|
||||||
<Dialog
|
|
||||||
open={ confirm.open }
|
|
||||||
TransitionComponent={Transition}
|
|
||||||
keepMounted
|
|
||||||
onClose={handleClose}
|
|
||||||
aria-describedby="alert-dialog-slide-description"
|
|
||||||
>
|
|
||||||
<DialogTitle>{confirm.title ? confirm.title : "알림"}</DialogTitle>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogContentText id="alert-dialog-slide-description">{confirm.body}</DialogContentText>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={() => {handleClose(); confirm.yesCallback && confirm.yesCallback(confirm.yesCallbackParams);}}>{confirm.yes ? confirm.yes : "예"}</Button>
|
|
||||||
<Button onClick={() => {handleClose(); confirm.noCallback && confirm.noCallback(confirm.noCallbackParams);}}>{confirm.no ? confirm.no : "아니요"}</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
|
||||||
}
|
|
||||||
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +1,13 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Link, useLocation, useNavigate } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import Switch from '@mui/material/Switch';
|
import Switch from '@mui/material/Switch';
|
||||||
|
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
import URL from 'constants/url';
|
import URL from 'constants/url';
|
||||||
import CODE from 'constants/code';
|
|
||||||
|
|
||||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo';
|
import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo';
|
||||||
|
|
||||||
|
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
const StyledDiv = styled.div`
|
const StyledDiv = styled.div`
|
||||||
|
|
@ -23,7 +21,6 @@ const label = { inputProps: { 'aria-label': '사용여부' } };
|
||||||
function PopUp(props) {
|
function PopUp(props) {
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const [listPopup, setListPopup] = useState([]);
|
const [listPopup, setListPopup] = useState([]);
|
||||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
|
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
|
||||||
|
|
@ -55,32 +52,6 @@ function PopUp(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const onChangeActivationSwitch = (e, popupId) => {
|
|
||||||
const checked = e.target.checked;
|
|
||||||
const requestURL = `/contents/api/popup-manage/activation-switch/${popupId}?checked=${checked}`;
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
method: "PUT",
|
|
||||||
headers: {
|
|
||||||
'Content-type': 'application/json',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EgovNet.requestFetch(requestURL,
|
|
||||||
requestOptions,
|
|
||||||
(resp) => {
|
|
||||||
console.log("====>>> Schdule delete= ", resp);
|
|
||||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
|
||||||
navigate(URL.ADMIN__CONTENTS__POP_UP ,{ replace: true });
|
|
||||||
} else {
|
|
||||||
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Location = React.memo(function Location() {
|
const Location = React.memo(function Location() {
|
||||||
return (
|
return (
|
||||||
<div className="location">
|
<div className="location">
|
||||||
|
|
@ -135,11 +106,11 @@ function PopUp(props) {
|
||||||
<p className="no_data" key="0">검색된 결과가 없습니다.</p>
|
<p className="no_data" key="0">검색된 결과가 없습니다.</p>
|
||||||
}
|
}
|
||||||
{listPopup.map((it)=>(
|
{listPopup.map((it)=>(
|
||||||
<div className='list_item' key={it.seq}>
|
<div className='list_item'>
|
||||||
<div>{it.seq}</div>
|
<div>{it.seq}</div>
|
||||||
<div className="al"><Link to={URL.ADMIN__CONTENTS__POP_UP__MODIFY} state={{popupId: it.seq} } key={it.seq}>{it.popupTitle}</Link></div>
|
<div className="al"><Link to={URL.ADMIN__CONTENTS__POP_UP__MODIFY} state={{popupId: it.seq} } key={it.seq}>{it.popupTitle}</Link></div>
|
||||||
<div>{it.startDate} ~ {it.endDate}</div>
|
<div>{it.startDate} ~ {it.endDate}</div>
|
||||||
<div>{it.useYn === 'Y' ? <Switch {...label} key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} defaultChecked /> : <Switch key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} {...label} />}</div>
|
<div>{it.useYn === 'Y' ? <Switch {...label} defaultChecked /> : <Switch {...label} />}</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import DatePicker from "react-datepicker";
|
||||||
|
|
||||||
import EgovAttachFile from 'components/EgovAttachFile';
|
import EgovAttachFile from 'components/EgovAttachFile';
|
||||||
import RichTextEditor from "../../../../components/editor/RichTextEditor";
|
import RichTextEditor from "../../../../components/editor/RichTextEditor";
|
||||||
import AlertDialogSlide from "../../../../components/alert/AlertDialogSlide";
|
|
||||||
import CODE from 'constants/code';
|
import CODE from 'constants/code';
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,8 +34,7 @@ function PopupWriter(props) {
|
||||||
|
|
||||||
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
|
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
|
||||||
const [text, setText] = useState("");
|
const [text, setText] = useState("");
|
||||||
const [textOriginal, setTextOriginal] = useState("");
|
const [popupDetail, setScheduleDetail] = useState({ startDate: new Date(), endDate: new Date() });
|
||||||
const [popupDetail, setPopupDetail] = useState({ startDate: new Date(), endDate: new Date() });
|
|
||||||
|
|
||||||
const [schdulBgndeHH, setSchdulBgndeHH] = useState();
|
const [schdulBgndeHH, setSchdulBgndeHH] = useState();
|
||||||
const [schdulBgndeMM, setSchdulBgndeMM] = useState();
|
const [schdulBgndeMM, setSchdulBgndeMM] = useState();
|
||||||
|
|
@ -44,10 +42,6 @@ function PopupWriter(props) {
|
||||||
const [schdulEnddeMM, setSchdulEnddeMM] = useState();
|
const [schdulEnddeMM, setSchdulEnddeMM] = useState();
|
||||||
const [boardAttachFiles, setBoardAttachFiles] = useState();
|
const [boardAttachFiles, setBoardAttachFiles] = useState();
|
||||||
|
|
||||||
const [confirm, setConfirm] = React.useState();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(function () {
|
useEffect(function () {
|
||||||
initMode();
|
initMode();
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|
@ -114,14 +108,13 @@ function PopupWriter(props) {
|
||||||
function (resp) {
|
function (resp) {
|
||||||
let rawDetail = resp.result;
|
let rawDetail = resp.result;
|
||||||
//기본값 설정
|
//기본값 설정
|
||||||
setPopupDetail({
|
setScheduleDetail({
|
||||||
...popupDetail,
|
...popupDetail,
|
||||||
...rawDetail,
|
...rawDetail,
|
||||||
startDate: convertDate(rawDetail.schdulBgnde),
|
startDate: convertDate(rawDetail.schdulBgnde),
|
||||||
endDate: convertDate(rawDetail.schdulEndde),
|
endDate: convertDate(rawDetail.schdulEndde),
|
||||||
});
|
});
|
||||||
setText(rawDetail.contents);
|
setText(rawDetail.contents);
|
||||||
setTextOriginal(rawDetail.contents);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -151,35 +144,25 @@ function PopupWriter(props) {
|
||||||
body: formData
|
body: formData
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestTask = (callbackParams) => {
|
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
||||||
EgovNet.requestFetch(callbackParams.requestUrl,
|
modeInfo.editURL = `${modeInfo.editURL}/${location.state?.popupId}`;
|
||||||
|
}
|
||||||
|
EgovNet.requestFetch(modeInfo.editURL,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
(resp) => {
|
(resp) => {
|
||||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
|
||||||
alert("게시글이 수정 되었습니다.");
|
|
||||||
}
|
|
||||||
navigate({ pathname: URL.ADMIN__CONTENTS__POP_UP });
|
navigate({ pathname: URL.ADMIN__CONTENTS__POP_UP });
|
||||||
} else {
|
} else {
|
||||||
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if (modeInfo.mode === CODE.MODE_CREATE) {
|
|
||||||
setConfirm({...confirm, open: true, body: "추가하시겠습니까?", yesCallback: requestTask, yesCallbackParams: {requestUrl:modeInfo.editURL}});
|
|
||||||
} else if (modeInfo.mode === CODE.MODE_MODIFY) {
|
|
||||||
setConfirm({...confirm, open: true, body: "수정하시겠습니까?", yesCallback: requestTask, yesCallbackParams: {requestUrl:`${modeInfo.editURL}/${location.state?.popupId}`}});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickDelete = (popupId) => {
|
const onClickDelete = (popupId) => {
|
||||||
const deleteBoardURL = `/contents/api/popup-manage/${popupId}`;
|
const deleteBoardURL = `/schedule/${popupId}`;
|
||||||
|
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
|
|
@ -188,37 +171,22 @@ function PopupWriter(props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestTask = () => {
|
|
||||||
EgovNet.requestFetch(deleteBoardURL,
|
EgovNet.requestFetch(deleteBoardURL,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
(resp) => {
|
(resp) => {
|
||||||
|
console.log("====>>> Schdule delete= ", resp);
|
||||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
alert("삭제 되었습니다.");
|
alert("게시글이 삭제되었습니다.")
|
||||||
navigate(URL.ADMIN__CONTENTS__POP_UP ,{ replace: true });
|
navigate(URL.ADMIN__COMMITTEE__SCHEDULES ,{ replace: true });
|
||||||
} else {
|
} else {
|
||||||
|
// alert("ERR : " + resp.message);
|
||||||
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
setConfirm({...confirm, open: true, body: "삭제하시겠습니까?", yesCallback: requestTask});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickList = (e) => {
|
|
||||||
|
|
||||||
const requestTask = () => {
|
|
||||||
navigate(URL.ADMIN__CONTENTS__POP_UP ,{ replace: true });
|
|
||||||
};
|
|
||||||
if( text !== textOriginal ) {
|
|
||||||
setConfirm({...confirm, open: true, body: "작업 내용을 취소하시겠습니까?", yesCallback: requestTask});
|
|
||||||
} else {
|
|
||||||
requestTask();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const convertDate = (str) => {
|
const convertDate = (str) => {
|
||||||
let year = str.substring(0, 4);
|
let year = str.substring(0, 4);
|
||||||
let month = str.substring(4, 6);
|
let month = str.substring(4, 6);
|
||||||
|
|
@ -276,7 +244,7 @@ function PopupWriter(props) {
|
||||||
<dd>
|
<dd>
|
||||||
<input className="f_input2 w_full" type="text" name="title" title="제목" id="title" placeholder="제목을 입력하세요."
|
<input className="f_input2 w_full" type="text" name="title" title="제목" id="title" placeholder="제목을 입력하세요."
|
||||||
value={popupDetail.title}
|
value={popupDetail.title}
|
||||||
onChange={(e) => setPopupDetail({ ...popupDetail, title: e.target.value })}
|
onChange={(e) => setScheduleDetail({ ...popupDetail, title: e.target.value })}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -292,7 +260,7 @@ function PopupWriter(props) {
|
||||||
showTimeInput
|
showTimeInput
|
||||||
onChange={(date) => {
|
onChange={(date) => {
|
||||||
console.log("setStartDate : ", date);
|
console.log("setStartDate : ", date);
|
||||||
setPopupDetail({ ...popupDetail, schdulBgnde: getDateFourteenDigit(date), schdulBgndeYYYMMDD: getYYYYMMDD(date), schdulBgndeHH: date.getHours(), schdulBgndeMM: date.getMinutes(), startDate: date });
|
setScheduleDetail({ ...popupDetail, schdulBgnde: getDateFourteenDigit(date), schdulBgndeYYYMMDD: getYYYYMMDD(date), schdulBgndeHH: date.getHours(), schdulBgndeMM: date.getMinutes(), startDate: date });
|
||||||
setSchdulBgndeHH(date.getHours());
|
setSchdulBgndeHH(date.getHours());
|
||||||
setSchdulBgndeMM(date.getMinutes());
|
setSchdulBgndeMM(date.getMinutes());
|
||||||
}} />
|
}} />
|
||||||
|
|
@ -310,7 +278,7 @@ function PopupWriter(props) {
|
||||||
minDate={popupDetail.startDate}
|
minDate={popupDetail.startDate}
|
||||||
onChange={(date) => {
|
onChange={(date) => {
|
||||||
console.log("setEndDate: ", date);
|
console.log("setEndDate: ", date);
|
||||||
setPopupDetail({ ...popupDetail, schdulEndde: getDateFourteenDigit(date), schdulEnddeYYYMMDD: getYYYYMMDD(date), schdulEnddeHH: date.getHours(), schdulEnddeMM: date.getMinutes(), endDate: date });
|
setScheduleDetail({ ...popupDetail, schdulEndde: getDateFourteenDigit(date), schdulEnddeYYYMMDD: getYYYYMMDD(date), schdulEnddeHH: date.getHours(), schdulEnddeMM: date.getMinutes(), endDate: date });
|
||||||
setSchdulEnddeHH(date.getHours());
|
setSchdulEnddeHH(date.getHours());
|
||||||
setSchdulEnddeMM(date.getMinutes());
|
setSchdulEnddeMM(date.getMinutes());
|
||||||
}
|
}
|
||||||
|
|
@ -327,7 +295,7 @@ function PopupWriter(props) {
|
||||||
for ( let i = 0; i < attachfile.length; i++) {
|
for ( let i = 0; i < attachfile.length; i++) {
|
||||||
arrayConcat[`file_${i}`] = attachfile[i];
|
arrayConcat[`file_${i}`] = attachfile[i];
|
||||||
}
|
}
|
||||||
setPopupDetail(arrayConcat);
|
setScheduleDetail(arrayConcat);
|
||||||
}}
|
}}
|
||||||
fnDeleteFile={(deletedFile) => {
|
fnDeleteFile={(deletedFile) => {
|
||||||
console.log("====>>> Delete deletedFile = ", deletedFile);
|
console.log("====>>> Delete deletedFile = ", deletedFile);
|
||||||
|
|
@ -356,13 +324,11 @@ function PopupWriter(props) {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="right_col btn1">
|
<div className="right_col btn1">
|
||||||
<button className="btn btn_blue_h46 w_100"
|
<Link to={URL.ADMIN__CONTENTS__POP_UP} className="btn btn_blue_h46 w_100">목록</Link>
|
||||||
onClick={onClickList}>목록</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// 버튼영역 --> */}
|
{/* <!--// 버튼영역 --> */}
|
||||||
|
|
||||||
<AlertDialogSlide confirm={confirm} setConfirm={setConfirm} />
|
|
||||||
</StyledDiv>
|
</StyledDiv>
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -151,13 +151,13 @@ public class SchedulesApiController {
|
||||||
(
|
(
|
||||||
@AuthenticationPrincipal LoginVO user,
|
@AuthenticationPrincipal LoginVO user,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
@PathVariable("scheduleId") String strSchdulId
|
@PathVariable("scheduleId") String schdulId
|
||||||
) throws Exception {
|
) throws Exception {
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Long schdulId = Long.valueOf(strSchdulId);
|
Long test = Long.valueOf(schdulId);
|
||||||
try {
|
try {
|
||||||
resultVO = egovIndvdlSchdulManageService.deleteSchedule(resultVO, request, schdulId);
|
resultVO = egovIndvdlSchdulManageService.deleteSchedule(resultVO, request, test);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
resultVO.setResultCode(ResponseCode.FAILED.getCode());
|
resultVO.setResultCode(ResponseCode.FAILED.getCode());
|
||||||
resultVO.setResultMessage(e.getMessage());
|
resultVO.setResultMessage(e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
|
@ -130,6 +129,7 @@ public class PopUpApiController {
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
||||||
|
@ApiResponse(responseCode = "900", description = "입력값 무결성 오류")
|
||||||
})
|
})
|
||||||
@PutMapping(value = "/contents/api/popup-manage/{popupId}")
|
@PutMapping(value = "/contents/api/popup-manage/{popupId}")
|
||||||
public ResultVO contentsApiPopUpManageUpdate(
|
public ResultVO contentsApiPopUpManageUpdate(
|
||||||
|
|
@ -162,86 +162,6 @@ public class PopUpApiController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "팝업 비활성화 API",
|
|
||||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 팝업을 비활성화 API. 삭제가 아닌 비활성화 임. 삭제는 없음.",
|
|
||||||
tags = {"PopUpApiController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
|
||||||
})
|
|
||||||
@DeleteMapping(value = "/contents/api/popup-manage/{popupId}")
|
|
||||||
public ResultVO contentsApiPopUpManageDelete
|
|
||||||
(
|
|
||||||
@AuthenticationPrincipal LoginVO user,
|
|
||||||
HttpServletRequest request,
|
|
||||||
@PathVariable("popupId") String strPopupId
|
|
||||||
) throws Exception {
|
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
Long popupId = Long.valueOf(strPopupId);
|
|
||||||
try {
|
|
||||||
resultVO = popUpApiService.contentsApiPopUpManageDelete(resultVO, request, user, popupId);
|
|
||||||
} catch (Exception e) {
|
|
||||||
resultVO.setResultCode(ResponseCode.FAILED.getCode());
|
|
||||||
resultVO.setResultMessage(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " OUT:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"resultVO.toString():" + "\n" +
|
|
||||||
resultVO.toString() + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "팝업 활성화 또는 비활성화 설정하는 API",
|
|
||||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 '사용여부'를 활성화 또는 비활성화 설정해주는 API.",
|
|
||||||
tags = {"PopUpApiController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
|
||||||
})
|
|
||||||
@PutMapping(value = "/contents/api/popup-manage/activation-switch/{popupId}")
|
|
||||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(
|
|
||||||
HttpServletRequest request,
|
|
||||||
@AuthenticationPrincipal LoginVO loginVO,
|
|
||||||
@ApiParam(value="활성화 여부") @RequestParam(required=true) String checked,
|
|
||||||
@PathVariable("popupId") Long popupId
|
|
||||||
) throws Exception {
|
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
|
|
||||||
try {
|
|
||||||
resultVO = popUpApiService.contentsApiPopUpManageUpdateActivationSwitch(resultVO, request, loginVO, checked, popupId);
|
|
||||||
} catch (Exception e) {
|
|
||||||
resultVO.setResultCode(ResponseCode.FAILED.getCode());
|
|
||||||
resultVO.setResultMessage(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " OUT:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"resultVO.toString():" + "\n" +
|
|
||||||
resultVO.toString() + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "팝업 내용 불러오기 API",
|
summary = "팝업 내용 불러오기 API",
|
||||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 저장된 팝업을 불러오는 API",
|
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 저장된 팝업을 불러오는 API",
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,7 @@ import com.dbnt.kcscbackend.admin.contents.popUp.model.CreatePopupVO;
|
||||||
import com.dbnt.kcscbackend.admin.contents.popUp.model.UpdatePopupVO;
|
import com.dbnt.kcscbackend.admin.contents.popUp.model.UpdatePopupVO;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import io.swagger.annotations.ApiParam;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
@ -18,7 +14,6 @@ public interface PopUpApiService {
|
||||||
public ResultVO contentsApiPopUpManageCreate(ResultVO resultVO, HttpServletRequest request, LoginVO user, final MultipartHttpServletRequest multiRequest, CreatePopupVO createPopupVO) throws Exception;
|
public ResultVO contentsApiPopUpManageCreate(ResultVO resultVO, HttpServletRequest request, LoginVO user, final MultipartHttpServletRequest multiRequest, CreatePopupVO createPopupVO) throws Exception;
|
||||||
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||||
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, UpdatePopupVO updatePopupVO, Long popupId) throws Exception;
|
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, UpdatePopupVO updatePopupVO, Long popupId) throws Exception;
|
||||||
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
|
||||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(ResultVO resultVO, HttpServletRequest request, LoginVO user, String checked, Long popupId) throws Exception;
|
|
||||||
|
|
||||||
|
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
@ -226,85 +226,7 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
|
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
|
||||||
System.out.println(
|
return null;
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " IN:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"popupId:" + "\n" +
|
|
||||||
popupId + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
if( false ) {
|
|
||||||
// 삭제 procedure가 삭제가 아닌 비활성화만 시키므로 해당 프로시저 사용 안 함.
|
|
||||||
Map<String, Object> response = tnPopupMngRepository.spDeleteTnPopupMng(
|
|
||||||
popupId.intValue(),
|
|
||||||
"admin",
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
dto.put("errorMessage", response.get("_error_message") );
|
|
||||||
} else {
|
|
||||||
tnPopupMngRepository.deleteById(popupId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dto.put("popupId", popupId );
|
|
||||||
|
|
||||||
resultVO.setResult(dto);
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResultVO contentsApiPopUpManageUpdateActivationSwitch(ResultVO resultVO, HttpServletRequest request, LoginVO user, String checked, Long popupId) throws Exception {
|
|
||||||
System.out.println(
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
request.getRequestURI() + " IN:" +
|
|
||||||
"\n--------------------------------------------------------------\n" +
|
|
||||||
"checked:" + "\n" +
|
|
||||||
checked + "\n" +
|
|
||||||
"popupId:" + "\n" +
|
|
||||||
popupId + "\n" +
|
|
||||||
"\n--------------------------------------------------------------\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 유효성 검사 실시
|
|
||||||
int isValid = tnPopupMngRepository.spIsValidTnPopupMngId( popupId.intValue() );
|
|
||||||
|
|
||||||
if( isValid == 0 ) {
|
|
||||||
throw new Exception("대상이 존재하지 않습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
TnPopupMng tnPopupMng = tnPopupMngRepository.findByPopupSeq(popupId);
|
|
||||||
if( Boolean.parseBoolean(checked) ) {
|
|
||||||
tnPopupMng.setUseYn("Y");
|
|
||||||
} else {
|
|
||||||
tnPopupMng.setUseYn("N");
|
|
||||||
}
|
|
||||||
|
|
||||||
tnPopupMngRepository.saveAndFlush(tnPopupMng);
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> dto = new HashMap<String, Object>();
|
|
||||||
dto.put("popupId", popupId);
|
|
||||||
|
|
||||||
resultVO.setResult(dto);
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
|
|
||||||
return resultVO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ public class TnPopupMng {
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class TnPopupMngId implements Serializable {
|
public static class TnPopupMngId implements Serializable {
|
||||||
private static final long serialVersionUID = -6558812991140219351L;
|
|
||||||
private String popupSeq;
|
private String popupSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, Long> {
|
public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, TnPopupMng.TnPopupMngId> {
|
||||||
|
|
||||||
@Query(value = "CALL sp_add_tn_popup_mng (" +
|
@Query(value = "CALL sp_add_tn_popup_mng (" +
|
||||||
":_popup_title, " +
|
":_popup_title, " +
|
||||||
|
|
@ -76,23 +76,6 @@ public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, Long> {
|
||||||
@Param("_error_message") String errorMessage
|
@Param("_error_message") String errorMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@Query(value = "CALL sp_delete_tn_popup_mng (" +
|
|
||||||
":_popup_seq, " +
|
|
||||||
":_modi_id, " +
|
|
||||||
":_result_count, " +
|
|
||||||
":_result_code, " +
|
|
||||||
":_error_message)",
|
|
||||||
nativeQuery = true)
|
|
||||||
Map<String, Object> spDeleteTnPopupMng(
|
|
||||||
@Param("_popup_seq") Integer popupSeq,
|
|
||||||
@Param("_modi_id") String modiId,
|
|
||||||
@Param("_result_count") Integer resultCount,
|
|
||||||
@Param("_result_code") String resultCode,
|
|
||||||
@Param("_error_message") String errorMessage
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
@Procedure("sp_is_valid_tn_popup_mng_id")
|
@Procedure("sp_is_valid_tn_popup_mng_id")
|
||||||
int spIsValidTnPopupMngId( Integer popupSeq );
|
int spIsValidTnPopupMngId( Integer popupSeq );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue