use of com.bitcamp.mvc.model.Member in project bitcampSCOpen2017 by ryuyj.
the class MemberUpdateService method update.
@Transactional
public void update(UpdateRequest req) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectById(req.getId());
if (member == null) {
throw new MemberNotFoundException("회원 없음 : " + req.getId());
}
dao.updateMember(req.toMember());
}
use of com.bitcamp.mvc.model.Member in project bitcampSCOpen2017 by ryuyj.
the class MemberListXlsView method buildExcelDocument.
@SuppressWarnings("unchecked")
@Override
protected void buildExcelDocument(Map<String, Object> model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception {
HSSFSheet sheet = createFirstSheet(workbook);
createColumnLabel(sheet);
List<Member> memberList = (List<Member>) model.get("memberListXls");
int rowNum = 1;
for (Member member : memberList) {
createMemberListRow(sheet, member, rowNum++);
}
String fileName = "memberList.xls";
response.setContentType("Application/Msexcel");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\";");
}
use of com.bitcamp.mvc.model.Member in project bitcampSCOpen2017 by ryuyj.
the class MemberUpdateController method update.
@RequestMapping(value = "/member/update/{id}", method = RequestMethod.POST)
public String update(@PathVariable("id") Long memId, UpdateRequest updateRequest, RedirectAttributes redirectAttributes, HttpServletRequest request) throws Exception {
// 이메일 주소 얻기
Member member = memberFindByIdService.findById(memId);
// 업로드 폴더 시스템 물리적 경로 찾기
String uploadURI = "/uploadfile/memberphoto";
String dir = request.getSession().getServletContext().getRealPath(uploadURI);
// 업로드 파일의 물리적 저장
if (!updateRequest.getPhotofile().isEmpty()) {
updateRequest.getPhotofile().transferTo(new File(dir, member.getEmail()));
}
memberUpdateService.update(updateRequest);
redirectAttributes.addFlashAttribute("SUCCESS_MSG", memId + "번 회원 수정 성공");
return "redirect:/member/list";
}
use of com.bitcamp.mvc.model.Member in project bitcampSCOpen2017 by ryuyj.
the class MemberUpdateController method form.
@RequestMapping(value = "/member/update/{id}", method = RequestMethod.GET)
public String form(@PathVariable("id") Long memId, Model model) {
Member member = memberFindByIdService.findById(memId);
model.addAttribute("name", member.getName());
model.addAttribute("id", memId);
return "member/memberUpdateForm";
}
use of com.bitcamp.mvc.model.Member in project bitcampSCOpen2017 by ryuyj.
the class MemberRowMapper method mapRow.
@Override
public Member mapRow(ResultSet rs, int rowNum) throws SQLException {
Member member = new Member(rs.getString("EMAIL"), rs.getString("PASSWORD"), rs.getString("NAME"), rs.getTimestamp("REGDATE"), rs.getString("PHOTO"));
member.setId(rs.getLong("ID"));
return member;
}
Aggregations