Created
June 20, 2023 21:34
-
-
Save an01f01/ae8ab6ba2b0badaac315b0c5b2c108d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITodo = interface | |
end; | |
TErrorTodo = class(TInterfacedObject, ITodo) | |
public | |
[JSONMarshalled(True)][JSONName('error_message')] | |
ErrorMessage: string; | |
constructor Create(ErrorMessage: string); | |
function GetSelf: TObject; | |
function ToString: string; | |
end; | |
TItemTodo = class(TInterfacedObject, ITodo) | |
public | |
[JSONMarshalled(True)][JSONName('task')] | |
Task: string; | |
[JSONMarshalled(True)][JSONName('is_completed')] | |
IsCompleted: Boolean; | |
constructor Create(Task: string; IsCompleted: Boolean); | |
function GetSelf: TObject; | |
function ToString: string; | |
end; | |
TListTodo = class(TInterfacedObject, ITodo) | |
private | |
public | |
[JSONMarshalled(True)][JSONName('name')] | |
Name: string; | |
[JSONMarshalled(True)][JSONName('todos')] | |
Todos: TList<TItemTodo>; | |
constructor Create(); | |
destructor Destroy; override; | |
function GetSelf: TObject; | |
function ToString: string; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment