소스 검색

FIX: email registration

guoyc 8 년 전
부모
커밋
20a6b7057c
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/logic/impl/AccountLogicImpl.java

+ 6 - 6
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/logic/impl/AccountLogicImpl.java

@@ -243,19 +243,19 @@ public class AccountLogicImpl implements AccountLogic {
         }
 
         if (accountVO.getUserType() == UserType.WORKER.getValue()) {
-            if (!EmailValidator.getInstance().isValid(accountVO.getManager().getEmail())) {
+            if (!EmailValidator.getInstance().isValid(accountVO.getWorker().getEmail())) {
                 throw new HttpBadRequestException("Invalid email");
             }
-            if (managerService.getManagerByEmail(accountVO.getManager().getEmail()) != null) {
-                throw new HttpBadRequestException("Manager already exists");
+            if (workerService.getWorkerByEmail(accountVO.getWorker().getEmail()) != null) {
+                throw new HttpBadRequestException("Worker already exists");
             }
             accountVO.getWorker().setMobile(null);
         } else if (accountVO.getUserType() == UserType.MANAGER.getValue()) {
-            if (!EmailValidator.getInstance().isValid(accountVO.getWorker().getEmail())) {
+            if (!EmailValidator.getInstance().isValid(accountVO.getManager().getEmail())) {
                 throw new HttpBadRequestException("Invalid email");
             }
-            if (workerService.getWorkerByEmail(accountVO.getWorker().getEmail()) != null) {
-                throw new HttpBadRequestException("Worker already exists");
+            if (managerService.getManagerByEmail(accountVO.getManager().getEmail()) != null) {
+                throw new HttpBadRequestException("Manager already exists");
             }
             accountVO.getManager().setMobile(null);
         } else {