基础:
1. 异常测试
service如下:
@Slf4j
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
@Autowired
private SysUserMapper userMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private MyServiceImpl myService;
@Override
public SysUser login(String userName, String password) {
String hello = myService.hello();
System.out.println(hello);
LambdaQueryWrapper<SysUser> queryWrapper = Wrappers.lambdaQuery(SysUser.class);
queryWrapper.eq(SysUser::getUsername, userName);
queryWrapper.eq(SysUser::getPassword, password);
SysUser sysUser = baseMapper.selectOne(queryWrapper);
// SysUser sysUser = this.getOne(queryWrapper);
if (sysUser == null) {
throw new RuntimeException("用户名或密