33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package com.dbnt.faisp.userInfo;
|
|
|
|
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.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@RequestMapping("/user")
|
|
public class UserInfoController {
|
|
|
|
private final UserInfoService userInfoService;
|
|
|
|
@PostMapping("/insertUserInfo")
|
|
public String insertUserInfo(UserInfo insertReqInfo) {
|
|
return userInfoService.insertUserInfo(insertReqInfo);
|
|
}
|
|
|
|
@GetMapping("/myInfo")
|
|
public ModelAndView myInfoPage(@AuthenticationPrincipal UserInfo loginUser){
|
|
ModelAndView mav = new ModelAndView("user/myInfo");
|
|
mav.addObject("userInfo", loginUser);
|
|
mav.addObject("dashboardConfig", userInfoService.getDashboardConfigList(loginUser.getUserSeq()));
|
|
return mav;
|
|
}
|
|
}
|