避免按ID进行改造订购清单

时间:2017-06-14 15:52:20

标签: android retrofit2

我正在使用Retrofit从API获取列表。我应该得到的数据如下:

    [{"id":"11028","doctor_id":"46","date":"2017-06-15","time_ini":"05:20:00","time_end":"08:30:00"},{"id":"11024","doctor_id":"46","date":"2017-06-16","time_ini":"09:30:00","time_end":"10:00:00"},{"id":"11026","doctor_id":"46","date":"2017-06-16","time_ini":"11:00:00","time_end":"12:00:00"},{"id":"11031","doctor_id":"46","date":"2017-06-16","time_ini":"13:00:00","time_end":"14:00:00"},{"id":"11032","doctor_id":"46","date":"2017-06-16","time_ini":"14:20:00","time_end":"15:30:00"},{"id":"10975","doctor_id":"46","date":"2017-06-17","time_ini":"03:00:00","time_end":"06:00:00"},
{"id":"11030","doctor_id":"46","date":"2017-06-21","time_ini":"05:10:00","time_end":"12:00:00"},{"id":"10977","doctor_id":"46","date":"2017-06-22","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10978","doctor_id":"46","date":"2017-06-23","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"10979","doctor_id":"46","date":"2017-06-24","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"10980","doctor_id":"46","date":"2017-06-28","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"10981","doctor_id":"46","date":"2017-06-29","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10982","doctor_id":"46","date":"2017-06-30","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"10983","doctor_id":"46","date":"2017-07-01","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"10984","doctor_id":"46","date":"2017-07-05","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"10985","doctor_id":"46","date":"2017-07-06","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10986","doctor_id":"46","date":"2017-07-07","time_ini":"09:30:00","time_end":"15:30:00"},
{"id":"10987","doctor_id":"46","date":"2017-07-08","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"10988","doctor_id":"46","date":"2017-07-12","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"10989","doctor_id":"46","date":"2017-07-13","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10990","doctor_id":"46","date":"2017-07-14","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"10991","doctor_id":"46","date":"2017-07-15","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"10992","doctor_id":"46","date":"2017-07-19","time_ini":"04:30:00","time_end":"12:00:00"},
{"id":"10993","doctor_id":"46","date":"2017-07-20","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10994","doctor_id":"46","date":"2017-07-21","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"10995","doctor_id":"46","date":"2017-07-22","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"10996","doctor_id":"46","date":"2017-07-26","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"10997","doctor_id":"46","date":"2017-07-27","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"10998","doctor_id":"46","date":"2017-07-28","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"10999","doctor_id":"46","date":"2017-07-29","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11000","doctor_id":"46","date":"2017-08-02","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"11001","doctor_id":"46","date":"2017-08-03","time_ini":"05:00:00","time_end":"08:30:00"},
{"id":"11002","doctor_id":"46","date":"2017-08-04","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"11003","doctor_id":"46","date":"2017-08-05","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11004","doctor_id":"46","date":"2017-08-09","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"11005","doctor_id":"46","date":"2017-08-10","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"11006","doctor_id":"46","date":"2017-08-11","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"11007","doctor_id":"46","date":"2017-08-12","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11008","doctor_id":"46","date":"2017-08-16","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"11009","doctor_id":"46","date":"2017-08-17","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"11010","doctor_id":"46","date":"2017-08-18","time_ini":"09:30:00","time_end":"15:30:00"},
{"id":"11011","doctor_id":"46","date":"2017-08-19","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11012","doctor_id":"46","date":"2017-08-23","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"11013","doctor_id":"46","date":"2017-08-24","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"11014","doctor_id":"46","date":"2017-08-25","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"11015","doctor_id":"46","date":"2017-08-26","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11016","doctor_id":"46","date":"2017-08-30","time_ini":"04:30:00","time_end":"12:00:00"},{"id":"11017","doctor_id":"46","date":"2017-08-31","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"11018","doctor_id":"46","date":"2017-09-01","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"11019","doctor_id":"46","date":"2017-09-02","time_ini":"03:00:00","time_end":"06:00:00"},{"id":"11020","doctor_id":"46","date":"2017-09-06","time_ini":"04:30:00","time_end":"12:00:00"},
{"id":"11021","doctor_id":"46","date":"2017-09-07","time_ini":"05:00:00","time_end":"08:30:00"},{"id":"11022","doctor_id":"46","date":"2017-09-08","time_ini":"09:30:00","time_end":"15:30:00"},{"id":"11023","doctor_id":"46","date":"2017-09-09","time_ini":"03:00:00","time_end":"06:00:00"}]

我正在使用Retrofit来解决这个问题:

0 = {ResponseAppointmentHours@7146} 
 date = "2017-06-16"
 doctorId = 46
 timeEnd = "15:30:00"
 timeIni = "14:20:00"
 id = 11032
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1821293683
1 = {ResponseAppointmentHours@7147} 
 date = "2017-06-16"
 doctorId = 46
 timeEnd = "14:00:00"
 timeIni = "13:00:00"
 id = 11031
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1780684478
2 = {ResponseAppointmentHours@7148} 
 date = "2017-06-21"
 doctorId = 46
 timeEnd = "12:00:00"
 timeIni = "05:10:00"
 id = 11030
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1993499309
3 = {ResponseAppointmentHours@7149} 
 date = "2017-06-15"
 doctorId = 46
 timeEnd = "08:30:00"
 timeIni = "05:20:00"
 id = 11028
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1886554480
4 = {ResponseAppointmentHours@7150} 
 date = "2017-06-16"
 doctorId = 46
 timeEnd = "12:00:00"
 timeIni = "11:00:00"
 id = 11026
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1128559735
5 = {ResponseAppointmentHours@7151} 
 date = "2017-06-16"
 doctorId = 46
 timeEnd = "10:00:00"
 timeIni = "09:30:00"
 id = 11024
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1252763762
6 = {ResponseAppointmentHours@7152} 
 date = "2017-09-09"
 doctorId = 46
 timeEnd = "06:00:00"
 timeIni = "03:00:00"
 id = 11023
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1385514065
7 = {ResponseAppointmentHours@7153} 
 date = "2017-09-08"
 doctorId = 46
 timeEnd = "15:30:00"
 timeIni = "09:30:00"
 id = 11022
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1275368516
8 = {ResponseAppointmentHours@7154} 
 date = "2017-09-07"
 doctorId = 46
 timeEnd = "08:30:00"
 timeIni = "05:00:00"
 id = 11021
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1941416123
9 = {ResponseAppointmentHours@7155} 
 date = "2017-09-06"
 doctorId = 46
 timeEnd = "12:00:00"
 timeIni = "04:30:00"
 id = 11020
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1983750502
10 = {ResponseAppointmentHours@7156} 
 date = "2017-09-02"
 doctorId = 46
 timeEnd = "06:00:00"
 timeIni = "03:00:00"
 id = 11019
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1515101237
11 = {ResponseAppointmentHours@7157} 
 date = "2017-09-01"
 doctorId = 46
 timeEnd = "15:30:00"
 timeIni = "09:30:00"
 id = 11018
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1829664856
12 = {ResponseAppointmentHours@7158} 
 date = "2017-08-31"
 doctorId = 46
 timeEnd = "08:30:00"
 timeIni = "05:00:00"
 id = 11017
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1139006783
13 = {ResponseAppointmentHours@7159} 
 date = "2017-08-30"
 doctorId = 46
 timeEnd = "12:00:00"
 timeIni = "04:30:00"
 id = 11016
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1932015002
14 = {ResponseAppointmentHours@7160} 
 date = "2017-08-26"
 doctorId = 46
 timeEnd = "06:00:00"
 timeIni = "03:00:00"
 id = 11015
 shadow$_klass_ = {Class@6492} "class com.omnidoctor.omniapp.data.entities.remote.response.ResponseAppointmentHours"
 shadow$_monitor_ = -1469025881

我不会复制所有值以避免使帖子过长,但正如您所看到的那样,使用翻译时,列表按ID排序。但我需要订购它,因为它来自服务器。如何避免Retrofit按ID排序列表?

0 个答案:

没有答案