Browse Source

Merge remote-tracking branch 'origin/dev/one' into dev/one

wangyu 6 năm trước cách đây
mục cha
commit
4ea5f8c785

+ 5 - 4
user-service/src/main/java/com/diagbot/facade/UserAuthenticationFacade.java

@@ -40,7 +40,7 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
      * @param userAuthenticationVO
      * @return
      */
-    public Map<Integer, Object> userAuthentication(UserAuthenticationVO userAuthenticationVO) {
+    public AuthStatusDTO userAuthentication(UserAuthenticationVO userAuthenticationVO) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         User user_old = userFacade.getById(userId);
         User user = userFacade.findByName(userAuthenticationVO.getUserName());
@@ -101,9 +101,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         userAuthentication.setStatus(AuthStatusEnum.Authorizing.getKey());  //状态设为认证中
         this.saveOrUpdate(userAuthentication);
 
-        Map<Integer, Object> map = new HashMap<>();
-        map.put(userAuthentication.getStatus(), AuthStatusEnum.Authorizing.getName());
-        return map;
+        AuthStatusDTO authStatusDTO = new AuthStatusDTO();
+        authStatusDTO.setAuthStatus(userAuthentication.getStatus());
+        authStatusDTO.setAuthStatusName(AuthStatusEnum.Authorizing.getName());
+        return authStatusDTO;
     }
 
     /**

+ 3 - 3
user-service/src/main/java/com/diagbot/web/UserAuthenticationController.java

@@ -50,9 +50,9 @@ public class UserAuthenticationController {
     @PostMapping("/userAuthentication")
     @SysLogger("userAuthentication")
     @Transactional
-    public RespDTO<Map<Integer, Object>> userAuthentication(@RequestBody @Valid UserAuthenticationVO userAuthenticationVO) {
-        Map<Integer, Object> map = userAuthenticationFacade.userAuthentication(userAuthenticationVO);
-        return RespDTO.onSuc(map);
+    public RespDTO<AuthStatusDTO> userAuthentication(@RequestBody @Valid UserAuthenticationVO userAuthenticationVO) {
+        AuthStatusDTO authStatusDTO = userAuthenticationFacade.userAuthentication(userAuthenticationVO);
+        return RespDTO.onSuc(authStatusDTO);
     }
 
     /**