package cn.ey.biz.module.weaver.autoconfigure;

import cn.ey.biz.module.weaver.common.AppIdConfig;
import cn.ey.biz.module.weaver.common.HrmGetter;
import cn.ey.biz.module.weaver.common.TextPlainJackson2HttpMessageConverter;
import cn.ey.biz.module.weaver.common.TokenGetter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;

/**
 * 泛微流程接口Configuration
 */
@Configuration
@EnableFeignClients(basePackages = {"cn.ey.biz.module.weaver.api"})
@EnableConfigurationProperties(AppIdConfig.class)
public class WeaverAutoConfiguration {

    @Bean
    public HttpMessageConverter customConverter() {
        TextPlainJackson2HttpMessageConverter converter = new TextPlainJackson2HttpMessageConverter();
        return converter;
    }

    @Bean
    public TokenGetter tokenGetter() {
        return new TokenGetter();
    }

    @Bean
    public HrmGetter hrmGetter() {
        return new HrmGetter();
    }
}
