xiangpei
2024-06-03 36b5a2397a94f210d3f3a0723139aa5f2c638003
src/main/java/com/ycl/jxkg/service/impl/UserServiceImpl.java
@@ -1,10 +1,12 @@
package com.ycl.jxkg.service.impl;
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.domain.form.RegisterForm;
import com.ycl.jxkg.domain.other.KeyValue;
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;
@@ -150,6 +152,10 @@
        teacher.setStatus(UserStatusEnum.Enable.getCode());
        teacher.setDeleted(0);
        this.insertUser(teacher);
        // 发布注册事件,保存注册日志
        UserEventLog userEventLog = new UserEventLog(teacher.getId(), teacher.getUserName(), teacher.getRealName(), new Date());
        userEventLog.setContent("欢迎 " + teacher.getUserName() + " 注册来到江西空管音视频培训系统");
        eventPublisher.publishEvent(new UserEvent(userEventLog));
    }
    @Override
@@ -163,5 +169,9 @@
        student.setStatus(UserStatusEnum.Enable.getCode());
        student.setDeleted(0);
        this.insertUser(student);
        // 发布注册事件,保存注册日志
        UserEventLog userEventLog = new UserEventLog(student.getId(), student.getUserName(), student.getRealName(), new Date());
        userEventLog.setContent("欢迎 " + student.getUserName() + " 注册来到江西空管音视频培训系统");
        eventPublisher.publishEvent(new UserEvent(userEventLog));
    }
}