package com.yonge.cooleshow.auth;

import com.yonge.cooleshow.common.constant.AppConstant;
import com.yonge.toolset.base.BaseApplication;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;

import com.spring4all.swagger.EnableSwagger2Doc;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients("com.yonge.cooleshow")
@MapperScan("com.yonge.cooleshow.auth.dal.dao")
@ComponentScan(basePackages = {"com.yonge.cooleshow", "com.yonge.toolset", "com.yonge.cooleshow.auth.config"})
@Configuration
@EnableSwagger2Doc
@EnableAsync
public class AuthServerApplication {

    public static void main(String[] args) {
        BaseApplication.run(AppConstant.APPLICATION_AUTH, AuthServerApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
