package com.tzld.piaoquan.recommend.server;


import com.tzld.piaoquan.recommend.feature.client.FeatureV2Client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;


/**
 * https://github.com/grpc-swagger/grpc-swagger/blob/master/README_CN.md
 */
@SpringBootApplication(exclude = {
        RedisReactiveAutoConfiguration.class
})
@ComponentScan({
        "com.tzld.piaoquan.recommend.server.util",
        "com.tzld.piaoquan.recommend.server.config",
        "com.tzld.piaoquan.recommend.server.service",
        "com.tzld.piaoquan.recommend.server.grpcservice",
        "com.tzld.piaoquan.recommend.server.remote",
        "com.tzld.piaoquan.recommend.server.web",
        "com.tzld.piaoquan.recommend.server.xxl",
})
@EnableEurekaClient
@EnableAspectJAutoProxy
@EnableScheduling
@EnableFeignClients
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }


    @Bean
    public FeatureV2Client featureV2Client() {
        return new FeatureV2Client();
    }

    @Bean
    public ProtobufHttpMessageConverter protobufHttpMessageConverter() {
        return new ProtobufHttpMessageConverter();
    }


}

