package com.ensign.crm.module.system.event.publisher;

import com.ensign.crm.module.system.dal.dataobject.user.AdminUserDO;
import com.ensign.crm.module.system.event.UserRegisterEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @Description: TODO
 * @Date: 2024/10/15 16:10
 * @Created: by ZZSLL
 */


@Component
@Slf4j
public class UserRegisterEventPublisher {

    @Autowired
    public ApplicationEventPublisher publisher;

    public void publish(AdminUserDO user) {
        UserRegisterEvent userRegisterEvent = new UserRegisterEvent(this, user);
        publisher.publishEvent(userRegisterEvent);
        log.info("[UserRegisterEventPublisher] publish event");
    }
}
