use of com.bitcamp.mvc.dao.MemberDao2 in project bitcampSCOpen2017 by ryuyj.
the class MemberFindByEmailService method findByEmail.
@Transactional
public Member findByEmail(String email) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectByEmail(email);
if (member == null) {
throw new MemberNotFoundException("회원 없음 : " + email);
}
return member;
}
use of com.bitcamp.mvc.dao.MemberDao2 in project bitcampSCOpen2017 by ryuyj.
the class MemberDeleteService method delete.
@Transactional
public String delete(Long id) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectById(id);
if (member == null) {
throw new MemberNotFoundException("회원 없음 : " + id);
}
dao.deleteMember(id);
return member.getPhoto();
}
use of com.bitcamp.mvc.dao.MemberDao2 in project bitcampSCOpen2017 by ryuyj.
the class MemberFindByIdService method findById.
@Transactional
public Member findById(Long id) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectById(id);
if (member == null) {
throw new MemberNotFoundException("회원 없음 : " + id);
}
return member;
}
use of com.bitcamp.mvc.dao.MemberDao2 in project bitcampSCOpen2017 by ryuyj.
the class MemberLoginService method login.
@Transactional
public Member login(LoginRequest req) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectByEmail(req.getEmail());
if (member == null) {
throw new MemberNotFoundException("회원 없음 : " + req.getEmail());
}
if (!member.checkPassword(req.getPassword())) {
throw new IdPasswordNotMatchingException("비밀번호 다름");
}
return member;
}
use of com.bitcamp.mvc.dao.MemberDao2 in project bitcampSCOpen2017 by ryuyj.
the class MemberRegisterService method register.
@Transactional
public Member register(RegisterRequest req) {
dao = sqlSessionTemplate.getMapper(MemberDao2.class);
Member member = dao.selectByEmail(req.getEmail());
if (member != null) {
throw new AlreadyExistingMemberException("이메일 중복 : " + req.getEmail());
}
member = req.toMember();
dao.insertMember(member);
return member;
}
Aggregations