|
@@ -4,25 +4,25 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.openApi.entity.system.User;
|
|
|
-import com.fdkankan.openApi.mapper.system.IUserMapper;
|
|
|
-import com.fdkankan.openApi.service.system.IUserService;
|
|
|
+import com.fdkankan.openApi.entity.system.Users;
|
|
|
+import com.fdkankan.openApi.mapper.system.IUsersMapper;
|
|
|
+import com.fdkankan.openApi.service.system.IUsersService;
|
|
|
import com.fdkankan.openApi.util.JwtUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@DS("system")
|
|
|
@Service
|
|
|
-public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements IUserService {
|
|
|
+public class UsersServiceImpl extends ServiceImpl<IUsersMapper, Users> implements IUsersService {
|
|
|
|
|
|
@Override
|
|
|
- public User findByUserName(String userName) {
|
|
|
- LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(User::getUserName, userName);
|
|
|
- User one = this.getOne(wrapper);
|
|
|
+ public Users findByUserName(String userName) {
|
|
|
+ LambdaQueryWrapper<Users> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(Users::getUserName, userName);
|
|
|
+ Users one = this.getOne(wrapper);
|
|
|
if (ObjectUtil.isNotNull(one)) {
|
|
|
return one;
|
|
|
} else {
|
|
|
- User u = new User();
|
|
|
+ Users u = new Users();
|
|
|
u.setUserName(userName);
|
|
|
boolean save = save(u);
|
|
|
return u;
|
|
@@ -30,10 +30,10 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public User findByUserName(String userName, Integer fdkkId, String head) {
|
|
|
- LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(User::getUserName, userName);
|
|
|
- User one = this.getOne(wrapper);
|
|
|
+ public Users findByUserName(String userName, Integer fdkkId, String head) {
|
|
|
+ LambdaQueryWrapper<Users> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(Users::getUserName, userName);
|
|
|
+ Users one = this.getOne(wrapper);
|
|
|
if (ObjectUtil.isNotNull(one)) {
|
|
|
if (ObjectUtil.isNull(one.getHead())) {
|
|
|
one.setHead(head);
|
|
@@ -41,7 +41,7 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
|
}
|
|
|
return one;
|
|
|
} else {
|
|
|
- User u = new User();
|
|
|
+ Users u = new Users();
|
|
|
u.setUserName(userName);
|
|
|
u.setId(fdkkId);
|
|
|
boolean save = save(u);
|
|
@@ -50,7 +50,7 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public User findByTokenCovUserName(String token) {
|
|
|
+ public Users findByTokenCovUserName(String token) {
|
|
|
String userName = JwtUtil.getUserName(token);
|
|
|
return findByUserName(userName);
|
|
|
}
|