package com.union.ai.api.util;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@PropertySource({"classpath:base-config.properties", "classpath:webConfig.properties"})
@Data
@Component
public class Config {

    @Value("${redis.host}")
    private String redisHost;
    @Value("${redis.pass:}")
    private String redisPass;
    @Value("${redis.port}")
    private Integer redisPort;
    @Value("${redis.database}")
    private Integer redisDatabase;
    @Value("${redis.maxIdle}")
    private Integer redisMaxIdle;
    @Value("${redis.maxActive}")
    private Integer redisMaxActive;
    @Value("${redis.maxWait}")
    private Integer redisMaxWait;
    @Value("${redis.testOnBorrow}")
    private String redisTestOnBorrow;

    @Value("${token.key}")
    private String tokenKey;
    @Value("${token.expire.time}")
    private Integer tokenExpireTime;

    @Value("${api.url}/face-api/v3/face/")
    private String faceApiUrl;
    @Value("${api.url}/face-api/face/")
    private String faceUrl;
    @Value("${api.url}/face-api/v3/user/")
    private String faceUserUrl;
    @Value("${api.url}/face-api/v3/group/")
    private String faceUserGroupUrl;
    @Value("${api.url}")
    private String apiUrl;
    @Value("${body.analysis.url}/GeneralClassifyService/classify")
    private String bodyAnalysisUrl;
    @Value("${body.attr.url}/GeneralClassifyService/classify")
    private String bodyAttrUrl;
    @Value("${body.num.url}/GeneralClassifyService/classify")
    private String bodyNumUrl;
    @Value("${body.gesture.url}/GeneralClassifyService/classify")
    private String bodyGestureUrl;
//    @Value("${name.srv.addr}")
//    private String nameSrvAddr;

    public static Config getInstance() {
        return SpringBeanUtil.getBean(Config.class);
    }
}
