Furion icon indicating copy to clipboard operation
Furion copied to clipboard

Furion documentation - options

Open MonkSoul opened this issue 3 years ago • 4 comments

MonkSoul avatar Dec 16 '21 09:12 MonkSoul

大佬,有考虑实现 Apollo 么

moonpeng avatar Feb 18 '22 06:02 moonpeng

配置我试验过了,不支持列表数据对象的读取?,能否支持?

joyswing avatar May 19 '22 02:05 joyswing

配置我试验过了,不支持列表数据对象的读取?,能否支持?

必须支持。。。你可以通过 App.GetConfig<T> 或者 App.GetOption<TOption> 都行。。。

MonkSoul avatar May 19 '22 03:05 MonkSoul

var a = App.GetConfig<PowerModel>("AppInfo:PowerModels")

PowerModel对象 public class PowerModel { [JsonProperty("items")] public List<PowerModelOption> Items { get; set; } } public class PowerModelOption { [JsonProperty("powerModel")] public string PowerModel { get; set; }

    [JsonProperty("vMax")]
    public double VMax { get; set; }

    [JsonProperty("vReadMax")]
    public double VReadMax { get; set; }

    [JsonProperty("cMax")]
    public double CMax { get; set; }

    [JsonProperty("cReadMax")]
    public double CReadMax { get; set; }

}

我试验了一下好像还是不行,Json对象如下: "PowerModels": { "Items": [ { "powerModel": "STB-100", "vMax": "95", "vReadMax": "", "cMax": "1050", "cReadMax": "" }, { "powerModel": "STB-60", "vMax": "85", "vReadMax": "", "cMax": "700", "cReadMax": "" } ] }

joyswing avatar Jun 17 '22 06:06 joyswing