43 lines
1.4 KiB
Java
43 lines
1.4 KiB
Java
|
|
package com.dbnt.faisp.userInfo;
|
||
|
|
|
||
|
|
import com.dbnt.faisp.menuMgt.model.MenuMgt;
|
||
|
|
import com.dbnt.faisp.userInfo.model.DashboardConfig;
|
||
|
|
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||
|
|
import com.dbnt.faisp.userInfo.service.UserInfoService;
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
import org.springframework.web.servlet.ModelAndView;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@RestController
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RequestMapping("/myInfo")
|
||
|
|
public class MyInfoController {
|
||
|
|
|
||
|
|
private final UserInfoService userInfoService;
|
||
|
|
|
||
|
|
@GetMapping("/myInfoPage")
|
||
|
|
public ModelAndView myInfoPage(@AuthenticationPrincipal UserInfo loginUser){
|
||
|
|
ModelAndView mav = new ModelAndView("user/myInfo");
|
||
|
|
mav.addObject("userInfo", loginUser);
|
||
|
|
mav.addObject("dashboardConfigList", userInfoService.getDashboardConfigList(loginUser.getUserSeq()));
|
||
|
|
return mav;
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/getDashBoardConfig")
|
||
|
|
public List<DashboardConfig> getDashBoardConfig(@AuthenticationPrincipal UserInfo loginUser){
|
||
|
|
return userInfoService.getDashboardConfigList(loginUser.getUserSeq());
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/selectedMenuTable")
|
||
|
|
@ResponseBody
|
||
|
|
public ModelAndView dashboardConfigTable(@RequestBody List<DashboardConfig> selectMenuList){
|
||
|
|
ModelAndView mav = new ModelAndView("user/dashboardConfigTable");
|
||
|
|
mav.addObject("dashboardConfigList", selectMenuList);
|
||
|
|
return mav;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|