浏览代码

优化接口1.2

wangfeng 6 年之前
父节点
当前提交
2bacf0119c

+ 17 - 0
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -47,6 +47,7 @@ import org.springframework.security.crypto.factory.PasswordEncoderFactories;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -651,4 +652,20 @@ public class UserFacade extends UserServiceImpl {
 
         return RespDTO.onSuc("绑定成功");
     }
+    /**
+     * 
+     * @param userId
+     * @return 删除用户信息和机构信息
+     */
+    public RespDTO updateDeleteds(String userId) {
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("userId", userId);
+        map.put("modifier", UserUtils.getCurrentPrincipleID());
+        map.put("gmtModified", DateUtil.now());
+        boolean res = updateDeleted(map);
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        return RespDTO.onSuc(res);
+    }
 }

+ 1 - 9
user-service/src/main/java/com/diagbot/web/UserInfoController.java

@@ -92,15 +92,7 @@ public class UserInfoController {
     @SysLogger("updateDeleted")
     @Transactional
     public RespDTO updateDeleted(@RequestParam String userId) {
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("userId", userId);
-        map.put("modifier", UserUtils.getCurrentPrincipleID());
-        map.put("gmtModified", DateUtil.now());
-        boolean res = userFacade.updateDeleted(map);
-        if (!res) {
-            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-        }
-        return RespDTO.onSuc(res);
+        return userFacade.updateDeleteds(userId);
     }
 
     @ApiOperation(value = "模糊查询机构信息[by:wangfeng]", notes = "机构信息")