|
@@ -1,17 +1,21 @@
|
|
|
package com.fdkankan.manage.controller;
|
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
+import com.fdkankan.manage.entity.SysRole;
|
|
|
+import com.fdkankan.manage.entity.SysUser;
|
|
|
+import com.fdkankan.manage.service.ISysRoleService;
|
|
|
import com.fdkankan.manage.service.ISysUserService;
|
|
|
import com.fdkankan.manage.vo.request.SysUserParam;
|
|
|
+import com.fdkankan.manage.vo.response.ManageLoginResponse;
|
|
|
+import com.fdkankan.manage.vo.response.SysUserVo;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* 系统用户
|
|
@@ -22,6 +26,21 @@ public class SysUserController extends BaseController{
|
|
|
|
|
|
@Autowired
|
|
|
ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ ISysRoleService sysRoleService;
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/getInfo")
|
|
|
+ public ResultData getInfo(){
|
|
|
+ String loginId = (String) StpUtil.getLoginId();
|
|
|
+ SysUser sysUser = sysUserService.getById(Long.valueOf(loginId));
|
|
|
+ SysUserVo userVo = new SysUserVo();
|
|
|
+ SysRole role = sysRoleService.getById(sysUser.getRoleId());
|
|
|
+ userVo.setRoleId(role.getId());
|
|
|
+ userVo.setRoleName(role.getRoleName());
|
|
|
+ BeanUtils.copyProperties(sysUser,userVo);
|
|
|
+ return ResultData.ok(userVo);
|
|
|
+ }
|
|
|
|
|
|
@PostMapping("/add")
|
|
|
public ResultData add(@RequestBody SysUserParam param){
|