package com.qmth.boot.core.rateLimit.config;

import com.qmth.boot.core.rateLimit.service.RateLimitService;
import com.qmth.boot.core.rateLimit.service.impl.MemoryRateLimitService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("com.qmth.boot.core.rateLimit")
public class RateLimitAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(RateLimitService.class)
    public RateLimitService rateLimitService() {
        return new MemoryRateLimitService();
    }
}
