비로그인자에 대한 내질문 클릭 시, 회원로그인 이동 처리를 위한 기능 분리 처리
This commit is contained in:
parent
4ae9ecd42d
commit
2dd87e431c
@ -56,7 +56,7 @@ public class QnaController extends NlibCommonController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 목록 화면을 표시한다.
|
* 전체 목록 화면을 표시한다.
|
||||||
*
|
*
|
||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
@ -74,6 +74,27 @@ public class QnaController extends NlibCommonController {
|
|||||||
return "nlib/bbs/listQnas";
|
return "nlib/bbs/listQnas";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 내질문 목록 화면을 표시한다. (권한 적용을 위해 분리함)
|
||||||
|
*
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Secured("ROLE_USER")
|
||||||
|
@RequestMapping("/bbs/listMyQnas.do")
|
||||||
|
public String listMyQnas(
|
||||||
|
HttpServletRequest req,
|
||||||
|
@RequestParam Map<String, String> paramMap,
|
||||||
|
ArticleVO searchArticleVO,
|
||||||
|
ModelMap model
|
||||||
|
) throws Exception {
|
||||||
|
|
||||||
|
searchArticleVO.setSearchQuestionType("USER");
|
||||||
|
model.addAttribute("searchArticle", searchArticleVO);
|
||||||
|
|
||||||
|
return "nlib/bbs/listQnas";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 목록 조회한다.
|
* 목록 조회한다.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//초기 자료 조회
|
//초기 자료 조회
|
||||||
fn_searchArticle();
|
fn_searchArticle(1);
|
||||||
|
|
||||||
// 메시지 표출
|
// 메시지 표출
|
||||||
if(!gfn_isEmpty('${message}')) {
|
if(!gfn_isEmpty('${message}')) {
|
||||||
@ -85,7 +85,7 @@
|
|||||||
if(gfn_isEmpty(pageIndex)) pageIndex = "1";
|
if(gfn_isEmpty(pageIndex)) pageIndex = "1";
|
||||||
$("#pageIndex").val(pageIndex);
|
$("#pageIndex").val(pageIndex);
|
||||||
|
|
||||||
var reqUrl = "${pageContext.request.contextPath}/bbs/listQnasAjax.do";;
|
var reqUrl = "${pageContext.request.contextPath}/bbs/listQnasAjax.do";
|
||||||
|
|
||||||
var inputData = {
|
var inputData = {
|
||||||
"pageIndex" : $("#pageIndex").val()
|
"pageIndex" : $("#pageIndex").val()
|
||||||
@ -105,15 +105,18 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: JSON.stringify(inputData),
|
data: JSON.stringify(inputData),
|
||||||
}).done(function(data){
|
}).done(function(data){
|
||||||
<%
|
|
||||||
// 그리드 데이터 예시 :
|
|
||||||
// (1) 페이징 클라이언트에서 수행하는 경우(pageloading = false) : [{ "articleNo": 1, "articleType": "01" }, { "articleNo": 2, "articleType": "02" }]
|
|
||||||
// (2) 페이징 서버에서 수행하는 경우(pageloading = true) : {data: [{...}], itemsCount: 255}
|
|
||||||
%>
|
|
||||||
|
|
||||||
var jsonObj = JSON.parse(data);
|
var jsonObj = JSON.parse(data);
|
||||||
//$("#itemsCount").val(jsonOjb.itemsCount);
|
|
||||||
console.log(jsonObj.itemsCount);
|
// 탭선택 처리
|
||||||
|
$("[id^=tabQna]").removeClass();
|
||||||
|
$("[id^=tabQna]").attr("title", "");
|
||||||
|
var selectedTab = "tabQnaAll";
|
||||||
|
if($("#searchQuestionType").val() == "USER") {
|
||||||
|
selectedTab = "tabQnaUser";
|
||||||
|
}
|
||||||
|
$("#" + selectedTab).addClass("current");
|
||||||
|
$("#" + selectedTab).attr("title", "선택됨");
|
||||||
|
|
||||||
|
|
||||||
// 건수
|
// 건수
|
||||||
if(typeof jsonObj.itemsCount == 'undefined') {
|
if(typeof jsonObj.itemsCount == 'undefined') {
|
||||||
@ -174,19 +177,21 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fn_changeQuestionType(searchQuestionType) {
|
function fn_changeTabAllQuestion() {
|
||||||
|
|
||||||
|
$("#searchQuestionType").val("");
|
||||||
|
$("#searchKeyword").val("");
|
||||||
|
fn_searchArticle(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_changeTabMyQuestion() {
|
||||||
|
|
||||||
<sec:authorize access="not isAuthenticated()">
|
<sec:authorize access="not isAuthenticated()">
|
||||||
if(!gfn_isEmpty(searchQuestionType)) {
|
location.href = "/bbs/listMyQnas.do";
|
||||||
alert("로그인 후, 이용하여 주시기 바랍니다.");
|
|
||||||
$("#tabQnaUser").removeClass("current");
|
|
||||||
$("#tabQnaAll").addClass("current");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
|
|
||||||
<sec:authorize access="isAuthenticated()">
|
<sec:authorize access="isAuthenticated()">
|
||||||
$("#searchQuestionType").val(searchQuestionType);
|
$("#searchQuestionType").val("USER");
|
||||||
$("#searchKeyword").val("");
|
$("#searchKeyword").val("");
|
||||||
fn_searchArticle(1);
|
fn_searchArticle(1);
|
||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
@ -232,10 +237,8 @@
|
|||||||
<div class="list-box qna-box">
|
<div class="list-box qna-box">
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<ul class="tabs">
|
<ul class="tabs">
|
||||||
<li id="tabQnaAll"><a href="javascript:void(0);" onclick="fn_changeQuestionType('')">전체</a></li>
|
<li id="tabQnaAll"><a href="javascript:void(0);" onclick="fn_changeTabAllQuestion()">전체</a></li>
|
||||||
<sec:authorize access="isAuthenticated()">
|
<li id="tabQnaUser"><a href="javascript:void(0);" onclick="fn_changeTabMyQuestion()">내 질문</a></li>
|
||||||
<li id="tabQnaUser"><a href="javascript:void(0);" onclick="fn_changeQuestionType('USER')">내 질문</a></li>
|
|
||||||
</sec:authorize>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="list-search-wrap list-top">
|
<div class="list-search-wrap list-top">
|
||||||
@ -267,7 +270,7 @@
|
|||||||
<input type="hidden" name="pageSize" id="pageSize" value="${searchArticle.pageSize }" />
|
<input type="hidden" name="pageSize" id="pageSize" value="${searchArticle.pageSize }" />
|
||||||
<input type="hidden" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex }" />
|
<input type="hidden" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex }" />
|
||||||
<input type="hidden" name="articleId" id="articleId" title="게시글번호" value="" />
|
<input type="hidden" name="articleId" id="articleId" title="게시글번호" value="" />
|
||||||
<input type="hidden" name="searchQuestionType" id="searchQuestionType" value="" title="유형코드" />
|
<input type="hidden" name="searchQuestionType" id="searchQuestionType" value="${searchArticle.searchQuestionType }" title="유형코드" />
|
||||||
<input type="hidden" name="articleNo" id="articleNo" value="" title="선택글번호" />
|
<input type="hidden" name="articleNo" id="articleNo" value="" title="선택글번호" />
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user