| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.jxkg.domain.enums.RoleEnum; |
| | | import com.ycl.jxkg.domain.enums.UserStatusEnum; |
| | | import com.ycl.jxkg.domain.form.RegisterForm; |
| | | import com.ycl.jxkg.domain.other.KeyValue; |
| | | import com.ycl.jxkg.exception.BusinessException; |
| | | import com.ycl.jxkg.domain.entity.User; |
| | | import com.ycl.jxkg.event.OnRegistrationCompleteEvent; |
| | | import com.ycl.jxkg.mapper.UserMapper; |
| | | import com.ycl.jxkg.service.AuthenticationService; |
| | | import com.ycl.jxkg.service.UserService; |
| | | import com.ycl.jxkg.domain.vo.admin.user.UserPageRequestVO; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | private final UserMapper userMapper; |
| | | private final ApplicationEventPublisher eventPublisher; |
| | | private final AuthenticationService authenticationService; |
| | | |
| | | |
| | | public List<User> getUsers() { |
| | |
| | | |
| | | public User getUserByUserName(String username) { |
| | | return userMapper.getUserByUserName(username); |
| | | } |
| | | |
| | | public int insertByFilter(User record) { |
| | | return baseMapper.insert(record); |
| | | } |
| | | |
| | | public int updateByIdFilter(User record) { |
| | | return baseMapper.updateById(record); |
| | | } |
| | | |
| | | @Override |
| | |
| | | User teacher = new User(); |
| | | BeanUtils.copyProperties(form, teacher); |
| | | teacher.setRole(RoleEnum.ADMIN.getCode()); |
| | | teacher.setPassword(authenticationService.pwdEncode(form.getPassword())); |
| | | teacher.setUserUuid(UUID.randomUUID().toString()); |
| | | teacher.setLastActiveTime(new Date()); |
| | | teacher.setStatus(UserStatusEnum.Enable.getCode()); |
| | | teacher.setDeleted(0); |
| | | this.insertUser(teacher); |
| | | } |
| | | |
| | | @Override |
| | | public void studentRegister(RegisterForm form) { |
| | | |
| | | User student = new User(); |
| | | BeanUtils.copyProperties(form, student); |
| | | student.setRole(RoleEnum.ADMIN.getCode()); |
| | | student.setPassword(authenticationService.pwdEncode(form.getPassword())); |
| | | student.setUserUuid(UUID.randomUUID().toString()); |
| | | student.setLastActiveTime(new Date()); |
| | | student.setStatus(UserStatusEnum.Enable.getCode()); |
| | | student.setDeleted(0); |
| | | this.insertUser(student); |
| | | } |
| | | } |