
--- src/main/java/kr/co/takensoft/ai/system/auth/dao/AuthDAO.java
+++ src/main/java/kr/co/takensoft/ai/system/auth/dao/AuthDAO.java
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
public interface AuthDAO { |
19 | 19 |
|
20 | 20 |
/** |
21 |
- * @param member 사용자 정보 |
|
21 |
+ * @param memberVO 사용자 정보 |
|
22 | 22 |
* @return 등록 성공 여부 |
23 | 23 |
* |
24 | 24 |
* 사용자 회원 가입 |
... | ... | @@ -32,4 +32,20 @@ |
32 | 32 |
* 사용자 정보 개인 정보 조회 |
33 | 33 |
*/ |
34 | 34 |
MemberVO findMemberInfo(String memberId) throws Exception; |
35 |
+ |
|
36 |
+ /** |
|
37 |
+ * @param loginId 사용자 로그인 아이디 |
|
38 |
+ * @return 아이디 중복 여부 |
|
39 |
+ * |
|
40 |
+ * 사용자 정보 개인 정보 조회 |
|
41 |
+ */ |
|
42 |
+ int checkMemberId(String loginId) throws Exception; |
|
43 |
+ |
|
44 |
+ /** |
|
45 |
+ * @param email 사용자 아이디 |
|
46 |
+ * @return 이메일 중복 여부 |
|
47 |
+ * |
|
48 |
+ * 사용자 정보 개인 정보 조회 |
|
49 |
+ */ |
|
50 |
+ int checkMemberEmail(String email) throws Exception; |
|
35 | 51 |
} |
--- src/main/java/kr/co/takensoft/ai/system/auth/service/AuthService.java
+++ src/main/java/kr/co/takensoft/ai/system/auth/service/AuthService.java
... | ... | @@ -39,4 +39,19 @@ |
39 | 39 |
*/ |
40 | 40 |
MemberVO findMemberInfo(String memberId); |
41 | 41 |
|
42 |
+ /** |
|
43 |
+ * @param loginId 사용자 로그인 아이디 |
|
44 |
+ * @return 아이디 중복 여부 |
|
45 |
+ * |
|
46 |
+ * 사용자 정보 개인 정보 조회 |
|
47 |
+ */ |
|
48 |
+ int checkMemberId(String loginId) throws Exception; |
|
49 |
+ |
|
50 |
+ /** |
|
51 |
+ * @param email 사용자 아이디 |
|
52 |
+ * @return 이메일 중복 여부 |
|
53 |
+ * |
|
54 |
+ * 사용자 정보 개인 정보 조회 |
|
55 |
+ */ |
|
56 |
+ int checkMemberEmail(String email) throws Exception; |
|
42 | 57 |
} |
--- src/main/java/kr/co/takensoft/ai/system/auth/service/impl/AuthServiceImpl.java
+++ src/main/java/kr/co/takensoft/ai/system/auth/service/impl/AuthServiceImpl.java
... | ... | @@ -111,4 +111,24 @@ |
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
|
114 |
+ /** |
|
115 |
+ * @param loginId 사용자 로그인 아이디 |
|
116 |
+ * @return 아이디 중복 여부 |
|
117 |
+ * |
|
118 |
+ * 사용자 정보 개인 정보 조회 |
|
119 |
+ */ |
|
120 |
+ public int checkMemberId(String loginId) throws Exception{ |
|
121 |
+ return authDAO.checkMemberId(loginId); |
|
122 |
+ } |
|
123 |
+ |
|
124 |
+ /** |
|
125 |
+ * @param email 사용자 아이디 |
|
126 |
+ * @return 이메일 중복 여부 |
|
127 |
+ * |
|
128 |
+ * 사용자 정보 개인 정보 조회 |
|
129 |
+ */ |
|
130 |
+ public int checkMemberEmail(String email) throws Exception{ |
|
131 |
+ return authDAO.checkMemberEmail(Secret.encrypt(email)); |
|
132 |
+ } |
|
133 |
+ |
|
114 | 134 |
} |
--- src/main/java/kr/co/takensoft/ai/system/auth/web/AuthController.java
+++ src/main/java/kr/co/takensoft/ai/system/auth/web/AuthController.java
... | ... | @@ -12,10 +12,7 @@ |
12 | 12 |
import lombok.RequiredArgsConstructor; |
13 | 13 |
import org.springframework.http.HttpStatus; |
14 | 14 |
import org.springframework.http.ResponseEntity; |
15 |
-import org.springframework.web.bind.annotation.PostMapping; |
|
16 |
-import org.springframework.web.bind.annotation.RequestBody; |
|
17 |
-import org.springframework.web.bind.annotation.RequestMapping; |
|
18 |
-import org.springframework.web.bind.annotation.RestController; |
|
15 |
+import org.springframework.web.bind.annotation.*; |
|
19 | 16 |
|
20 | 17 |
import java.util.HashMap; |
21 | 18 |
import java.util.Map; |
... | ... | @@ -114,5 +111,31 @@ |
114 | 111 |
return new ResponseEntity<>(result, HttpStatus.INTERNAL_SERVER_ERROR); |
115 | 112 |
} |
116 | 113 |
} |
114 |
+ /** |
|
115 |
+ * @param params 사용자 로그인 아이디 |
|
116 |
+ * @return 아이디 중복 여부 |
|
117 |
+ * |
|
118 |
+ * 사용자 정보 개인 정보 조회 |
|
119 |
+ */ |
|
120 |
+ @PostMapping("/checkId.json") |
|
121 |
+ public ResponseEntity<?> checkMemberId(@RequestBody HashMap<String, Object> params) throws Exception{ |
|
122 |
+ String loginId = (String) params.get("loginId"); |
|
123 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
124 |
+ result.put("result", authService.checkMemberId(loginId)); |
|
125 |
+ return new ResponseEntity<>(result, HttpStatus.OK); |
|
126 |
+ } |
|
117 | 127 |
|
128 |
+ /** |
|
129 |
+ * @param params 사용자 아이디 |
|
130 |
+ * @return 이메일 중복 여부 |
|
131 |
+ * |
|
132 |
+ * 사용자 정보 개인 정보 조회 |
|
133 |
+ */ |
|
134 |
+ @PostMapping("/checkEmail.json") |
|
135 |
+ public ResponseEntity<?> checkMemberEmail(@RequestBody HashMap<String, Object> params) throws Exception{ |
|
136 |
+ String email = (String) params.get("email"); |
|
137 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
138 |
+ result.put("result", authService.checkMemberEmail(email)); |
|
139 |
+ return new ResponseEntity<>(result, HttpStatus.OK); |
|
140 |
+ } |
|
118 | 141 |
}(No newline at end of file) |
--- src/main/resources/mybatis/mapper/auth/auth-SQL.xml
+++ src/main/resources/mybatis/mapper/auth/auth-SQL.xml
... | ... | @@ -46,4 +46,28 @@ |
46 | 46 |
where login_id = #{loginId} |
47 | 47 |
</select> |
48 | 48 |
|
49 |
+ <!-- |
|
50 |
+ 작 성 자 : 박민혁 |
|
51 |
+ 작 성 일 : 2025.07.11 |
|
52 |
+ 내 용 : 아이디 중복 조회 |
|
53 |
+ --> |
|
54 |
+ <select id="checkMemberId" parameterType="String" resultType="int"> |
|
55 |
+ select |
|
56 |
+ count(*) |
|
57 |
+ from member |
|
58 |
+ where login_id = #{loginId} |
|
59 |
+ </select> |
|
60 |
+ |
|
61 |
+ <!-- |
|
62 |
+ 작 성 자 : 박민혁 |
|
63 |
+ 작 성 일 : 2025.07.11 |
|
64 |
+ 내 용 : 이메일 중복 조회 |
|
65 |
+ --> |
|
66 |
+ <select id="checkMemberEmail" parameterType="String" resultType="int"> |
|
67 |
+ select |
|
68 |
+ count(*) |
|
69 |
+ from member |
|
70 |
+ where email = #{email} |
|
71 |
+ </select> |
|
72 |
+ |
|
49 | 73 |
</mapper>(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?