ing
This commit is contained in:
parent
09f49f03d4
commit
702bb83b80
|
@ -16,6 +16,14 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface DomainMemberDAO extends JpaRepository<DomainMember, Long> {
|
||||
|
||||
@Query("SELECT dm from DomainMember dm where dm.member.id = (:id)")
|
||||
DomainMember findByMemberID(@Param("id") long id);
|
||||
|
||||
@Query("SELECT dm.domain from DomainMember dm where dm.member = (:member)")
|
||||
Domain findDomainByMember(@Param("member") Member member);
|
||||
|
||||
@Query("SELECT dm.member from DomainMember dm where dm.domain = (:domain)")
|
||||
List<Member> findAllMemberByDomain(@Param("domain") Domain domain);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.loafle.overflow.module.domain.service;
|
|||
import com.loafle.overflow.module.domain.dao.DomainMemberDAO;
|
||||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.module.domain.model.DomainMember;
|
||||
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;
|
||||
|
@ -18,10 +19,22 @@ public class DomainMemberService {
|
|||
@Autowired
|
||||
private DomainMemberDAO domainMemberDAO;
|
||||
|
||||
@Autowired
|
||||
private MemberDAO memberDAO;
|
||||
|
||||
public void regist(DomainMember domainMember) {
|
||||
this.domainMemberDAO.save(domainMember);
|
||||
}
|
||||
|
||||
public Domain readDomainByMemberID(long id) {
|
||||
Member member = this.memberDAO.findOne(id);
|
||||
return this.domainMemberDAO.findDomainByMember(member);
|
||||
}
|
||||
|
||||
public DomainMember readByMemberID(long id) {
|
||||
return this.domainMemberDAO.findByMemberID(id);
|
||||
}
|
||||
|
||||
public List<Member> readAllMemberByDomain(Domain domain) {
|
||||
return this.domainMemberDAO.findAllMemberByDomain(domain);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class MemberService {
|
|||
|
||||
private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
public Member signin(String signinId, String signinPw) {
|
||||
public DomainMember signin(String signinId, String signinPw) {
|
||||
Member m = this.memberDAO.findByEmail(signinId);
|
||||
|
||||
if ( null == m ) {
|
||||
|
@ -76,8 +76,10 @@ public class MemberService {
|
|||
m.setSigninFailCount(0);
|
||||
this.modify(m);
|
||||
|
||||
DomainMember dm = domainMemberService.readByMemberID(m.getId());
|
||||
|
||||
// Todo Signin History
|
||||
return m;
|
||||
return dm;
|
||||
}
|
||||
|
||||
public Member signup(Member member, String pw) throws UnsupportedEncodingException {
|
||||
|
|
Loading…
Reference in New Issue
Block a user