mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 00:17:26 +09:00
운영관리 > 권한관리 하드코딩 제거
This commit is contained in:
@@ -451,4 +451,17 @@ public class SysMgtController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 13.
|
||||
* auth : Jeon
|
||||
* desc : 권한 관리 메뉴 권한 목록 조회
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "selectAuthMemuListForAddAuth", notes = "메뉴 권한 목록")
|
||||
@RequestMapping(value = "/selectAuthMemuListForAddAuth", method = {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public AuthMenuResDto selectAuthMemuListForAddAuth() {
|
||||
return sysService.selectAuthMemuListForAddAuth();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,5 +60,9 @@ public interface SysMgtMapper {
|
||||
public List<NotiList> notiListSelect(NotiListReqDto notiListReqDto);
|
||||
|
||||
int notiListSelectCnt(NotiListReqDto notiListReqDto);
|
||||
|
||||
List<AuthMenuUpper> selectAuthMemuUpperList(); //권한 추가를 위한 메뉴 조회
|
||||
|
||||
List<AuthMenu> selectAuthMemuChdList(AuthMenuUpper authMenuUpper); //권한 추가를 위한 메뉴 조회
|
||||
|
||||
}
|
||||
@@ -744,4 +744,37 @@ public class SysMgtService {
|
||||
return new SvcCheckListResDto(ApiResponseCode.SUCCESS,svcCheckListRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2023. 7. 13.
|
||||
* auth : Jeon
|
||||
* desc : 권한 관리 메뉴 권한 목록 조회
|
||||
* @return
|
||||
*/
|
||||
public AuthMenuResDto selectAuthMemuListForAddAuth() {
|
||||
SysMgtMapper sysMgtMapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||
|
||||
AuthMenuData authMenuData = new AuthMenuData();
|
||||
List<AuthMenuUpper> authMenuUpperList = new ArrayList<AuthMenuUpper>();
|
||||
|
||||
try {
|
||||
|
||||
authMenuUpperList = sysMgtMapper.selectAuthMemuUpperList();
|
||||
|
||||
if(authMenuUpperList.size() < 1) {
|
||||
return new AuthMenuResDto(ApiResponseCode.CM_NOT_FOUND);
|
||||
}
|
||||
|
||||
for(AuthMenuUpper authMenuUpper : authMenuUpperList) {
|
||||
authMenuUpper.setList(sysMgtMapper.selectAuthMemuChdList(authMenuUpper));
|
||||
}
|
||||
|
||||
authMenuData.setList(authMenuUpperList);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new AuthMenuResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||
}
|
||||
|
||||
return new AuthMenuResDto(ApiResponseCode.SUCCESS, authMenuData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import kr.co.uplus.ez.api.sysMgt.SysMgtMapper;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.utils.EncryptionUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class AuthMenuData implements Serializable {
|
||||
|
||||
private List<AuthMenuUpper> list;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.ResponseMessage;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class AuthMenuResDto extends ResponseMessage implements Serializable {
|
||||
|
||||
//데이터
|
||||
private AuthMenuData data;
|
||||
|
||||
public AuthMenuResDto() {
|
||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||
this.retMsg = ApiResponseCode.SUCCESS.getResultMsg();
|
||||
}
|
||||
|
||||
public AuthMenuResDto(ApiResponseCode returnStr) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
}
|
||||
|
||||
public AuthMenuResDto(ApiResponseCode returnStr, AuthMenuData data) {
|
||||
this.retCode = returnStr.getResultCode();
|
||||
this.retMsg = returnStr.getResultMsg();
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package kr.co.uplus.ez.api.sysMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import kr.co.uplus.ez.api.sysMgt.SysMgtMapper;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.utils.EncryptionUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
public class AuthMenuUpper implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "메뉴번호", name = "메뉴번호", dataType = "String")
|
||||
private String menuNo;
|
||||
@ApiModelProperty(example = "메뉴명", name = "메뉴명", dataType = "String")
|
||||
private String name;
|
||||
@ApiModelProperty(example = "메뉴순서", name = "메뉴순서", dataType = "String")
|
||||
private String menuOrder;
|
||||
@ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String")
|
||||
private String useYn;
|
||||
@ApiModelProperty(example = "메뉴레벨", name = "메뉴레벨", dataType = "String")
|
||||
private String menuLv;
|
||||
|
||||
private List<AuthMenu> list;
|
||||
}
|
||||
@@ -523,4 +523,31 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectAuthMemuUpperList" resultType="kr.co.uplus.ez.api.sysMgt.dto.AuthMenuUpper">
|
||||
/* sysMgt-mapper.xml(selectAuthMemuUpperList) */
|
||||
SELECT
|
||||
A.MENU_NM AS UPPER_NAME
|
||||
, A.MENU_NO
|
||||
, A.MENU_NM AS NAME
|
||||
, A.MENU_LVL AS MENU_LV
|
||||
FROM hubez_admin.EZ_ADM_MENU A
|
||||
WHERE A.MENU_LVL = 1
|
||||
AND A.USE_YN = 'Y'
|
||||
ORDER BY A.MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
<select id="selectAuthMemuChdList" parameterType="kr.co.uplus.ez.api.sysMgt.dto.AuthMenuUpper" resultType="kr.co.uplus.ez.api.sysMgt.dto.AuthMenu">
|
||||
/* sysMgt-mapper.xml(selectAuthMemuChdList) */
|
||||
SELECT
|
||||
A.MENU_NM AS UPPER_NAME
|
||||
, A.MENU_NO
|
||||
, A.MENU_NM AS NAME
|
||||
, A.MENU_LVL AS MENU_LV
|
||||
FROM hubez_admin.EZ_ADM_MENU A
|
||||
WHERE A.MENU_LVL = 2
|
||||
AND A.USE_YN = 'Y'
|
||||
AND A.PRNTS_MENU_NO = #{menuNo}
|
||||
ORDER BY A.MENU_ODRG ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user