package me.qwq.doghouse.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import me.qwq.doghouse.service.UserService;
import me.qwq.doghouse.service.CommentService;


// 每次启动后
@Component
@DependsOn("rk")
@Slf4j
public class DogfacePreparation {

    @Autowired
    CommentService commentService;
    
    @Autowired
    UserService userService;
    
    @PostConstruct
    void init() {
        Long regeneratedCount = commentService.reprepareDogHash() + userService.reprepareDogHash();
        log.info("重新生成 {} 个邮箱的 Doghash", regeneratedCount);
    }

}
