| | |
| | | import com.ycl.jxkg.domain.entity.MessageUser; |
| | | import com.ycl.jxkg.domain.entity.User; |
| | | 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.event.UserEvent; |
| | | import com.ycl.jxkg.service.AuthenticationService; |
| | | import com.ycl.jxkg.service.MessageService; |
| | |
| | | user.setCreateTime(new Date()); |
| | | userService.insertUser(user); |
| | | UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date()); |
| | | userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到学之思开源考试系统"); |
| | | userEventLog.setContent("欢迎 " + user.getUserName() + " 注册来到江西空管音视频培训系统"); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| | | public Result<UserResponseVO> update(@Valid UserUpdateVO model) { |
| | | if (StringUtils.isBlank(model.getBirthDay())) { |
| | | model.setBirthDay(null); |
| | | } |
| | | User user = userService.getById(getCurrentUser().getId()); |
| | | BeanUtils.copyProperties(model, user); |
| | | user.setModifyTime(new Date()); |