#1 2018-03-02 21:48:36

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

TTimeLog format in JSON

Hi guys,

When retrieving the data in any (ORM Related) method that return JSON...

Are possible to generate TtimeLog type fields in ISO 8601 format instead of integer?

Example:

{
"Name": "The Name",
CreatedAt: "2018-02-02T12:57:17+00:00",
ModifiedAt: "2018-02-02T12:57:17+00:00"
}

Last edited by macfly (2018-03-02 21:50:41)

Offline

#2 2018-03-02 23:57:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: TTimeLog format in JSON

There is no built-in option for this yet.

Offline

#3 2018-03-03 22:21:23

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: TTimeLog format in JSON

Ok thanks por reply.

Offline

#4 2018-03-04 09:19:33

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: TTimeLog format in JSON

The idea is not to directly publish the ORM, but to define an interface-based service, and DTO records and arrays, to provide the clients with the data in the expected format.
You will gain the abstraction of services and interfaces, and better security, since with the ORM you can query almost whatever you want, whereas with a service, your code is the master of the query.

Offline

#5 2018-03-05 16:26:32

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: TTimeLog format in JSON

I use both ways.

But in this particular project the service is consumed exclusively by a delphi application, so I am not using services in this case.

But using services the JSON format will be the same, correct?

What you suggest would be to get the result in DocVariant. So do the parsing - in the service method - with the conversions and return formatted?

Offline

Board footer

Powered by FluxBB