refactor: 重构 schemas 结构,统一枚举定义
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
enum ScheduleSourceType { manual, imported, agentGenerated }
|
||||
|
||||
enum ScheduleStatus { active, completed, canceled, archived }
|
||||
enum ScheduleStatus { active, archived }
|
||||
|
||||
class ScheduleItemModel {
|
||||
final String id;
|
||||
@@ -279,9 +279,7 @@ ScheduleSourceType _sourceTypeFromApi(String? raw) {
|
||||
ScheduleStatus _statusFromApi(String? raw) {
|
||||
switch (raw) {
|
||||
case 'completed':
|
||||
return ScheduleStatus.completed;
|
||||
case 'canceled':
|
||||
return ScheduleStatus.canceled;
|
||||
case 'archived':
|
||||
return ScheduleStatus.archived;
|
||||
case 'active':
|
||||
@@ -294,10 +292,6 @@ String _statusToApi(ScheduleStatus status) {
|
||||
switch (status) {
|
||||
case ScheduleStatus.active:
|
||||
return 'active';
|
||||
case ScheduleStatus.completed:
|
||||
return 'completed';
|
||||
case ScheduleStatus.canceled:
|
||||
return 'canceled';
|
||||
case ScheduleStatus.archived:
|
||||
return 'archived';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user