Browse Source

壳web配置同步

melon.yin 3 years ago
parent
commit
f03c755bb4
1 changed files with 18 additions and 0 deletions
  1. 18 0
      lib/services/platform.dart

+ 18 - 0
lib/services/platform.dart

@@ -19,4 +19,22 @@ class PlatformService extends JsonRpcClientBase {
     var rpcRst = await call("loadTheme", name);
     return rpcRst == true;
   }
+
+  /// 保存配置
+  ///
+  /// [moduleName] 模块名
+  ///
+  /// [jsonText] json文本
+  Future<bool> saveConfig(String moduleName, String jsonText) async {
+    var rpcRst = await call("SaveConfig", [moduleName, jsonText]);
+    return rpcRst;
+  }
+
+  /// 获取配置
+  ///
+  /// [moduleName] 模块名
+  Future<String?> getConfig(String moduleName) async {
+    var rpcRst = await call("GetConfig", moduleName);
+    return rpcRst;
+  }
 }