|
|
|
@ -2,6 +2,8 @@ package cokr.xit.fims;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
@ -9,6 +11,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.user.ManagedUser;
|
|
|
|
|
import cokr.xit.base.user.service.UserService;
|
|
|
|
|
import cokr.xit.fims.cmmn.dao.FactionMapper;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
import cokr.xit.foundation.web.AbstractController;
|
|
|
|
|
import cokr.xit.foundation.web.RequestHandlerReader;
|
|
|
|
@ -18,11 +23,51 @@ public class MainController extends AbstractController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private RequestMappingHandlerMapping requestHandlers;
|
|
|
|
|
|
|
|
|
|
@Resource(name="factionMapper")
|
|
|
|
|
FactionMapper factionMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name="userService")
|
|
|
|
|
private UserService userService;
|
|
|
|
|
|
|
|
|
|
@GetMapping(name="로그인", value="/login.do")
|
|
|
|
|
public String loginPage() {
|
|
|
|
|
return "login";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(name="회원가입 페이지", value="/error/signupPage.do")
|
|
|
|
|
public ModelAndView signupPage(String institute) {
|
|
|
|
|
ModelAndView mav = new ModelAndView("fims/user/user-info");
|
|
|
|
|
|
|
|
|
|
mav.addObject("allFactionList", factionMapper.selectAllFactionList());
|
|
|
|
|
|
|
|
|
|
DataObject params = new DataObject();
|
|
|
|
|
params.set("anonymous", "Y");
|
|
|
|
|
params.set("institute", institute);
|
|
|
|
|
List<DataObject> ableFactionList = factionMapper.selectAbleFactionList(params);
|
|
|
|
|
mav.addObject("ableFactionList", ableFactionList);
|
|
|
|
|
|
|
|
|
|
mav.addObject("userInfo", "{}");
|
|
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(name="회원가입", value="/error/signup.do")
|
|
|
|
|
public ModelAndView signup(ManagedUser user) {
|
|
|
|
|
ModelAndView mav = new ModelAndView("jsonView");
|
|
|
|
|
|
|
|
|
|
boolean saved = userService.create(user);
|
|
|
|
|
|
|
|
|
|
mav.addObject("saved",saved);
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(name="중복 확인", value="/error/duplicate.do")
|
|
|
|
|
public ModelAndView isDuplicate(String account, String institute) {
|
|
|
|
|
ManagedUser user = userService.getUser(account, institute);
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
|
.addObject("duplicate", user != null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(name="홈", value={"/", "/index.do"})
|
|
|
|
|
public ModelAndView mainPage() {
|
|
|
|
|
return new ModelAndView("index");
|
|
|
|
|