本文共 1118 字,大约阅读时间需要 3 分钟。
Push data flow:
Step | client App | server |
---|---|---|
1 | New Data can be captured in the following flows:
Each flow will mark the entry in client side as "dirty". When each flow succeeds in the API call (which means server has been updated for individual entry, the "dirty" flag will be removed. New Data = all entries with "dirty" flag. Push new data to server. Include the device key (or device id). | |
2 |
| Receive the new data. |
3 | Generate a timestamp (e.g. date time now) and stamp it to the data. | |
4 | Save data to the DB together with the device key. |
Pull data flow:
Step | client App | server |
---|---|---|
1 | Pull new data from server. Include the following parameters:
| |
2 | Receive the client timestamp and client device key | |
3 | Query data from DB with this filter:
Send the resulting data back to client | |
4 | Receive resulting data from server | |
5 | if record match (e.g. ticket id, customer id) with local storage update the record locally. Otherwise, add the new record locally. |
转载地址:http://fphai.baihongyu.com/