package com.ff.game.api.jili.address;

import com.dtflys.forest.callback.AddressSource;
import com.dtflys.forest.http.ForestAddress;
import com.dtflys.forest.http.ForestRequest;
import com.ff.base.constant.Constants;
import com.ff.base.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Random;


/**
 * 我jili address来源
 *
 * @author shi
 * @date 2025/02/10
 */
@Component
public class MyJILIAddressSource  implements AddressSource {

    @Resource
    private ISysConfigService configService;


    @Override
    public ForestAddress getAddress(ForestRequest request) {
        String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
        return new ForestAddress("https",apiBaseUrl, 443,"api1");
    }
}