我的网络服务回复:
{
"UserId": 4,
"EquipmentId": 1,
"ScheduleName": "sample string 4",
"Notes": "sample string 5",
"StartDate": "2016-04-09",
"time": [
{
"StartTime": "00:00:00",
"EndTime": "00:30:00"
}
]
}
为此,我创建了两个类:
public class AddScheduleReqParser {
@SerializedName(GsonKey.USER_ID)
public String UserId;
@SerializedName(GsonKey.EQUIPMENT_ID)
public String EquipmentId;
@SerializedName(GsonKey.SCHEDULE_NAME)
public String ScheduleName;
@SerializedName(GsonKey.NOTES)
public String Notes;
@SerializedName(GsonKey.START_DATE_STRING)
public String StartDate;
public List<AddScheduleSubReqParser> time;
}
和第二课:
public class AddScheduleSubReqParser {
@SerializedName(GsonKey.START_TIME)
public String StartTime;
@SerializedName(GsonKey.END_TIME)
public String EndTime;
}
我通过post方法发送此回复
mAddScheduleReqParser.UserId = abc;
mAddScheduleReqParser.EquipmentId = "1";
mAddScheduleReqParser.ScheduleName = "Schedule";
mAddScheduleReqParser.Notes = "notes";
mAddScheduleReqParser.StartDate = "2016-04-09";
mAddScheduleSubReqParser.StartTime = "00:30:00";
mAddScheduleSubReqParser.EndTime = "1:00:00"
但是值不会存储在开始时间和时间中。
如何发送开始时间和结束时间值?
答案 0 :(得分:0)
试试这个: