|
|
@@ -1,5 +1,8 @@
|
|
|
+import 'package:electronic_assistant/base/base_controller.dart';
|
|
|
import 'package:electronic_assistant/data/api/request/talk_request.dart';
|
|
|
import 'package:electronic_assistant/data/bean/agenda.dart';
|
|
|
+import 'package:electronic_assistant/resource/string.gen.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
import 'package:get/get_rx/src/rx_types/rx_types.dart';
|
|
|
|
|
|
import '../../utils/http_handler.dart';
|
|
|
@@ -61,7 +64,10 @@ class AgendaRepository {
|
|
|
.then(HttpHandler.handle(true));
|
|
|
}
|
|
|
|
|
|
- Future<void> agendaFinish(String? id, bool complete) {
|
|
|
+ Future<void> agendaFinish(String? id, bool complete) async {
|
|
|
+ if (!accountRepository.isLogin.value) {
|
|
|
+ throw ServerErrorException(-1, StringName.noLogin.tr);
|
|
|
+ }
|
|
|
return atmobApi
|
|
|
.agendaFinish(AgendaStatusRequest(id, complete))
|
|
|
.then(HttpHandler.handle(true));
|
|
|
@@ -81,7 +87,10 @@ class AgendaRepository {
|
|
|
.then(HttpHandler.handle(true));
|
|
|
}
|
|
|
|
|
|
- Future<void> agendaTodo(String id, bool isTodo) {
|
|
|
+ Future<void> agendaTodo(String id, bool isTodo) async {
|
|
|
+ if (!accountRepository.isLogin.value) {
|
|
|
+ throw ServerErrorException(-1, StringName.noLogin.tr);
|
|
|
+ }
|
|
|
return atmobApi
|
|
|
.agendaTodo(AgendaTodoRequest(id, isTodo))
|
|
|
.then(HttpHandler.handle(true));
|