Compare commits
7 Commits
811e914666
...
4fc4240ded
| Author | SHA1 | Date |
|---|---|---|
|
|
4fc4240ded | |
|
|
6d02a20ac1 | |
|
|
22a185a3ab | |
|
|
139ab45831 | |
|
|
cad4e6d5e0 | |
|
|
e40a1d9018 | |
|
|
dc8c3579cd |
|
|
@ -316,6 +316,16 @@
|
|||
.BRD011 .result .list_item > div:nth-child(12) {width: 60px;}
|
||||
.BRD011 .result .list_item > div:nth-child(13) {width: 60px;}
|
||||
|
||||
/* 건설기준관리 - API키 관리*/
|
||||
.BRD012 .head > span:nth-child(1) {width: 100px;}
|
||||
.BRD012 .head > span:nth-child(2) {width: 360px;}
|
||||
.BRD012 .head > span:nth-child(3) {width: 200px;}
|
||||
.BRD012 .head > span:nth-child(4) {width: 150px;}
|
||||
.BRD012 .result .list_item > div:nth-child(1) {width: 100px;}
|
||||
.BRD012 .result .list_item > div:nth-child(2) {width: 360px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
|
||||
.BRD012 .result .list_item > div:nth-child(3) {width: 200px;}
|
||||
.BRD012 .result .list_item > div:nth-child(4) {width: 150px;}
|
||||
|
||||
/* 게시판 사용관리 등록 */
|
||||
.BOARD_USE_LIST .board_view2 dl dt {width: 185px;}
|
||||
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 490px; margin-left: 17px;}
|
||||
|
|
|
|||
|
|
@ -480,6 +480,18 @@
|
|||
.BRD011 .result .list_item > div:nth-child(6)::after {content: ""; display: inline-block; width: 1px; height: 11px; margin-left: 6px; background: #ccc; vertical-align: 0px;}
|
||||
.BRD011 .result .list_item > div:nth-child(6)::after {content: none;}
|
||||
|
||||
/* 건설기준관리 - API키 관리*/
|
||||
.BRD012 .head {display: none;}
|
||||
.BRD012 .result .list_item {padding: 16px 0; border-bottom: 1px solid #dde2e5;}
|
||||
.BRD012 .result .list_item > div {border-bottom: 0; font-size: 14px;}
|
||||
.BRD012 .result .list_item > div:nth-child(1) {display: none;}
|
||||
.BRD012 .result .list_item > div:nth-child(2) {width: 100%; padding: 0 0 2px 0; font-weight: 700; text-align: left;}
|
||||
.BRD012 .result .list_item > div:nth-child(3),
|
||||
.BRD012 .result .list_item > div:nth-child(4),
|
||||
.BRD012 .result .list_item > div:nth-child(3)::after,
|
||||
.BRD012 .result .list_item > div:nth-child(4)::after,
|
||||
|
||||
|
||||
.BOARD_USE_LIST .board_view2 dl dt {width: 95px;}
|
||||
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_select {width: 100%;}
|
||||
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 100%; margin: 15px 0 0 0;}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ function Schedules(props) {
|
|||
if (scheduleList.length > 0) {//일정 있는 경우
|
||||
return (
|
||||
<td key={keyIdx++}>
|
||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} sss="test" state={{test: "ddfdf", iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
|
||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} sss="test" state={{ iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
|
||||
key={keyIdx++}>{day}</Link><br/>
|
||||
{
|
||||
scheduleList.map((schedule, scheduleIdx) => {
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ function SchedulesDetail(props) {
|
|||
console.log("EgovAdminScheduleDetail [location] : ", location);
|
||||
|
||||
const [scheduleDetail, setScheduleDetail] = useState({});
|
||||
const [boardAttachFiles, setBoardAttachFiles] = useState();
|
||||
const [user, setUser] = useState({});
|
||||
|
||||
const retrieveDetail = () => {
|
||||
|
||||
|
|
@ -32,17 +30,6 @@ function SchedulesDetail(props) {
|
|||
EgovNet.requestFetch(retrieveDetailURL,
|
||||
requestOptions,
|
||||
function (resp) {
|
||||
/**
|
||||
* dto.put("evtSeq", tnCmtEvent.getEvtSeq()); // sequence
|
||||
dto.put("divMeet", tnCmtEvent.getEvtType()); // 구분
|
||||
dto.put("upCommittee", tnCmtEvent.getUpCmtSeq()); // 심의위원회 상위 코드 번호
|
||||
dto.put("committee", tnCmtEvent.getCmtSeq()); // 심의위원회 하위 코드 번호
|
||||
dto.put("title", tnCmtEvent.getEvtTitle()); // 제목
|
||||
dto.put("location", tnCmtEvent.getEvtLocation()); // 장소
|
||||
dto.put("contents", tnCmtEvent.getEvtContents()); // 내용
|
||||
dto.put("startDate", tnCmtEvent.getEvtStartDt()); // 날짜/시간의 시작 일시
|
||||
dto.put("endDate", tnCmtEvent.getEvtEndDt()); // 날짜/시간의 종료 일시
|
||||
*/
|
||||
setScheduleDetail(resp.result);
|
||||
}
|
||||
);
|
||||
|
|
@ -137,20 +124,18 @@ function SchedulesDetail(props) {
|
|||
</dl>
|
||||
|
||||
{/* <!-- 버튼영역 --> */}
|
||||
<div className="board_btn_area">
|
||||
{user.id || true &&
|
||||
<div className="left_col btn1">
|
||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY}}
|
||||
state={{
|
||||
schdulId: location.state?.schdulId
|
||||
}}
|
||||
className="btn btn_skyblue_h46 w_100">수정</Link>
|
||||
<button className="btn btn_skyblue_h46 w_100"
|
||||
onClick={(e) => {
|
||||
onClickDeleteSchedule(location.state?.schdulId);
|
||||
}}>삭제</button>
|
||||
</div>
|
||||
}
|
||||
<div className="board_btn_area">
|
||||
<div className="left_col btn1">
|
||||
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY}}
|
||||
state={{
|
||||
schdulId: location.state?.schdulId
|
||||
}}
|
||||
className="btn btn_skyblue_h46 w_100">수정</Link>
|
||||
<button className="btn btn_skyblue_h46 w_100"
|
||||
onClick={(e) => {
|
||||
onClickDeleteSchedule(location.state?.schdulId);
|
||||
}}>삭제</button>
|
||||
</div>
|
||||
<div className="right_col btn1">
|
||||
<Link to={URL.ADMIN__COMMITTEE__SCHEDULES} className="btn btn_blue_h46 w_100">목록</Link>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function PopUp(props) {
|
|||
{listPopup.map((it)=>(
|
||||
<div className='list_item'>
|
||||
<div>{it.seq}</div>
|
||||
<div className="al"><Link to={URL.SUPPORT_QNA_DETAIL}>{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.useYn === 'Y' ? <Switch {...label} defaultChecked /> : <Switch {...label} />}</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -87,10 +87,39 @@ function PopupWriter(props) {
|
|||
default:
|
||||
navigate({pathname: URL.ERROR}, {state: {msg : ""}});
|
||||
}
|
||||
//retrieveDetail();
|
||||
retrieveDetail();
|
||||
}
|
||||
|
||||
|
||||
const retrieveDetail = () => {
|
||||
|
||||
if (modeInfo.mode === CODE.MODE_CREATE) {// 조회/등록이면 조회 안함
|
||||
return;
|
||||
}
|
||||
|
||||
const retrieveDetailURL = `/contents/api/popup-manage/${location.state?.popupId}`;
|
||||
const requestOptions = {
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
}
|
||||
}
|
||||
EgovNet.requestFetch(retrieveDetailURL,
|
||||
requestOptions,
|
||||
function (resp) {
|
||||
let rawDetail = resp.result;
|
||||
//기본값 설정
|
||||
setScheduleDetail({
|
||||
...popupDetail,
|
||||
...rawDetail,
|
||||
startDate: convertDate(rawDetail.schdulBgnde),
|
||||
endDate: convertDate(rawDetail.schdulEndde),
|
||||
});
|
||||
setText(rawDetail.contents);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const createPopup = () => {
|
||||
const formData = new FormData();
|
||||
|
|
@ -115,13 +144,13 @@ function PopupWriter(props) {
|
|||
}
|
||||
|
||||
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
||||
modeInfo.editURL = `${modeInfo.editURL}/${location.state?.schdulId}`;
|
||||
modeInfo.editURL = `${modeInfo.editURL}/${location.state?.popupId}`;
|
||||
}
|
||||
EgovNet.requestFetch(modeInfo.editURL,
|
||||
requestOptions,
|
||||
(resp) => {
|
||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||
navigate({ pathname: URL.ADMIN_SCHEDULE });
|
||||
navigate({ pathname: URL.ADMIN__CONTENTS__POP_UP });
|
||||
} else {
|
||||
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
|
||||
}
|
||||
|
|
@ -131,8 +160,8 @@ function PopupWriter(props) {
|
|||
|
||||
}
|
||||
|
||||
const onClickDeleteSchedule = (schdulId) => {
|
||||
const deleteBoardURL = `/schedule/${schdulId}`;
|
||||
const onClickDelete = (popupId) => {
|
||||
const deleteBoardURL = `/schedule/${popupId}`;
|
||||
|
||||
const requestOptions = {
|
||||
method: "DELETE",
|
||||
|
|
@ -157,6 +186,14 @@ function PopupWriter(props) {
|
|||
);
|
||||
}
|
||||
|
||||
const convertDate = (str) => {
|
||||
let year = str.substring(0, 4);
|
||||
let month = str.substring(4, 6);
|
||||
let date = str.substring(6, 8);
|
||||
let hour = str.substring(8, 10);
|
||||
let minute = str.substring(10, 12);
|
||||
return new Date(year, month - 1, date, hour, minute)
|
||||
}
|
||||
const getDateFourteenDigit = (date) => {
|
||||
return `${getYYYYMMDD(date).toString()}${makeTwoDigit(date.getHours())}${makeTwoDigit(date.getMinutes())}${makeTwoDigit(date.getSeconds())}`;
|
||||
}
|
||||
|
|
@ -281,7 +318,7 @@ function PopupWriter(props) {
|
|||
{modeInfo.mode === CODE.MODE_MODIFY &&
|
||||
<button className="btn btn_skyblue_h46 w_100"
|
||||
onClick={(e) => {
|
||||
onClickDeleteSchedule(location.state?.schdulId);
|
||||
onClickDelete(location.state?.popupId);
|
||||
}}>삭제</button>
|
||||
}
|
||||
</div>
|
||||
|
|
@ -91,8 +91,8 @@ import AdminStandardsInfoDisclosure from 'pages/admin/standards/InfoDisclosure';
|
|||
// 관리자 - 컨텐츠 관리
|
||||
import AdminContentsSurvey from 'pages/admin/contents/Survey'; // 관리자 - 컨텐츠 관리/설문 관리
|
||||
import AdminContentsPopUp from 'pages/admin/contents/PopUp'; // 관리자 - 컨텐츠 관리/팝업 관리
|
||||
import AdminContentsPopUpWriter from 'pages/admin/contents/PopUp/Writer'; // 관리자 - 컨텐츠 관리/팝업 관리/팝업 추가 또는 수정
|
||||
import AdminContentsStandardResearch from 'pages/admin/contents/StandardResearch'; // 관리자 - 컨텐츠 관리/건설기준연구 관리
|
||||
import AdminContentsPopUpWriter from 'pages/admin/contents/PopUp/PopupWriter'; // 관리자 - 컨텐츠 관리/팝업 관리/팝업 추가 또는 수정
|
||||
import AdminContentsStandardResearch from 'pages/admin/contents/StandardResearch'; // 관리자 - 컨텐츠 관리/건설기준연구 관리
|
||||
import AdminContentsTextMessages from 'pages/admin/contents/TextMessages'; // 관리자 - 컨텐츠 관리/문자 발송
|
||||
|
||||
// 관리자 - 위원회 관리
|
||||
|
|
@ -124,18 +124,22 @@ const RootRoutes = () => {
|
|||
console.group("jwtAuthentication");
|
||||
console.log("[Start] jwtAuthentication ------------------------------");
|
||||
|
||||
const jwtAuthURL = "/uat/esm/jwtAuthAPI.do";
|
||||
const jwtAuthURL = "/auth/token-check";
|
||||
let requestOptions = {
|
||||
method: "POST",
|
||||
};
|
||||
|
||||
EgovNet.requestFetch(jwtAuthURL, requestOptions, (resp) => {
|
||||
if (resp === false) {
|
||||
setMounted(false);
|
||||
} else {
|
||||
setMounted(true); // 이 값으로 true 일 때만 페이지를 렌더링이 되는 변수 사용.
|
||||
}
|
||||
});
|
||||
EgovNet.requestFetch(
|
||||
jwtAuthURL,
|
||||
requestOptions,
|
||||
(resp) => {
|
||||
if (resp === false) {
|
||||
setMounted(false);
|
||||
} else {
|
||||
setMounted(true); // 이 값으로 true 일 때만 페이지를 렌더링이 되는 변수 사용.
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
console.log("------------------------------jwtAuthentication [End]");
|
||||
console.groupEnd("jwtAuthentication");
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
);
|
||||
|
||||
// 유효성 검사 실시
|
||||
int isValid = tnCmtEventRepository.sp_is_valid_tn_cmt_event_id( updateScheduleVO.getEvtSeq() );
|
||||
int isValid = tnCmtEventRepository.spIsValidTnCmtEventId( updateScheduleVO.getEvtSeq() );
|
||||
|
||||
if( isValid == 0 ) {
|
||||
throw new Exception("대상이 존재하지 않습니다.");
|
||||
|
|
@ -253,7 +253,7 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
);
|
||||
|
||||
|
||||
int isValid = tnCmtEventRepository.sp_is_valid_tn_cmt_event_id( scheduleId.intValue() );
|
||||
int isValid = tnCmtEventRepository.spIsValidTnCmtEventId( scheduleId.intValue() );
|
||||
|
||||
if( isValid == 0 ) {
|
||||
throw new Exception("대상이 존재하지 않습니다.");
|
||||
|
|
@ -282,9 +282,6 @@ public class EgovIndvdlSchdulManageServiceImpl extends EgovAbstractServiceImpl i
|
|||
dto.put("schdulBgnde", tnCmtEvent.getEvtStartDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
|
||||
dto.put("schdulEndde", tnCmtEvent.getEvtEndDt().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시
|
||||
|
||||
// 문자열로 리턴하도록 수정해야 함.
|
||||
|
||||
|
||||
|
||||
resultVO.setResult(dto);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
|
|
|
|||
|
|
@ -120,6 +120,84 @@ public class PopUpApiController {
|
|||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "팝업 수정 API",
|
||||
description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 팝업을 수정하는 API",
|
||||
tags = {"PopUpApiController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
||||
@ApiResponse(responseCode = "900", description = "입력값 무결성 오류")
|
||||
})
|
||||
@PutMapping(value = "/contents/api/popup-manage/{popupId}")
|
||||
public ResultVO contentsApiPopUpManageUpdate(
|
||||
HttpServletRequest request,
|
||||
@AuthenticationPrincipal LoginVO loginVO,
|
||||
@PathVariable("popupId") Long popupId
|
||||
) throws Exception {
|
||||
|
||||
ResultVO resultVO = new ResultVO();
|
||||
|
||||
try {
|
||||
resultVO = popUpApiService.contentsApiPopUpManageUpdate(resultVO, request, loginVO, 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 = "조회 성공")
|
||||
})
|
||||
@GetMapping(value = "/contents/api/popup-manage/{popupId}")
|
||||
public ResultVO contentsApiPopUpManageRead(
|
||||
HttpServletRequest request,
|
||||
@AuthenticationPrincipal LoginVO loginVO,
|
||||
@PathVariable("popupId") Long popupId
|
||||
) throws Exception {
|
||||
|
||||
ResultVO resultVO = new ResultVO();
|
||||
|
||||
try {
|
||||
resultVO = popUpApiService.contentsApiPopUpManageRead(resultVO, request, loginVO, 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -11,4 +11,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
public interface PopUpApiService {
|
||||
public ResultVO contentsApiPopUpManageList(ResultVO resultVO, HttpServletRequest request, LoginVO user, Pageable pageable) 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 contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception;
|
||||
}
|
||||
|
|
@ -6,6 +6,10 @@ import com.dbnt.kcscbackend.admin.contents.popUp.model.FileVO;
|
|||
import com.dbnt.kcscbackend.admin.contents.popUp.repository.TnPopupMngRepositoryWithoutPopupContents;
|
||||
import com.dbnt.kcscbackend.admin.contents.popUp.service.PopUpApiService;
|
||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
|
||||
import com.dbnt.kcscbackend.commonCode.repository.TnPopupMngRepository;
|
||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
|
|
@ -112,19 +116,6 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
|
|||
//_atchFileId = fileMngService.insertFileInfs(_result); //파일이 생성되고나면 생성된 첨부파일 ID를 리턴한다.
|
||||
}
|
||||
|
||||
// 리턴받은 첨부파일ID를 셋팅한다..
|
||||
//createPopupVO.setAtchFileId(_atchFileId); // 첨부파일 ID
|
||||
|
||||
//아이디 설정
|
||||
//createPopupVO.setFrstRegisterId(loginVO.getUniqId());
|
||||
//createPopupVO.setLastUpdusrId(loginVO.getUniqId());
|
||||
|
||||
//createPopupVO.setSchdulDeptName("관리자부서");
|
||||
//createPopupVO.setSchdulDeptId("ORGNZT_0000000000000");
|
||||
//createPopupVO.setSchdulChargerName("관리자");
|
||||
//createPopupVO.setSchdulChargerId("USRCNFRM_00000000000");
|
||||
//egovIndvdlSchdulManageService.insertIndvdlSchdulManage(indvdlSchdulManageVO);
|
||||
|
||||
//call kcsc.sp_add_tn_popup_mng ('팝업제목','2023-08-17 10:00:00','2023-08-23 10:00:00',NULL,'이러저런 내용 ','kcsc_admin',NULL,NULL,NULL,NULL);
|
||||
Map<String, Object> response = tnPopupMngRepository.spAddTnPopupMng(
|
||||
createPopupVO.getTitle(),
|
||||
|
|
@ -151,5 +142,53 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultVO contentsApiPopUpManageRead(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
|
||||
|
||||
System.out.println(
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
request.getRequestURI() + " IN:" +
|
||||
"\n--------------------------------------------------------------\n" +
|
||||
"user.getEmail():" + "\n" +
|
||||
user.getEmail() + "\n" +
|
||||
"popupId:" + "\n" +
|
||||
popupId + "\n" +
|
||||
"\n--------------------------------------------------------------\n"
|
||||
);
|
||||
|
||||
|
||||
int isValid = tnPopupMngRepository.spIsValidTnCmtEventId( popupId.intValue() );
|
||||
|
||||
if( isValid == 0 ) {
|
||||
throw new Exception("대상이 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
TnPopupMng tnPopupMng = tnPopupMngRepository.findByPopupSeq(popupId);
|
||||
|
||||
|
||||
Map<String, Object> dto = new HashMap<String, Object>();
|
||||
dto.put("title", tnPopupMng.getPopupTitle()); // 팝업 제목
|
||||
dto.put("contents", tnPopupMng.getPopupContents()); // 팝업 내용
|
||||
dto.put("schdulBgnde", tnPopupMng.getPopupStartDate().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 시작 일시 - yyyyMMddHHmmss
|
||||
dto.put("schdulEndde", tnPopupMng.getPopupEndDate().plusHours(9).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); // 날짜/시간의 종료 일시 - yyyyMMddHHmmss
|
||||
|
||||
|
||||
resultVO.setResult(dto);
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVO contentsApiPopUpManageUpdate(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ import com.dbnt.kcscbackend.config.common.ResponseCode;
|
|||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||
import com.dbnt.kcscbackend.config.egov.EgovMessageSource;
|
||||
import com.dbnt.kcscbackend.config.jwt.EgovJwtTokenUtil;
|
||||
import com.dbnt.kcscbackend.config.jwt.redis.RefreshToken;
|
||||
import com.dbnt.kcscbackend.config.jwt.redis.RefreshTokenRepository;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
|
|
@ -60,15 +63,7 @@ public class EgovLoginApiController extends BaseController {
|
|||
private EgovLoginService loginService;
|
||||
|
||||
private final EgovJwtTokenUtil egovJwtTokenUtil;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name = "egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
/** JWT */
|
||||
@Autowired
|
||||
private EgovJwtTokenUtil jwtTokenUtil;
|
||||
|
||||
private final RefreshTokenRepository refreshTokenRepository;
|
||||
|
||||
@Operation(
|
||||
summary = "회원가입",
|
||||
|
|
@ -177,8 +172,17 @@ public class EgovLoginApiController extends BaseController {
|
|||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping("/loginSuccess")
|
||||
public HashMap<String, Object> loginSuccess(HttpServletRequest request, HttpServletResponse response){
|
||||
return new HashMap<>();
|
||||
@PostMapping("/token-check")
|
||||
public boolean tokenCheck(HttpServletRequest request, HttpServletResponse response, @AuthenticationPrincipal UserInfo loginVO){
|
||||
String clientToken = request.getHeader("Authorization");
|
||||
RefreshToken refreshToken = refreshTokenRepository.findById(egovJwtTokenUtil.getUserSeqFromToken(clientToken)).orElse(null);
|
||||
if (refreshToken != null){
|
||||
String serverToken = refreshToken.getRefreshToken();
|
||||
if(egovJwtTokenUtil.getUserSeFromToken(clientToken).equals(egovJwtTokenUtil.getUserSeFromToken(serverToken))){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -110,12 +110,8 @@ public interface TnCmtEventRepository extends JpaRepository<TnCmtEvent, TnCmtEve
|
|||
@Param("_error_message") String errorMessage
|
||||
);
|
||||
|
||||
|
||||
//@Procedure
|
||||
//Map<String, Object> sp_is_valid_tn_cmt_event_id( @Param("_evt_seq") Long evtSeq );
|
||||
|
||||
@Procedure
|
||||
int sp_is_valid_tn_cmt_event_id( Integer evtSeq );
|
||||
@Procedure("sp_is_valid_tn_cmt_event_id")
|
||||
int spIsValidTnCmtEventId( Integer evtSeq );
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.dbnt.kcscbackend.commonCode.repository;
|
||||
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
|
||||
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.jpa.repository.query.Procedure;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -43,5 +45,10 @@ public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, TnPopupM
|
|||
);
|
||||
|
||||
|
||||
@Procedure("sp_is_valid_tn_popup_mng_id")
|
||||
int spIsValidTnCmtEventId( Integer popupSeq );
|
||||
|
||||
TnPopupMng findByPopupSeq(Long popupSeq);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,10 @@ public class EgovJwtTokenUtil implements Serializable{
|
|||
|
||||
|
||||
//retrieve username from jwt token
|
||||
public String getUserSeqFromToken(String token) {
|
||||
Claims claims = getClaimFromToken(token);
|
||||
return claims.get("userSeq").toString();
|
||||
}
|
||||
public String getUserIdFromToken(String token) {
|
||||
Claims claims = getClaimFromToken(token);
|
||||
return claims.get("id").toString();
|
||||
|
|
@ -89,7 +93,8 @@ public class EgovJwtTokenUtil implements Serializable{
|
|||
// compaction of the JWT to a URL-safe string
|
||||
public String generateToken(UserInfo loginVO, String remoteAddr, Long sec) {
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("id", loginVO.getUserId() );
|
||||
claims.put("userSeq", loginVO.getUserSeq());
|
||||
claims.put("id", loginVO.getUserId());
|
||||
claims.put("remoteAddr", remoteAddr);
|
||||
claims.put("userSe", loginVO.getUserSe() );
|
||||
claims.put("type", "Authorization");
|
||||
|
|
|
|||
Loading…
Reference in New Issue