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 getDashBoardConfig(@AuthenticationPrincipal UserInfo loginUser){ return userInfoService.getDashboardConfigList(loginUser.getUserSeq()); } @PostMapping("/selectedMenuTable") @ResponseBody public ModelAndView dashboardConfigTable(@RequestBody List selectMenuList){ ModelAndView mav = new ModelAndView("user/dashboardConfigTable"); mav.addObject("dashboardConfigList", selectMenuList); return mav; } @PostMapping("saveDashboardConfig") @ResponseBody public void saveDashboardConfig(@AuthenticationPrincipal UserInfo loginUser, @RequestBody List configList){ userInfoService.saveDashboardConfigList(loginUser.getUserSeq(), configList); } }