| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.enums.RoleLevelStatus; |
| | |
| | | private final AdminRoleRelationService adminRoleRelationService; |
| | | private final RoleService roleService; |
| | | private AdminMapper adminMapper; |
| | | private Snowflake snowflake; |
| | | |
| | | public Admin findByUserName(String username) { |
| | | return getOne(Wrappers.lambdaQuery(Admin.class).eq(Admin::getUsername, username).last("limit 1")); |
| | |
| | | throw new BusinessException("当前账号" + param.getUsername() + "已经存在"); |
| | | } |
| | | Admin save = new Admin(); |
| | | save.setId(snowflake.nextId()); |
| | | save.setUsername(param.getUsername()); |
| | | save.setPassword(passwordEncoder.encode(param.getPassword())); |
| | | save.setNickName(param.getNickName()); |