diff --git a/src/main/java/com/loafle/overflow/module/member/service/MemberService.java b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java new file mode 100644 index 0000000..7e5551b --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/member/service/MemberService.java @@ -0,0 +1,59 @@ +package com.loafle.overflow.module.member.service; + +import com.loafle.overflow.module.member.dao.MemberDAO; +import com.loafle.overflow.module.member.model.Member; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Created by geek on 17. 6. 28. + */ +@Service +public class MemberService { + + @Autowired + private MemberDAO memberDAO; + + public Member signin(Member member) throws Exception { + Member m = this.memberDAO.findByEmail(member); + + if ( null == m ) { + return m; + } + + if ( m.getStatus().getId() == 1 ) { + throw new Exception("Email Auth Confirm Check"); + } + + // Todo member.pw m.pw compare + + return m; + } + + public Member signup(Member member) { + + + return this.memberDAO.save(member); + } + + public void signout(Member member) { + // Todo websocket session remove + } + + public Member modify(Member member) { + + return this.memberDAO.save(member); + } + + public Member read(long memberId) { + return this.memberDAO.findOne(memberId); + } + + public void withdrawal(Member member) { + // Todo DB delete? + } + + public void emailConfirm(Member member) { + + } +}