public Task GameGetSetting([FromForm] GameProviderType type) { IGameProvider iProvider = GameFactory.GetFactory(type, string.Empty); return(this.GetResult(new { Setting = iProvider == null ? new JsonString("[]") : new JsonString(iProvider.ToSetting()) })); }
public Task GameSettingInfo([FromForm] int?id) { GameSetting setting = id == null ? new GameSetting(): (GameSettingAgent.Instance().GetGameSettingInfo(id.Value) ?? new GameSetting()); IGameProvider iProvider = GameFactory.GetFactory(setting.Type.ToString(), setting.SettingString); return(this.GetResult(new { setting.ID, setting.Name, setting.Code, setting.Type, setting.Status, setting.MaintainTime, setting.Remark, Setting = setting.ID == 0 ? new JsonString("[]") : new JsonString(iProvider.ToSetting()) })); }
public Task GameInfo([FromForm] int?id) { GameProvider provider = id == null ? new GameProvider() { Name = "", SettingString = "", } : (ProviderAgent.Instance().GetGameProviderInfo(id.Value) ?? new GameProvider() { Name = "", SettingString = "", }); IGameProvider iProvider = GameFactory.GetFactory(provider.Type, provider.SettingString); return(this.GetResult(new { provider.ID, provider.Name, provider.Type, Setting = provider.ID == 0 ? new JsonString("[]"): new JsonString(iProvider.ToSetting()) })); }