Browse Source

userInfo

userAuth
tags/24080901
Lierbao 2 years ago
parent
commit
cf88fa20a2
3 changed files with 33 additions and 7 deletions
  1. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
  2. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java
  3. +9
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java View File

@@ -1,5 +1,9 @@
package com.ningdatech.pmapi.user.manage;

import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.service.IUserAuthService;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
@@ -8,5 +12,13 @@ import org.springframework.stereotype.Component;
*/

@Component
@RequiredArgsConstructor
public class UserAuthLoginManage {

private final IUserAuthService iUserAuthService;
private final IUserInfoService iUserInfoService;

public UserFullInfoDTO queryUserInfoInPasswordAuth(String username){
return null;
}
}

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserFullInfoDTO.java View File

@@ -0,0 +1,12 @@
package com.ningdatech.pmapi.user.security.auth.model;

import lombok.Data;

/**
* @author liuxinxin
* @date 2023/1/4 下午5:07
*/

@Data
public class UserFullInfoDTO {
}

+ 9
- 7
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/PasswordLoginUserDetailService.java View File

@@ -2,12 +2,15 @@ package com.ningdatech.pmapi.user.security.auth.password;


import com.ningdatech.pmapi.user.manage.UserAuthLoginManage;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
* @author LiuXinXin
* @date 2022/9/30 上午9:49
@@ -21,11 +24,11 @@ public class PasswordLoginUserDetailService implements UserDetailsService {

@Override
public UserInfoDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// UserFullInfoDTO userFullInfoDTO = userAuthLoginFacade.queryUserInfoInPasswordAuth(username);
// if (Objects.isNull(userFullInfoDTO)) {
// throw new UsernameNotFoundException(String.format("%s user not exist", username));
// }
// UserInfoDetails userInfoDetails = new UserInfoDetails();
UserFullInfoDTO userFullInfoDTO = userAuthLoginManage.queryUserInfoInPasswordAuth(username);
if (Objects.isNull(userFullInfoDTO)) {
throw new UsernameNotFoundException(String.format("%s user not exist", username));
}
UserInfoDetails userInfoDetails = new UserInfoDetails();
// userInfoDetails.setUserId(userFullInfoDTO.getUserId());
// userInfoDetails.setUsername(userFullInfoDTO.getUsername());
// userInfoDetails.setRealName(userFullInfoDTO.getRealName());
@@ -35,7 +38,6 @@ public class PasswordLoginUserDetailService implements UserDetailsService {
// userInfoDetails.setResponsibleCompanyIdList(userFullInfoDTO.getResponsibleCompanyIdList());
// userInfoDetails.setIdentifier(userFullInfoDTO.getIdentifier());
// userInfoDetails.setPassword(userFullInfoDTO.getCredential());
// return userInfoDetails;
return null;
return userInfoDetails;
}
}

Loading…
Cancel
Save