관리자 메뉴 벡엔드 확인 절차 추가.
parent
200ddd96b9
commit
150310ebf3
|
|
@ -20,19 +20,19 @@ function EgovLeftNavAdmin(props) {
|
||||||
|
|
||||||
let activeKey;
|
let activeKey;
|
||||||
if (activeFolder === "config") {
|
if (activeFolder === "config") {
|
||||||
activeKey = "0";
|
activeKey = 0;
|
||||||
} else if (activeFolder === "users") {
|
} else if (activeFolder === "users") {
|
||||||
activeKey = "1";
|
activeKey = 1;
|
||||||
} else if (activeFolder === "boards") {
|
} else if (activeFolder === "boards") {
|
||||||
activeKey = "2";
|
activeKey = 2;
|
||||||
} else if (activeFolder === "standards") {
|
} else if (activeFolder === "standards") {
|
||||||
activeKey = "3";
|
activeKey = 3;
|
||||||
} else if (activeFolder === "contents") {
|
} else if (activeFolder === "contents") {
|
||||||
activeKey = "4";
|
activeKey = 4;
|
||||||
} else if (activeFolder === "committee") {
|
} else if (activeFolder === "committee") {
|
||||||
activeKey = "5";
|
activeKey = 5;
|
||||||
} else if (activeFolder === "logs") {
|
} else if (activeFolder === "logs") {
|
||||||
activeKey = "6";
|
activeKey = 6;
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
// activeKey = "7";
|
// activeKey = "7";
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ function ProgressStatusEdit(props) {
|
||||||
|
|
||||||
const getList = (orgSearchCondition) => {
|
const getList = (orgSearchCondition) => {
|
||||||
|
|
||||||
EgovNet.requestFetch(`/admin/config/committee-code-management?paramCodeGroup=${orgSearchCondition.paramCodeGroup}¶mCodeLevel=${orgSearchCondition.paramCodeLevel}`,
|
EgovNet.requestFetch(`/admin/config/committee-code-mgt?paramCodeGroup=${orgSearchCondition.paramCodeGroup}¶mCodeLevel=${orgSearchCondition.paramCodeLevel}`,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
const myIndex = Number(String(orgSearchCondition.paramCodeLevel).replace('LV_','')) - 1;
|
const myIndex = Number(String(orgSearchCondition.paramCodeLevel).replace('LV_','')) - 1;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ function StandardCodeMgt(props) {
|
||||||
handleClose();
|
handleClose();
|
||||||
console.groupCollapsed("AdminPartnerSiteList.retrieveList()");
|
console.groupCollapsed("AdminPartnerSiteList.retrieveList()");
|
||||||
|
|
||||||
const retrieveListURL = '/admin/config/partner-site-list';
|
const retrieveListURL = '/admin/config/about-site-mgt/list';
|
||||||
|
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ function CommitteeCodeMgt(props) {
|
||||||
|
|
||||||
const getList = (searchCondition) => {
|
const getList = (searchCondition) => {
|
||||||
|
|
||||||
EgovNet.requestFetch(`/admin/config/committee-code-management?paramCodeGroup=${searchCondition.paramCodeGroup}¶mCodeLevel=${searchCondition.paramCodeLevel}`,
|
EgovNet.requestFetch(`/admin/config/committee-code-mgt?paramCodeGroup=${searchCondition.paramCodeGroup}¶mCodeLevel=${searchCondition.paramCodeLevel}`,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
if( searchCondition.paramCodeLevel === 'LV_01' ) {
|
if( searchCondition.paramCodeLevel === 'LV_01' ) {
|
||||||
|
|
@ -163,7 +163,7 @@ function CommitteeCodeMgt(props) {
|
||||||
|
|
||||||
|
|
||||||
const requestTask = () => {
|
const requestTask = () => {
|
||||||
EgovNet.requestFetch(`/admin/config/committee-code-management/${deleteItem.orgId}`,
|
EgovNet.requestFetch(`/admin/config/committee-code-mgt/${deleteItem.orgId}`,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
let forChangeObject = {...searchCondition, paramCodeGroup, paramCodeLevel};
|
let forChangeObject = {...searchCondition, paramCodeGroup, paramCodeLevel};
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ function CommitteeCodeRegistrationPopup(props) {
|
||||||
if( props.createOrModifyCondition.mode === CODE.MODE_MODIFY ) {
|
if( props.createOrModifyCondition.mode === CODE.MODE_MODIFY ) {
|
||||||
appendRequestURL = `/${props.createOrModifyCondition.target.orgId}`;
|
appendRequestURL = `/${props.createOrModifyCondition.target.orgId}`;
|
||||||
}
|
}
|
||||||
const requestURL = "/admin/config/committee-code-management" + appendRequestURL;
|
const requestURL = "/admin/config/committee-code-mgt" + appendRequestURL;
|
||||||
EgovNet.requestFetch(requestURL,
|
EgovNet.requestFetch(requestURL,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
function (resp) {
|
function (resp) {
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ function AboutSiteModal({props, reloadFunction}) {
|
||||||
formData.append('fileGrpId', props.fileGrpId);
|
formData.append('fileGrpId', props.fileGrpId);
|
||||||
}
|
}
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/partner-site-mgt',
|
'/admin/config/about-site-mgt',
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
body: formData
|
body: formData
|
||||||
|
|
@ -90,7 +90,7 @@ function AboutSiteModal({props, reloadFunction}) {
|
||||||
function deletePartnerSite(partnerSite){
|
function deletePartnerSite(partnerSite){
|
||||||
if(window.confirm("삭제하시겠습니까?")) {
|
if(window.confirm("삭제하시겠습니까?")) {
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/partner-site-mgt',
|
'/admin/config/about-site-mgt',
|
||||||
{
|
{
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ function ChildCodeDiv({}, ref){
|
||||||
setCodeItemRow([]);
|
setCodeItemRow([]);
|
||||||
setGrpCd(parentCd)
|
setGrpCd(parentCd)
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-item?grpCd='+parentCd,
|
'/admin/config/base-code-mgt/code-item?grpCd='+parentCd,
|
||||||
{
|
{
|
||||||
method: "GET"
|
method: "GET"
|
||||||
},
|
},
|
||||||
|
|
@ -54,7 +54,7 @@ function ChildCodeDiv({}, ref){
|
||||||
alert("코드와 코드명을 입력해주세요.")
|
alert("코드와 코드명을 입력해주세요.")
|
||||||
}else{
|
}else{
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-item',
|
'/admin/config/base-code-mgt/code-item',
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -99,7 +99,7 @@ function ChildCodeDiv({}, ref){
|
||||||
useYn: action==="modify"?'Y':'N'
|
useYn: action==="modify"?'Y':'N'
|
||||||
}
|
}
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-item',
|
'/admin/config/base-code-mgt/code-item',
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ function ParentCodeDiv({getCodeItem}){
|
||||||
|
|
||||||
const getCodeGrp = useCallback(()=>{
|
const getCodeGrp = useCallback(()=>{
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-grp',
|
'/admin/config/base-code-mgt/code-grp',
|
||||||
{
|
{
|
||||||
method: "GET"
|
method: "GET"
|
||||||
},
|
},
|
||||||
|
|
@ -62,7 +62,7 @@ function ParentCodeDiv({getCodeItem}){
|
||||||
alert("코드 그룹을 입력해주세요.")
|
alert("코드 그룹을 입력해주세요.")
|
||||||
}else{
|
}else{
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-grp',
|
'/admin/config/base-code-mgt/code-grp',
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -102,7 +102,7 @@ function ParentCodeDiv({getCodeItem}){
|
||||||
useYn: action==="modify"?'Y':'N'
|
useYn: action==="modify"?'Y':'N'
|
||||||
}
|
}
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/config/code-grp',
|
'/admin/config/base-code-mgt/code-grp',
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,23 @@
|
||||||
package com.dbnt.kcscbackend.admin.committee;
|
package com.dbnt.kcscbackend.admin.committee;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.committee.service.AdminCommitteeProgressStatusService;
|
import com.dbnt.kcscbackend.admin.committee.service.AdminCommitteeProgressStatusService;
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
import com.dbnt.kcscbackend.admin.config.service.ConfigService;
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TnPartnerSite;
|
|
||||||
import com.dbnt.kcscbackend.admin.config.model.CreateCommitteeCodeManagementVO;
|
|
||||||
import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO;
|
|
||||||
import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService;
|
|
||||||
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
|
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
|
||||||
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
||||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||||
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.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;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.validation.Errors;
|
|
||||||
import org.springframework.validation.FieldError;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -40,7 +25,7 @@ import java.util.Map;
|
||||||
@Tag(name="AdminCommitteeController", description = "사이트관리 위원회관리 메뉴 컨트롤러")
|
@Tag(name="AdminCommitteeController", description = "사이트관리 위원회관리 메뉴 컨트롤러")
|
||||||
public class AdminCommitteeController extends BaseController {
|
public class AdminCommitteeController extends BaseController {
|
||||||
|
|
||||||
private final AdminConfigService adminConfigService;
|
private final ConfigService configService;
|
||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
|
|
||||||
@Resource(name = "adminCommitteeProgressStatusService")
|
@Resource(name = "adminCommitteeProgressStatusService")
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO;
|
||||||
import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService;
|
import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService;
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
|
import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
|
||||||
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
|
||||||
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
|
import com.dbnt.kcscbackend.admin.config.service.ConfigService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
||||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||||
|
|
@ -47,7 +47,7 @@ import java.util.Map;
|
||||||
@Tag(name="AdminConfigController", description = "사이트관리 환결설정 메뉴 컨트롤러")
|
@Tag(name="AdminConfigController", description = "사이트관리 환결설정 메뉴 컨트롤러")
|
||||||
public class AdminConfigController extends BaseController {
|
public class AdminConfigController extends BaseController {
|
||||||
|
|
||||||
private final AdminConfigService adminConfigService;
|
private final ConfigService configService;
|
||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
private final FileService fileService;
|
private final FileService fileService;
|
||||||
|
|
||||||
|
|
@ -63,11 +63,11 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/code-grp")
|
@RequestMapping(method = RequestMethod.GET, value = "/base-code-mgt/code-grp")
|
||||||
public ResultVO getCodeGrp() throws Exception{
|
public ResultVO getCodeGrp() throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("codeGrpList", adminConfigService.selectCodeGrpList());
|
resultMap.put("codeGrpList", configService.selectCodeGrpList());
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +82,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.POST, value = "/base-code-mgt/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO addCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
|
public ResultVO addCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
if(user == null){
|
if(user == null){
|
||||||
|
|
@ -98,7 +98,7 @@ public class AdminConfigController extends BaseController {
|
||||||
codeGrp.setFrstCrtDt(LocalDateTime.now());
|
codeGrp.setFrstCrtDt(LocalDateTime.now());
|
||||||
codeGrp.setFrstCrtId(user.getId());
|
codeGrp.setFrstCrtId(user.getId());
|
||||||
codeGrp.setUseYn("Y");
|
codeGrp.setUseYn("Y");
|
||||||
String result = adminConfigService.addCodeGrp(codeGrp);
|
String result = configService.addCodeGrp(codeGrp);
|
||||||
if(result.equals("isSaved")){
|
if(result.equals("isSaved")){
|
||||||
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
||||||
resultVO.setResultMessage("중복되는 코드그룹이 있습니다.");
|
resultVO.setResultMessage("중복되는 코드그룹이 있습니다.");
|
||||||
|
|
@ -120,7 +120,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.PUT, value = "/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.PUT, value = "/base-code-mgt/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO modifyCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
|
public ResultVO modifyCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
if(user == null){
|
if(user == null){
|
||||||
|
|
@ -135,7 +135,7 @@ public class AdminConfigController extends BaseController {
|
||||||
}else{
|
}else{
|
||||||
codeGrp.setLastChgDt(LocalDateTime.now());
|
codeGrp.setLastChgDt(LocalDateTime.now());
|
||||||
codeGrp.setLastChgId(user.getId());
|
codeGrp.setLastChgId(user.getId());
|
||||||
String result = adminConfigService.modifyCodeGrp(codeGrp);
|
String result = configService.modifyCodeGrp(codeGrp);
|
||||||
if(result.equals("modified")){
|
if(result.equals("modified")){
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -155,11 +155,11 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/code-item")
|
@RequestMapping(method = RequestMethod.GET, value = "/base-code-mgt/code-item")
|
||||||
public ResultVO getCodeItem(String grpCd) throws Exception{
|
public ResultVO getCodeItem(String grpCd) throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("codeItemList", adminConfigService.selectCodeItemList(grpCd));
|
resultMap.put("codeItemList", configService.selectCodeItemList(grpCd));
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
@ -174,7 +174,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.POST, value = "/base-code-mgt/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO addCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
|
public ResultVO addCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
if(user == null){
|
if(user == null){
|
||||||
|
|
@ -190,7 +190,7 @@ public class AdminConfigController extends BaseController {
|
||||||
codeItem.setFrstCrtDt(LocalDateTime.now());
|
codeItem.setFrstCrtDt(LocalDateTime.now());
|
||||||
codeItem.setFrstCrtId(user.getId());
|
codeItem.setFrstCrtId(user.getId());
|
||||||
codeItem.setUseYn("Y");
|
codeItem.setUseYn("Y");
|
||||||
String result = adminConfigService.addCodeItem(codeItem);
|
String result = configService.addCodeItem(codeItem);
|
||||||
if(result.equals("isSaved")){
|
if(result.equals("isSaved")){
|
||||||
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
||||||
resultVO.setResultMessage("중복되는 코드가 있습니다.");
|
resultVO.setResultMessage("중복되는 코드가 있습니다.");
|
||||||
|
|
@ -212,7 +212,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.PUT, value = "/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.PUT, value = "/base-code-mgt/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO modifyCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
|
public ResultVO modifyCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
if(user == null){
|
if(user == null){
|
||||||
|
|
@ -227,7 +227,7 @@ public class AdminConfigController extends BaseController {
|
||||||
}else{
|
}else{
|
||||||
codeItem.setLastChgDt(LocalDateTime.now());
|
codeItem.setLastChgDt(LocalDateTime.now());
|
||||||
codeItem.setLastChgId(user.getId());
|
codeItem.setLastChgId(user.getId());
|
||||||
String result = adminConfigService.modifyCodeItem(codeItem);
|
String result = configService.modifyCodeItem(codeItem);
|
||||||
if(result.equals("modified")){
|
if(result.equals("modified")){
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -251,7 +251,7 @@ public class AdminConfigController extends BaseController {
|
||||||
public ResultVO getMenuMgt(){
|
public ResultVO getMenuMgt(){
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("menuList", adminConfigService.selectMenuList());
|
resultMap.put("menuList", configService.selectMenuList());
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
@ -284,7 +284,7 @@ public class AdminConfigController extends BaseController {
|
||||||
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
||||||
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
||||||
} else {
|
} else {
|
||||||
adminConfigService.saveMenu(menu, user.getId());
|
configService.saveMenu(menu, user.getId());
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -310,7 +310,7 @@ public class AdminConfigController extends BaseController {
|
||||||
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
||||||
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
||||||
} else {
|
} else {
|
||||||
String result = adminConfigService.deleteMenu(menu.getMenuId(), user.getId());
|
String result = configService.deleteMenu(menu.getMenuId(), user.getId());
|
||||||
if(result==null){
|
if(result==null){
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}else if(result.equals("notFind")){
|
}else if(result.equals("notFind")){
|
||||||
|
|
@ -335,7 +335,7 @@ public class AdminConfigController extends BaseController {
|
||||||
public ResultVO getMenuAuthMgt(){
|
public ResultVO getMenuAuthMgt(){
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("menuList", adminConfigService.selectMenuAuthList());
|
resultMap.put("menuList", configService.selectMenuAuthList());
|
||||||
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
|
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
|
|
@ -360,7 +360,7 @@ public class AdminConfigController extends BaseController {
|
||||||
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
|
||||||
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
|
||||||
} else {
|
} else {
|
||||||
adminConfigService.editMenuAuth(menu);
|
configService.editMenuAuth(menu);
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -377,7 +377,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/committee-code-management")
|
@GetMapping(value = "/committee-code-mgt")
|
||||||
public ResultVO getCommitteeCodeManagement(
|
public ResultVO getCommitteeCodeManagement(
|
||||||
@AuthenticationPrincipal LoginVO user,
|
@AuthenticationPrincipal LoginVO user,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
|
|
@ -424,7 +424,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/committee-code-management")
|
@PostMapping(value = "/committee-code-mgt")
|
||||||
public ResultVO createCommitteeCodeManagement(
|
public ResultVO createCommitteeCodeManagement(
|
||||||
@AuthenticationPrincipal LoginVO user,
|
@AuthenticationPrincipal LoginVO user,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
|
|
@ -464,7 +464,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@DeleteMapping(value = "/committee-code-management/{orgId}")
|
@DeleteMapping(value = "/committee-code-mgt/{orgId}")
|
||||||
public ResultVO deleteSchedule
|
public ResultVO deleteSchedule
|
||||||
(
|
(
|
||||||
@AuthenticationPrincipal LoginVO user,
|
@AuthenticationPrincipal LoginVO user,
|
||||||
|
|
@ -506,11 +506,11 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/partner-site-list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.GET, value = "/about-site-mgt/list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO getPartnerSiteList() throws Exception {
|
public ResultVO getPartnerSiteList() throws Exception {
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<TnPartnerSite> tnPartnerSite = adminConfigService.selectPartnerSiteList();
|
List<TnPartnerSite> tnPartnerSite = configService.selectPartnerSiteList();
|
||||||
for (TnPartnerSite partnerSite : tnPartnerSite) {
|
for (TnPartnerSite partnerSite : tnPartnerSite) {
|
||||||
String fileGrpId = partnerSite.getFileGrpId();
|
String fileGrpId = partnerSite.getFileGrpId();
|
||||||
String filePath = fileService.findByFileGrpId(fileGrpId).get(0).getFilePath();
|
String filePath = fileService.findByFileGrpId(fileGrpId).get(0).getFilePath();
|
||||||
|
|
@ -598,7 +598,7 @@ public class AdminConfigController extends BaseController {
|
||||||
} else {
|
} else {
|
||||||
System.out.println("@@@ bbs.getBbsSeq() : " + tnPartnerSite.getSiteSeq());
|
System.out.println("@@@ bbs.getBbsSeq() : " + tnPartnerSite.getSiteSeq());
|
||||||
System.out.println("@@@ file : " + file);
|
System.out.println("@@@ file : " + file);
|
||||||
adminConfigService.savePartnerSite(tnPartnerSite, request, user, file);
|
configService.savePartnerSite(tnPartnerSite, request, user, file);
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -620,7 +620,7 @@ public class AdminConfigController extends BaseController {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
||||||
} else {
|
} else {
|
||||||
String result = adminConfigService.deletePartnerSite(tnPartnerSite, user.getId());
|
String result = configService.deletePartnerSite(tnPartnerSite, user.getId());
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
} else if (result.equals("notFind")) {
|
} else if (result.equals("notFind")) {
|
||||||
|
|
@ -640,7 +640,7 @@ public class AdminConfigController extends BaseController {
|
||||||
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
@ApiResponse(responseCode = "200", description = "등록 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
|
||||||
})
|
})
|
||||||
@PutMapping(value = "/committee-code-management/{orgId}")
|
@PutMapping(value = "/committee-code-mgt/{orgId}")
|
||||||
public ResultVO setCommitteeCodeManagement(
|
public ResultVO setCommitteeCodeManagement(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
@AuthenticationPrincipal LoginVO loginVO,
|
@AuthenticationPrincipal LoginVO loginVO,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.dbnt.kcscbackend.admin.config.service;
|
package com.dbnt.kcscbackend.admin.config.service;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.boards.entity.TnBbs;
|
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TbMenuRole;
|
import com.dbnt.kcscbackend.admin.config.entity.TbMenuRole;
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TnPartnerSite;
|
import com.dbnt.kcscbackend.admin.config.entity.TnPartnerSite;
|
||||||
|
|
@ -31,7 +30,7 @@ import java.util.Optional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AdminConfigService extends EgovAbstractServiceImpl {
|
public class ConfigService extends EgovAbstractServiceImpl {
|
||||||
|
|
||||||
private final TcCodeGrpRepository codeGrpRepository;
|
private final TcCodeGrpRepository codeGrpRepository;
|
||||||
private final TcCodeItemRepository codeItemRepository;
|
private final TcCodeItemRepository codeItemRepository;
|
||||||
|
|
@ -2,8 +2,8 @@ package com.dbnt.kcscbackend.admin.leftNav;
|
||||||
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||||
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
|
import com.dbnt.kcscbackend.admin.config.service.ConfigService;
|
||||||
import com.dbnt.kcscbackend.admin.users.service.AdminUsersService;
|
import com.dbnt.kcscbackend.admin.users.service.UsersService;
|
||||||
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.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
@ -22,8 +22,8 @@ import java.util.*;
|
||||||
@Tag(name="LeftNavController", description = "leftNav 컨트롤러")
|
@Tag(name="LeftNavController", description = "leftNav 컨트롤러")
|
||||||
public class LeftNavController {
|
public class LeftNavController {
|
||||||
|
|
||||||
private final AdminConfigService adminConfigService;
|
private final ConfigService configService;
|
||||||
private final AdminUsersService adminUsersService;
|
private final UsersService usersService;
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/menu")
|
@RequestMapping(method = RequestMethod.GET, value = "/menu")
|
||||||
public ResultVO getMenu(
|
public ResultVO getMenu(
|
||||||
|
|
@ -31,8 +31,8 @@ public class LeftNavController {
|
||||||
@RequestParam(value="menuType", required = true) String menuTypeCd
|
@RequestParam(value="menuType", required = true) String menuTypeCd
|
||||||
){
|
){
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
String userRole = adminUsersService.selectUserInfo(user.getUserSeq()).getUserRole();
|
String userRole = usersService.selectUserInfo(user.getUserSeq()).getUserRole();
|
||||||
List<TcMenu> menuList = adminConfigService.selectMenuListToRole(menuTypeCd, userRole);
|
List<TcMenu> menuList = configService.selectMenuListToRole(menuTypeCd, userRole);
|
||||||
Map<String, String> groupMap = new LinkedHashMap<>();
|
Map<String, String> groupMap = new LinkedHashMap<>();
|
||||||
for(TcMenu menu: menuList){
|
for(TcMenu menu: menuList){
|
||||||
groupMap.put(menu.getMenuGroup(), menu.getGroupTitle());
|
groupMap.put(menu.getMenuGroup(), menu.getGroupTitle());
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.dbnt.kcscbackend.admin.users;
|
||||||
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.logs.service.AdminLogsService;
|
import com.dbnt.kcscbackend.admin.logs.service.AdminLogsService;
|
||||||
import com.dbnt.kcscbackend.admin.users.service.AdminUsersService;
|
import com.dbnt.kcscbackend.admin.users.service.UsersService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
||||||
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
|
||||||
|
|
@ -35,7 +35,7 @@ import java.util.Map;
|
||||||
@Tag(name="AdminConfigController", description = "사이트관리 사용자관리 메뉴 컨트롤러")
|
@Tag(name="AdminConfigController", description = "사이트관리 사용자관리 메뉴 컨트롤러")
|
||||||
public class AdminUsersController extends BaseController {
|
public class AdminUsersController extends BaseController {
|
||||||
|
|
||||||
private final AdminUsersService adminUsersService;
|
private final UsersService usersService;
|
||||||
private final AdminLogsService adminLogsService;
|
private final AdminLogsService adminLogsService;
|
||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
|
|
||||||
|
|
@ -55,8 +55,8 @@ public class AdminUsersController extends BaseController {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
params.setQueryInfo();
|
params.setQueryInfo();
|
||||||
resultMap.put("userSeOption", commonCodeService.selectCodeItemList("ACC_TYPE"));
|
resultMap.put("userSeOption", commonCodeService.selectCodeItemList("ACC_TYPE"));
|
||||||
resultMap.put("userList", adminUsersService.selectUserList(params));
|
resultMap.put("userList", usersService.selectUserList(params));
|
||||||
params.setContentCnt(adminUsersService.selectUserListCnt(params));
|
params.setContentCnt(usersService.selectUserListCnt(params));
|
||||||
params.setPaginationInfo();
|
params.setPaginationInfo();
|
||||||
resultMap.put("paginationInfo", params);
|
resultMap.put("paginationInfo", params);
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
|
|
@ -107,7 +107,7 @@ public class AdminUsersController extends BaseController {
|
||||||
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
||||||
resultVO.setResultMessage("비밀번호 확인이 잘못 입력되었습니다.");
|
resultVO.setResultMessage("비밀번호 확인이 잘못 입력되었습니다.");
|
||||||
}else {
|
}else {
|
||||||
Integer insertResult = adminUsersService.updateUserInfo(info, user.getId());
|
Integer insertResult = usersService.updateUserInfo(info, user.getId());
|
||||||
if(insertResult!=null){
|
if(insertResult!=null){
|
||||||
if(insertResult==-1){
|
if(insertResult==-1){
|
||||||
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
|
||||||
|
|
@ -140,7 +140,7 @@ public class AdminUsersController extends BaseController {
|
||||||
public ResultVO deleteUserInfo(@RequestBody UserInfo info, HttpServletRequest request, @AuthenticationPrincipal LoginVO user) throws Exception{
|
public ResultVO deleteUserInfo(@RequestBody UserInfo info, HttpServletRequest request, @AuthenticationPrincipal LoginVO user) throws Exception{
|
||||||
adminLogsService.insertPrivacyLog(user.getId(), ClientUtils.getRemoteIP(request), "PRV_DLT", info.getUserId());
|
adminLogsService.insertPrivacyLog(user.getId(), ClientUtils.getRemoteIP(request), "PRV_DLT", info.getUserId());
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
adminUsersService.deleteUserInfo(info.getUserSeq());
|
usersService.deleteUserInfo(info.getUserSeq());
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.dbnt.kcscbackend.admin.users.service;
|
package com.dbnt.kcscbackend.admin.users.service;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.logs.repository.PrivacyLogsRepository;
|
|
||||||
import com.dbnt.kcscbackend.admin.users.mapper.AdminUsersMapper;
|
import com.dbnt.kcscbackend.admin.users.mapper.AdminUsersMapper;
|
||||||
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
||||||
import com.dbnt.kcscbackend.auth.repository.UserInfoRepository;
|
import com.dbnt.kcscbackend.auth.repository.UserInfoRepository;
|
||||||
|
|
@ -14,7 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AdminUsersService extends EgovAbstractServiceImpl {
|
public class UsersService extends EgovAbstractServiceImpl {
|
||||||
|
|
||||||
private final UserInfoRepository userInfoRepository;
|
private final UserInfoRepository userInfoRepository;
|
||||||
private final AdminUsersMapper usersMapper;
|
private final AdminUsersMapper usersMapper;
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.dbnt.kcscbackend.auth;
|
package com.dbnt.kcscbackend.auth;
|
||||||
|
|
||||||
|
import com.dbnt.kcscbackend.admin.users.service.UsersService;
|
||||||
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
import com.dbnt.kcscbackend.auth.entity.UserInfo;
|
||||||
import com.dbnt.kcscbackend.auth.service.EgovLoginService;
|
import com.dbnt.kcscbackend.auth.service.EgovLoginService;
|
||||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||||
|
|
@ -64,6 +65,7 @@ public class EgovLoginApiController extends BaseController {
|
||||||
|
|
||||||
private final EgovJwtTokenUtil egovJwtTokenUtil;
|
private final EgovJwtTokenUtil egovJwtTokenUtil;
|
||||||
private final RefreshTokenRepository refreshTokenRepository;
|
private final RefreshTokenRepository refreshTokenRepository;
|
||||||
|
private final UsersService usersService;
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "회원가입",
|
summary = "회원가입",
|
||||||
|
|
@ -179,7 +181,8 @@ public class EgovLoginApiController extends BaseController {
|
||||||
if (refreshToken != null){
|
if (refreshToken != null){
|
||||||
String serverToken = refreshToken.getRefreshToken();
|
String serverToken = refreshToken.getRefreshToken();
|
||||||
if(egovJwtTokenUtil.getUserSeFromToken(clientToken).equals(egovJwtTokenUtil.getUserSeFromToken(serverToken))){
|
if(egovJwtTokenUtil.getUserSeFromToken(clientToken).equals(egovJwtTokenUtil.getUserSeFromToken(serverToken))){
|
||||||
return egovJwtTokenUtil.getUserIdFromToken(clientToken).equals("admin");
|
UserInfo user = usersService.selectUserInfo(Integer.parseInt(egovJwtTokenUtil.getUserSeqFromToken(clientToken)));
|
||||||
|
return user.getUserRole().equals("ROLE_001")||user.getUserRole().equals("ROLE_002")||user.getUserRole().equals("ROLE_003");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ public class EgovLoginServiceImpl extends EgovAbstractServiceImpl implements Ego
|
||||||
info.setEmail(loginVO.getEmail());
|
info.setEmail(loginVO.getEmail());
|
||||||
info.setPhoneNum(loginVO.getPhoneNum());
|
info.setPhoneNum(loginVO.getPhoneNum());
|
||||||
info.setUserSe("ACC_TP02");
|
info.setUserSe("ACC_TP02");
|
||||||
|
info.setUserRole("ROLE_005");
|
||||||
info.setStatus("USE_ST");
|
info.setStatus("USE_ST");
|
||||||
info.setFrstCrtDt(LocalDateTime.now());
|
info.setFrstCrtDt(LocalDateTime.now());
|
||||||
userInfoRepository.save(info);
|
userInfoRepository.save(info);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.dbnt.kcscbackend.config.common;
|
||||||
|
|
||||||
|
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||||
|
import com.dbnt.kcscbackend.admin.config.service.ConfigService;
|
||||||
|
import com.dbnt.kcscbackend.admin.users.service.UsersService;
|
||||||
|
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AuthCheckInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
|
private final UsersService usersService;
|
||||||
|
private final ConfigService configService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mav) throws Exception {
|
||||||
|
/*관리자 메뉴 접근시 권한 체크*/
|
||||||
|
String requestUri = request.getRequestURI();
|
||||||
|
String userRole = usersService.selectUserInfo(((LoginVO)((UsernamePasswordAuthenticationToken)request.getUserPrincipal()).getPrincipal()).getUserSeq()).getUserRole();
|
||||||
|
List<TcMenu> menuList = configService.selectMenuListToRole("MNU_0000", userRole);
|
||||||
|
boolean requestFlag = false;
|
||||||
|
for(TcMenu menu: menuList){
|
||||||
|
if(requestUri.contains(menu.getMenuUrl())){
|
||||||
|
requestFlag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!requestFlag){
|
||||||
|
response.sendRedirect("/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.dbnt.kcscbackend.config.security;
|
package com.dbnt.kcscbackend.config.security;
|
||||||
|
|
||||||
|
import com.dbnt.kcscbackend.config.common.AuthCheckInterceptor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -17,7 +20,19 @@ import java.util.List;
|
||||||
* 2023/07/13 crlee 최초 생성
|
* 2023/07/13 crlee 최초 생성
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class WebMvcConfig implements WebMvcConfigurer {
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
|
private final AuthCheckInterceptor authCheckInterceptor;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry){
|
||||||
|
/*관리자 메뉴 접근시 권한 체크*/
|
||||||
|
registry.addInterceptor(authCheckInterceptor)
|
||||||
|
.addPathPatterns("/admin/**")
|
||||||
|
.excludePathPatterns(
|
||||||
|
"/admin/dashboard/**"
|
||||||
|
);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
||||||
argumentResolvers.add(new CustomAuthenticationPrincipalResolver());
|
argumentResolvers.add(new CustomAuthenticationPrincipalResolver());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue