12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package com.fdkankan.jp.xspace.controller;
- import com.fdkankan.jp.xspace.common.Result;
- import com.fdkankan.jp.xspace.dto.LoginDTO;
- import com.fdkankan.jp.xspace.service.IUserRoleService;
- import com.fdkankan.jp.xspace.service.IUserService;
- import org.springframework.beans.factory.annotation.Autowired;
- 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;
- /**
- * <p>
- * 用户信息表 前端控制器
- * </p>
- *
- * @author
- * @since 2022-12-23
- */
- @RestController
- @RequestMapping("/user")
- public class UserController extends BaseController {
- @Autowired
- IUserService userService;
- @Autowired
- IUserRoleService userRoleService;
- /**
- * 登录
- * phoneNum 用户名
- * password 密码
- */
- @PostMapping("/login")
- public Result login(@RequestBody LoginDTO param){
- return Result.success(userService.login(param));
- }
- @PostMapping("/logout")
- public Result logout() {
- userService.logout(getToken());
- return Result.success();
- }
- // /**
- // * 获取用户信息
- // */
- // @RequestMapping(value = "/getUserInfo", method = RequestMethod.POST)
- // public Result getUserInfo() {
- // String username = JwtUtil.getUsername(getToken());
- // return Result.success(userService.getUserInfo(username));
- // }
- //
- // /**
- // * 查询用户列表
- // */
- // @PostMapping("/list")
- // public Result list(@RequestBody UserListParam param){
- // return Result.success(userService.pageList(param,getUser()));
- // }
- //
- // @PostMapping("/updatePassword")
- // public Result updatePassword(@RequestBody UserParam param){
- // userService.updatePassword(param);
- // return Result.success();
- // }
- //
- //
- // @PostMapping("/allUserList")
- // public Result allUserList(@RequestBody User param){
- //
- // List<User> retrunList = new ArrayList<>();
- // List<User> list = userService.allList(param);
- // List<Long> userIds = list.stream().map(User::getId).collect(Collectors.toList());
- // HashMap<Long ,Long> roleUserMap = userRoleService.getByUserList(userIds);
- // for (User user : list) {
- // Long roleId = roleUserMap.get(user.getId());
- // if(roleId != null && roleId!= 8){
- // retrunList.add(user);
- // }
- // }
- //
- // return Result.success(retrunList);
- // }
- }
|