|
@@ -11,6 +11,7 @@ import com.fire.admin.util.SecurityUtil;
|
|
|
import com.fire.common.exception.BaseException;
|
|
|
import com.fire.dto.response.BaseRestResponse;
|
|
|
import com.fire.dto.system.SysUser;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -41,7 +42,7 @@ public class SysUserController {
|
|
|
@PostMapping
|
|
|
@PreAuthorize("hasAuthority('sys:user:add')")
|
|
|
public BaseRestResponse insert(@RequestBody UserDTO userDto) {
|
|
|
- return new BaseRestResponse(userService.insertUser(userDto));
|
|
|
+ return new BaseRestResponse(userService.insertUser(userDto));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -53,9 +54,9 @@ public class SysUserController {
|
|
|
* @date: 2020/8/31 15:49
|
|
|
*/
|
|
|
@GetMapping
|
|
|
- @PreAuthorize("hasAuthority('sys:user:view')")
|
|
|
+ @PreAuthorize("hasAuthority('sys:user:view')")
|
|
|
public BaseRestResponse getList(Page page, UserDTO userDTO) {
|
|
|
- return new BaseRestResponse(userService.getUsersWithRolePage(page, userDTO));
|
|
|
+ return new BaseRestResponse(userService.getUsersWithRolePage(page, userDTO));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -68,7 +69,7 @@ public class SysUserController {
|
|
|
@PutMapping
|
|
|
@PreAuthorize("hasAuthority('sys:user:update')")
|
|
|
public BaseRestResponse update(@RequestBody UserDTO userDto) {
|
|
|
- return new BaseRestResponse(userService.updateUser(userDto));
|
|
|
+ return new BaseRestResponse(userService.updateUser(userDto));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -81,7 +82,7 @@ public class SysUserController {
|
|
|
@DeleteMapping("/{userId}")
|
|
|
@PreAuthorize("hasAuthority('sys:user:delete')")
|
|
|
public BaseRestResponse delete(@PathVariable("userId") Long userId) {
|
|
|
- return new BaseRestResponse(userService.removeUser(userId));
|
|
|
+ return new BaseRestResponse(userService.removeUser(userId));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -95,7 +96,7 @@ public class SysUserController {
|
|
|
@PutMapping("/{userId}")
|
|
|
@PreAuthorize("hasAuthority('sys:user:rest')")
|
|
|
public BaseRestResponse restPass(@PathVariable("userId") Long userId) {
|
|
|
- return new BaseRestResponse(userService.restPass(userId));
|
|
|
+ return new BaseRestResponse(userService.restPass(userId));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -108,7 +109,7 @@ public class SysUserController {
|
|
|
*/
|
|
|
@GetMapping("/info")
|
|
|
public BaseRestResponse getUserInfo() {
|
|
|
- return new BaseRestResponse(userService.findByUserInfoName(SecurityUtil.getUser().getUsername()));
|
|
|
+ return new BaseRestResponse(userService.findByUserInfoName(SecurityUtil.getUser().getUsername()));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -134,7 +135,7 @@ public class SysUserController {
|
|
|
SysUser user = new SysUser();
|
|
|
user.setUserId(sysUser.getUserId());
|
|
|
user.setPassword(PreUtil.encode(newPass));
|
|
|
- return new BaseRestResponse(userService.updateUserInfo(user));
|
|
|
+ return new BaseRestResponse(userService.updateUserInfo(user));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -148,20 +149,21 @@ public class SysUserController {
|
|
|
@PostMapping("/vailUserName")
|
|
|
public BaseRestResponse vailUserName(@RequestParam String userName) {
|
|
|
SysUser sysUser = userService.findSecurityUserByUser(new SysUser().setUsername(userName));
|
|
|
- return new BaseRestResponse(ObjectUtil.isNull(sysUser));
|
|
|
+ return new BaseRestResponse(ObjectUtil.isNull(sysUser));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * @Description: TODO 获取用户属性为客户和中间人的所有用户
|
|
|
- * @Param:
|
|
|
- * @return:
|
|
|
- * @Author: liuliu
|
|
|
- * @Date: 2021/6/15 16:46
|
|
|
- */
|
|
|
- public BaseRestResponse getTypeAllUser(){
|
|
|
-
|
|
|
- return new BaseRestResponse();
|
|
|
+ * @Description: TODO 获取用户属性为客户和中间人的所有用户
|
|
|
+ * @Param:
|
|
|
+ * @return:
|
|
|
+ * @Author: liuliu
|
|
|
+ * @Date: 2021/6/15 16:46
|
|
|
+ */
|
|
|
+ @ApiOperation("获取中间人用户编号和客户登录用户,并把用户id 跟客户建立关系【客户跟用户一对一,中间人跟客户一对多;2:客户 3: 中间人】")
|
|
|
+ @GetMapping("/{type}")
|
|
|
+ public BaseRestResponse getTypeAllUser(@PathVariable("type") Integer type) {
|
|
|
+ return new BaseRestResponse(userService.queryUserByType(type));
|
|
|
}
|
|
|
|
|
|
}
|