Selaa lähdekoodia

返回用户信息

Reiskuchen 5 vuotta sitten
vanhempi
commit
853e3ed23d

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -50,6 +50,15 @@ public class UserController {
         return userService.loginEmployee(username, password);
     }
 
+    /**
+     * 根据id获取用户信息
+     * userId 用户id
+     */
+    @RequestMapping("/loginEmployee")
+    public HttpRespMsg getUserInfo(@RequestParam String userId) {
+        return userService.getUserInfo(userId);
+    }
+
     /**
      * 获取员工的列表
      */
@@ -60,6 +69,7 @@ public class UserController {
 
     /**
      * 删除用户
+     * userId 用户id
      */
     @RequestMapping("/deleteUser")
     public HttpRespMsg deleteUser(@RequestParam String userId) {

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java

@@ -20,6 +20,8 @@ public interface UserService extends IService<User> {
 
     HttpRespMsg loginEmployee(String username, String password);
 
+    HttpRespMsg getUserInfo(String id);
+
     HttpRespMsg getEmployeeList(HttpServletRequest request);
 
     HttpRespMsg deleteUser(String userId, HttpServletRequest request);

+ 8 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -85,6 +85,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return httpRespMsg;
     }
 
+    //获取用户信息
+    @Override
+    public HttpRespMsg getUserInfo(String id) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.data = userMapper.selectById(id);
+        return httpRespMsg;
+    }
+
     //获取员工的列表
     @Override
     public HttpRespMsg getEmployeeList(HttpServletRequest request) {