This commit is contained in:
jyuesong
2022-01-13 18:31:00 +08:00
parent 3ef05709ea
commit 6555031948
4 changed files with 44 additions and 7 deletions

View File

@@ -51,4 +51,12 @@ class Api {
static Future<HttpResponse<NullResponse>> delTask(String cron) async {
return await Http.delete<NullResponse>(Url.ADD_TASK, [cron]);
}
static Future<HttpResponse<NullResponse>> pinTask(String cron) async {
return await Http.put<NullResponse>(Url.PIN_TASK, [cron]);
}
static Future<HttpResponse<NullResponse>> unpinTask(String cron) async {
return await Http.put<NullResponse>(Url.UNPIN_TASK, [cron]);
}
}

View File

@@ -5,6 +5,8 @@ class Url {
static const STOP_TASKS = "/api/crons/stop";
static const TASK_DETAIL = "/api/crons/";
static const ADD_TASK = "/api/crons";
static const PIN_TASK = "/api/crons/pin";
static const UNPIN_TASK = "/api/crons/unpin";
static INTIME_LOG(String cronId) {
return "/api/crons/$cronId/log";