토큰 일부 적용 url변경중
parent
dfea91edc8
commit
8e85e2d32d
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,114 @@
|
|||||||
|
package com.icomsys.main_vm.biz.common.login.controller;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.icomsys.main_vm.biz.advice.excep.CustomNoSuchFieldException;
|
||||||
|
import com.icomsys.main_vm.biz.advice.excep.CustomNotFoundException;
|
||||||
|
import com.icomsys.main_vm.biz.common.login.TokenProvider;
|
||||||
|
import com.icomsys.main_vm.biz.common.login.req.MainOprReq;
|
||||||
|
import com.icomsys.main_vm.biz.common.login.res.OprmngCodeRes;
|
||||||
|
import com.icomsys.main_vm.biz.common.login.res.UserVo;
|
||||||
|
import com.icomsys.main_vm.biz.common.login.service.LoginService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("/api/v1")
|
||||||
|
public class TokenController {
|
||||||
|
|
||||||
|
private final TokenProvider tokenProvider;
|
||||||
|
private final LoginService loginService;
|
||||||
|
private final HttpServletRequest httpServletRequest;
|
||||||
|
|
||||||
|
@GetMapping("/token/check")
|
||||||
|
public String checkToken(){
|
||||||
|
// return tokenProvider.parseClaims(
|
||||||
|
// httpServletRequest.getHeader("Authorization").split(" ")[1]);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/token/main/oprmng")
|
||||||
|
@ResponseBody
|
||||||
|
public ResponseEntity getMainOprmngCode() throws CustomNoSuchFieldException, NoSuchFieldException {
|
||||||
|
//List<OprmngCodeRes>
|
||||||
|
|
||||||
|
if (httpServletRequest.getSession() == null) {
|
||||||
|
log.info("SESSION NULL");
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
if (loginService.getUserVo() == null) {
|
||||||
|
log.info("getMainOprmngCode NULL");
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
log.info("getOPR INIT");
|
||||||
|
return ResponseEntity.ok(loginService.getMainOprmngCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/token/main/uv")
|
||||||
|
@ResponseBody
|
||||||
|
public UserVo getUserVo() throws CustomNoSuchFieldException {
|
||||||
|
if (loginService.getUserVo() == null) {
|
||||||
|
throw new CustomNoSuchFieldException();
|
||||||
|
} else {
|
||||||
|
return loginService.getUserVo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 멀티서치용 oprMngCode
|
||||||
|
* 내가가지고있는 서비스그룹을보여줌
|
||||||
|
*
|
||||||
|
* @param serviceType
|
||||||
|
* @return
|
||||||
|
* @throws CustomNoSuchFieldException
|
||||||
|
*/
|
||||||
|
@GetMapping("/token/menu/oprmng")
|
||||||
|
@ResponseBody
|
||||||
|
public List<OprmngCodeRes> getOprmngCode(@RequestParam(name = "serviceType", required = false) String serviceType,
|
||||||
|
@RequestParam(name = "menuval", required = false) String menuval) throws CustomNoSuchFieldException {
|
||||||
|
if (loginService.getUserVo() == null) {
|
||||||
|
throw new CustomNoSuchFieldException();
|
||||||
|
}
|
||||||
|
log.info("getOPR INIT");
|
||||||
|
return loginService.getOprmngCode(serviceType, menuval);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 어드민용 oprMngCode
|
||||||
|
* 서비스그룹생성용
|
||||||
|
* 해당서비스그룹의 코드를 보여줌
|
||||||
|
*
|
||||||
|
* @param serviceType
|
||||||
|
* @return
|
||||||
|
* @throws CustomNoSuchFieldException
|
||||||
|
*/
|
||||||
|
@GetMapping("/token/menu/oprmng/admin")
|
||||||
|
@ResponseBody
|
||||||
|
public List<OprmngCodeRes> getOprmngCodeAdmin(@RequestParam(name = "serviceType", required = false) String serviceType) throws CustomNoSuchFieldException {
|
||||||
|
if (loginService.getUserVo() == null) {
|
||||||
|
throw new CustomNoSuchFieldException();
|
||||||
|
}
|
||||||
|
log.info("getOPR INIT");
|
||||||
|
return loginService.getOprmngCodeAdmin(serviceType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/token/menu/main/oprmng/update")
|
||||||
|
@ResponseBody
|
||||||
|
public void getMainOprmngCodeUpdate(@RequestBody MainOprReq dto) throws CustomNoSuchFieldException, CustomNotFoundException {
|
||||||
|
if (loginService.getUserVo() == null) {
|
||||||
|
throw new CustomNoSuchFieldException();
|
||||||
|
}
|
||||||
|
log.info("getOPR INIT - {}", new Gson().toJson(dto));
|
||||||
|
loginService.getMainOprmngCodeUpdate(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,29 @@
|
|||||||
package com.icomsys.main_vm.biz.common.view;
|
package com.icomsys.main_vm.biz.common.view;
|
||||||
|
|
||||||
|
import com.icomsys.main_vm.biz.rcp.statistics.dashboard.service.StatisticsDashboardService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/view")
|
||||||
|
@Slf4j
|
||||||
public class RcpViewController {
|
public class RcpViewController {
|
||||||
|
|
||||||
|
|
||||||
|
private final StatisticsDashboardService statisticsDashboardService;
|
||||||
|
|
||||||
|
@GetMapping("/admin/common/dashboard/manage.do")
|
||||||
|
public ModelAndView DashboardView() {
|
||||||
|
// return "/adm/common/dashboard";
|
||||||
|
return new ModelAndView("/layout/adm/common/dashboard");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue