mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:qinglong_app/base/http/http.dart';
|
||||
import 'package:qinglong_app/module/config/config_bean.dart';
|
||||
import 'package:qinglong_app/module/login/login_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_detail/task_detail_bean.dart';
|
||||
@@ -67,4 +68,15 @@ class Api {
|
||||
static Future<HttpResponse<NullResponse>> disableTask(String cron) async {
|
||||
return await Http.put<NullResponse>(Url.DISABLE_TASK, [cron]);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<List<ConfigBean>>> files() async {
|
||||
return await Http.get<List<ConfigBean>>(Url.FILES, null);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<String>> content(String name) async {
|
||||
return await Http.get<String>(Url.CONFIG_CONTENT+name, null);
|
||||
}
|
||||
static Future<HttpResponse<NullResponse>> saveFile(String name,String content) async {
|
||||
return await Http.post<NullResponse>(Url.SAVE_FILE, {"content":content,"name": name});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ class Url {
|
||||
static const UNPIN_TASK = "/api/crons/unpin";
|
||||
static const ENABLE_TASK = "/api/crons/enable";
|
||||
static const DISABLE_TASK = "/api/crons/disable";
|
||||
static const FILES = "/api/configs/files";
|
||||
static const CONFIG_CONTENT = "/api/configs/";
|
||||
static const SAVE_FILE = "/api/configs/save";
|
||||
|
||||
static INTIME_LOG(String cronId) {
|
||||
return "/api/crons/$cronId/log";
|
||||
|
||||
Reference in New Issue
Block a user