device resource api

amin9 months ago

hi
while im updating device i trace code,but the put method in deviceresource class(api) does not invoke .so i dont understand how it works?

Anton Tananaev9 months ago

You're clearly missing something. The code should be invoked.

amin9 months ago

when i click save buttom , it goes to constructor of DeviceResource class, then it goes to put method in BaseObjectResource Class, after that it get back to constructor of DeviceResource class and finally it goes to get method of DeviceResourcs class. but put method in DeviceResourcs class does not invoke in this loop.

Anton Tananaev9 months ago

DeviceResource does not override the PUT method, so it is correct that the implementation in BaseObjectResource is called. Sounds like everything is working as expected.

amin9 months ago

so what is the role of put method in DeviceResource class? isnt it api of update device?

Anton Tananaev9 months ago

You mean updateAccumulators? It's to update accumulators.

amin9 months ago

yes exactly.

amin9 months ago

what is accumulators.?

Anton Tananaev9 months ago

Accumulators are things that accumulate values. Currently we have distance and engine hours accumulators.

Ashok Chandra9 months ago

I am also confused with DeviceResource.java there is no POST method, first I think PUT method is doing work as POST. When I removed the all PUT codes from file.I recompile and replace all files. after that add device function are working. How this possible.

Where is the code for adding device where is POST method for add device.

Amir9 months ago

Exactly the api address is api/devices but the invoked method in parent class

Amir9 months ago

The api implement in baseresource class.