| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.jxkg.domain.entity.UserEventLog; |
| | | import com.ycl.jxkg.domain.enums.RoleEnum; |
| | | import com.ycl.jxkg.domain.enums.UserStatusEnum; |
| | | import com.ycl.jxkg.enums.RoleEnum; |
| | | import com.ycl.jxkg.enums.UserStatusEnum; |
| | | import com.ycl.jxkg.domain.form.RegisterForm; |
| | | import com.ycl.jxkg.domain.other.KeyValue; |
| | | import com.ycl.jxkg.domain.vo.StudentVO; |
| | | import com.ycl.jxkg.event.UserEvent; |
| | | 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; |
| | |
| | | |
| | | private final UserMapper userMapper; |
| | | private final ApplicationEventPublisher eventPublisher; |
| | | private final AuthenticationService authenticationService; |
| | | |
| | | |
| | | public List<User> getUsers() { |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | |
| | | userEventLog.setContent("欢迎 " + student.getUserName() + " 注册来到江西空管音视频培训系统"); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | } |
| | | |
| | | @Override |
| | | public List<StudentVO> classesStudent(Integer classesId) { |
| | | return userMapper.classesStudent(classesId); |
| | | } |
| | | } |