
using CloudGaming.AppConfigModel;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudGaming.Code.JY;

public class JYApiAppConfigHandler : JYApiHandler
{
    protected AppConfig AppConfig { get; set; }
    protected string Ip { get; set; }
    public JYApiAppConfigHandler(AppConfig appConfig, string ip) : base(null)
    {
        AppConfig = appConfig;
        Ip = ip;
        InnerHandler = new HttpClientHandler();
    }


    protected override async Task SetRequest(HttpRequestMessage request)
    {

        UpdateRequestUri(request, AppConfig.GameConfig.BsUrl);

        if (request.Content is FormUrlEncodedContent)
        {

            await UpdateRequestContentAsync(request, AppConfig, Ip);
        }

    }
}
