1. 备份代码

This commit is contained in:
黄昕 2024-03-11 14:46:47 +08:00
parent 00e6ddcd98
commit 5f00cf75b2
8 changed files with 18 additions and 28 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@ build/
.vscode/
/logs/
**/git.properties
**/logs/*.log

View File

@ -37,7 +37,7 @@ public class JwtUtils {
private JwtConfigure jwtConfigure;
@Resource
private UserDataBaseService userService;
private UserDataBaseService userDbService;
/**
* Gets head value.
@ -100,7 +100,7 @@ public class JwtUtils {
}
// 获取用户的权限等信息
User user = userService.getAccountUserByUid(uid);
User user = userDbService.getAccountUserByUid(uid);
if (user == null) {
throw new CommonAuthException(ErrorCode.ERR_TOKENNOTFOUND);

View File

@ -23,7 +23,7 @@ import org.springframework.stereotype.Service;
@Slf4j
public class AuthUsersCacheServiceImpl implements AuthUsersService {
@Resource
private UserDataBaseService userService;
private UserDataBaseService userDbService;
@Resource
private RoleMapper roleMapper;
@ -31,7 +31,7 @@ public class AuthUsersCacheServiceImpl implements AuthUsersService {
@Override
@Cacheable(value = "AUTH_CACHE", key = "'user'+#username", sync = true)
public AuthAccountUser getAuthAccountByUserName(String username) {
User user = userService.getAccountUserByName(username);
User user = userDbService.getAccountUserByName(username);
if (user == null) {
return null;

View File

@ -63,12 +63,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>${project.basedir}/config</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
@ -80,11 +74,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<dependenciesToScan>
<dependency>com.cf.cs:cs-base</dependency>
</dependenciesToScan>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -46,7 +46,7 @@ public class OperationLogDataBaseServiceImpl extends ServiceImpl<OperationLogMap
private ServerProperties serverProperties;
@Resource
private UserDataBaseService userService;
private UserDataBaseService userDbService;
@Resource
private OperationLogMapper operationLogMapper;
@ -153,8 +153,8 @@ public class OperationLogDataBaseServiceImpl extends ServiceImpl<OperationLogMap
if (HelperUtils.stringNotEmptyOrNull(username)) {
if (userName != null && !userName.isEmpty()) {
List<Long> idArray = userName.stream()
.filter(k -> userService.getAccountUserByName(k) != null)
.map(k -> userService.getAccountUserByName(k).getId())
.filter(k -> userDbService.getAccountUserByName(k) != null)
.map(k -> userDbService.getAccountUserByName(k).getId())
.toList();
wrapper = new QueryWrapper().select(OPERATION_LOG.ALL_COLUMNS)

View File

@ -34,7 +34,7 @@ import static com.cf.cs.database.pojo.entity.table.UserTableDef.USER;
* @author makejava @163.com
* @since 2023 -12-19 17:35:26
*/
@Service("userService")
@Service
@Slf4j
public class UserDataBaseServiceImpl extends ServiceImpl<UserMapper, User> implements UserDataBaseService {

View File

@ -49,7 +49,7 @@ public class PermissionManagerApi {
private UserPermissionService userPermissionService;
@Resource
private UserDataBaseService userService;
private UserDataBaseService userDbService;
@Resource
private AuthUsersService authUsersService;
@ -72,7 +72,7 @@ public class PermissionManagerApi {
return ProtocolResp.result(UserResPermInfoResp.builder()
.userId(au.getUid())
.username(au.getUsername())
.resPermission(userService.getCurrentUserResourcePerm())
.resPermission(userDbService.getCurrentUserResourcePerm())
.build());
}
@ -90,7 +90,7 @@ public class PermissionManagerApi {
List<String> validate = HelperUtils.validate(mr, ValidGroups.ProtocolCommonValid.class, ValidGroups.OperationLogReqValid.class);
// 如果校验通过validate为空否则validate包含未校验通过项
if (validate.isEmpty()) {
User user = userService.getAccountUserByUid(mr.getMsgContent().getUid());
User user = userDbService.getAccountUserByUid(mr.getMsgContent().getUid());
if (user == null) {
return ProtocolResp.result(ErrorCode.ERR_USERNOTFOUND);
@ -99,7 +99,7 @@ public class PermissionManagerApi {
return ProtocolResp.result(UserResPermInfoResp.builder()
.userId(user.getUid())
.username(user.getUsername())
.resPermission(userService.getUserResourcePerm(user.getId()))
.resPermission(userDbService.getUserResourcePerm(user.getId()))
.build());
} else {
return ProtocolResp.result(ErrorCode.ERR_PARAMEXCEPTION, ErrorCode.ERR_PARAMEXCEPTION.getHttpCode(),

View File

@ -30,7 +30,7 @@ import static com.cf.cs.database.pojo.entity.table.UserTableDef.USER;
@Slf4j
public class UserServiceImpl implements UserService {
@Resource
private UserDataBaseService userDataBaseService;
private UserDataBaseService userDbService;
@Resource
private RoleMapper roleMapper;
@ -51,7 +51,7 @@ public class UserServiceImpl implements UserService {
throw new CommonErrorCodeException(ErrorCode.ERR_USER_ROLE_NOTEXISTS);
}
User user = userDataBaseService.getAccountUserByName(username);
User user = userDbService.getAccountUserByName(username);
if (user != null) {
log.error("User {} is exists.", username);
@ -65,7 +65,7 @@ public class UserServiceImpl implements UserService {
throw new CommonErrorCodeException(ErrorCode.ERR_TOKENNOTFOUND);
}
User logUser = userDataBaseService.getAccountUserByName(loginUsername);
User logUser = userDbService.getAccountUserByName(loginUsername);
if (logUser == null) {
log.error("Login User({}) is not exists.", loginUsername);
@ -86,7 +86,7 @@ public class UserServiceImpl implements UserService {
throw new CommonErrorCodeException(ErrorCode.ERR_DATABASE);
}
newUser = userDataBaseService.getAccountUserByName(username);
newUser = userDbService.getAccountUserByName(username);
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
UserCredential uc = new UserCredential();
@ -105,7 +105,7 @@ public class UserServiceImpl implements UserService {
@Override
@Transactional(rollbackFor = Exception.class)
public void removeUser(String uid) {
User user = userDataBaseService.getAccountUserByUid(uid);
User user = userDbService.getAccountUserByUid(uid);
if (user == null) {
log.error("Login User({}) is not exists.", uid);