|
@@ -8,7 +8,7 @@ import com.lantone.common.dto.GetUserDTO;
|
|
|
import com.lantone.common.vo.AddUserVO;
|
|
|
import com.lantone.common.vo.LoginVO;
|
|
|
import com.lantone.common.vo.UpdateUserVO;
|
|
|
-import com.lantone.security.facade.UserAdminFacade;
|
|
|
+import com.lantone.security.facade.UserManagementFacade;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -27,22 +27,22 @@ import javax.validation.constraints.NotNull;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * @Description: 用户管理
|
|
|
- * @author: rengb
|
|
|
- * @time: 2021/1/5 18:27
|
|
|
+ * @Description: 用户管理API
|
|
|
+ * @author: songxl
|
|
|
+ * @time: 2021/7/20 12:39
|
|
|
*/
|
|
|
@RestController
|
|
|
-@Api(tags = "UserAdminController", description = "用户管理")
|
|
|
-@RequestMapping("/userAdmin")
|
|
|
-public class UserAdminController {
|
|
|
+@Api(value = "用户管理API", tags = { "用户管理API" })
|
|
|
+@RequestMapping("/userManage")
|
|
|
+public class UserManagementController {
|
|
|
|
|
|
@Autowired
|
|
|
- private UserAdminFacade userAdminFacade;
|
|
|
+ private UserManagementFacade userManagementFacade;
|
|
|
|
|
|
@ApiOperation(value = "登录以后返回token")
|
|
|
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
|
|
public CommonResult login(@Validated @RequestBody LoginVO loginVO) {
|
|
|
- return userAdminFacade.login(loginVO);
|
|
|
+ return userManagementFacade.login(loginVO);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "登出功能")
|
|
@@ -78,44 +78,46 @@ public class UserAdminController {
|
|
|
@PostMapping("/addUser")
|
|
|
@Transactional
|
|
|
public CommonResult<Boolean> addUser(@RequestBody @Valid AddUserVO addUserVO) {
|
|
|
- return CommonResult.success(userAdminFacade.addUser(addUserVO));
|
|
|
+ return CommonResult.success(userManagementFacade.addUser(addUserVO));
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "修改用户 [by:songxl]")
|
|
|
@PostMapping("/updateUser")
|
|
|
@Transactional
|
|
|
public CommonResult<Boolean> updateUser(@RequestBody @Valid UpdateUserVO updateUserVO) {
|
|
|
- return CommonResult.success(userAdminFacade.updateUser(updateUserVO));
|
|
|
+ return CommonResult.success(userManagementFacade.updateUser(updateUserVO));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除用户 [by:songxl]")
|
|
|
@PostMapping("/deleteUser")
|
|
|
@Transactional
|
|
|
public CommonResult<Boolean> deleteUser(@RequestParam @Valid @NotNull(message = "用户编号为空") Long userId) {
|
|
|
- return CommonResult.success(userAdminFacade.deleteUser(userId));
|
|
|
+ return CommonResult.success(userManagementFacade.deleteUser(userId));
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "禁用|启用用户 [by:songxl]")
|
|
|
@PostMapping("/disableUser")
|
|
|
@Transactional
|
|
|
- public CommonResult<Boolean> disableUser(@RequestParam @Valid @NotNull(message = "用户编号为空") Long userId,@RequestParam @Valid @NotBlank(message = "启用禁用status为空") String status) {
|
|
|
- return CommonResult.success(userAdminFacade.disableUser(userId,status));
|
|
|
+ public CommonResult<Boolean> disableUser(@RequestParam @Valid @NotNull(message = "用户编号为空") Long userId, @RequestParam @Valid @NotBlank(message = "启用禁用status为空") String status) {
|
|
|
+ return CommonResult.success(userManagementFacade.disableUser(userId, status));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查看用户 [by:songxl]")
|
|
|
@PostMapping("/getUserById")
|
|
|
- public CommonResult<GetUserDTO> getUserById(@RequestParam @Valid @NotNull(message = "用户编号为空") Long userId,Long local) {
|
|
|
- return CommonResult.success(userAdminFacade.getUserById(userId,local));
|
|
|
+ public CommonResult<GetUserDTO> getUserById(@RequestParam @Valid @NotNull(message = "用户编号为空") Long userId, Long local) {
|
|
|
+ return CommonResult.success(userManagementFacade.getUserById(userId, local));
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "获取登录用户的组织机构树 [by:songxl]")
|
|
|
@PostMapping("/getHospitalTree")
|
|
|
public CommonResult<List<GetHospitalTreeDTO>> getLoginUserHospitalTree() {
|
|
|
- return CommonResult.success(userAdminFacade.getLoginUserHospitalTree());
|
|
|
+ return CommonResult.success(userManagementFacade.getLoginUserHospitalTree());
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取当前用户所在组织的用户列表 [by:songxl]")
|
|
|
-// @PostMapping("/getUserPage")
|
|
|
-// public CommonResult<List<GetHospitalTreeDTO>> getUserPage(GetUserPageVO getUserPageVO) {
|
|
|
-// return CommonResult.success(userAdminFacade.getLoginUserHospitalTree());
|
|
|
-// }
|
|
|
+ // @ApiOperation(value = "获取当前用户所在组织的用户列表 [by:songxl]")
|
|
|
+ // @PostMapping("/getUserPage")
|
|
|
+ // public CommonResult<List<GetHospitalTreeDTO>> getUserPage(GetUserPageVO getUserPageVO) {
|
|
|
+ // return CommonResult.success(userAdminFacade.getLoginUserHospitalTree());
|
|
|
+ // }
|
|
|
}
|