Application.java 1.03 KB
package com.viontech;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: zhuhai
 * Date: 2023-04-04
 * Time: 14:21
 */
@MapperScan("com.viontech.mapper")
@SpringBootApplication
@Configuration
public class Application {



    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }



    @Bean
    public RestTemplate restTemplate() {
        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
        factory.setConnectTimeout(60000);
        factory.setReadTimeout(20000);
        RestTemplate restTemplate = new RestTemplate(factory);
        return restTemplate;
    }


}