com.pdd.pop.sdk.http.api.ark.request.PddTrainGrabCreateRequest Maven / Gradle / Ivy
The newest version!
package com.pdd.pop.sdk.http.api.ark.request;
import com.pdd.pop.sdk.common.util.JsonUtil;
import com.pdd.pop.ext.fasterxml.jackson.annotation.JsonProperty;
import com.pdd.pop.sdk.http.api.ark.response.PddTrainGrabCreateResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;
import java.util.List;
import java.util.Map;
public class PddTrainGrabCreateRequest extends PopBaseHttpRequest {
/**
* 拼多多订单号
*/
@JsonProperty("pdd_order_id")
private String pddOrderId;
/**
* 抢票截止时间
*/
@JsonProperty("end_time")
private String endTime;
/**
* 出发日期集合
*/
@JsonProperty("depart_dates")
private List departDates;
/**
* 有账号抢票 0 无账号 抢票 1
*/
@JsonProperty("have_account")
private String haveAccount;
/**
* 12306 账号
*/
@JsonProperty("crh_account")
private String crhAccount;
/**
* 12306 密码
*/
@JsonProperty("crh_password")
private String crhPassword;
/**
* 总票价 单位分
*/
@JsonProperty("sum_ticket_price")
private String sumTicketPrice;
/**
* 座位类型集合
*/
@JsonProperty("seat_types")
private List seatTypes;
/**
* 行程信息
*/
@JsonProperty("travel_infos")
private List travelInfos;
/**
* 乘客信息
*/
@JsonProperty("passenger_infos")
private List passengerInfos;
/**
* 是否先占座单 0 否 1 是
*/
@JsonProperty("is_reserve_first")
private Integer isReserveFirst;
@Override
public String getVersion() {
return "V1";
}
@Override
public String getDataType() {
return "JSON";
}
@Override
public Integer getPlatform() {
return 1;
}
@Override
public String getType() {
return "pdd.train.grab.create";
}
@Override
public HttpMethod getHttpMethod() {
return HttpMethod.POST;
}
@Override
public Class getResponseClass() {
return PddTrainGrabCreateResponse.class;
}
@Override
protected void setUserParams(Map params) {
setUserParam(params, "pdd_order_id", pddOrderId);
setUserParam(params, "end_time", endTime);
setUserParam(params, "depart_dates", departDates);
setUserParam(params, "have_account", haveAccount);
setUserParam(params, "crh_account", crhAccount);
setUserParam(params, "crh_password", crhPassword);
setUserParam(params, "sum_ticket_price", sumTicketPrice);
setUserParam(params, "seat_types", seatTypes);
setUserParam(params, "travel_infos", travelInfos);
setUserParam(params, "passenger_infos", passengerInfos);
setUserParam(params, "is_reserve_first", isReserveFirst);
}
public void setPddOrderId(String pddOrderId) {
this.pddOrderId = pddOrderId;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public void setDepartDates(List departDates) {
this.departDates = departDates;
}
public void setHaveAccount(String haveAccount) {
this.haveAccount = haveAccount;
}
public void setCrhAccount(String crhAccount) {
this.crhAccount = crhAccount;
}
public void setCrhPassword(String crhPassword) {
this.crhPassword = crhPassword;
}
public void setSumTicketPrice(String sumTicketPrice) {
this.sumTicketPrice = sumTicketPrice;
}
public void setSeatTypes(List seatTypes) {
this.seatTypes = seatTypes;
}
public void setTravelInfos(List travelInfos) {
this.travelInfos = travelInfos;
}
public void setPassengerInfos(List passengerInfos) {
this.passengerInfos = passengerInfos;
}
public void setIsReserveFirst(Integer isReserveFirst) {
this.isReserveFirst = isReserveFirst;
}
public static class TravelInfosItem {
/**
* 车次
*/
@JsonProperty("train_no")
private String trainNo;
/**
* 出发站
*/
@JsonProperty("depart_station")
private String departStation;
/**
* 到达站
*/
@JsonProperty("arrive_station")
private String arriveStation;
public void setTrainNo(String trainNo) {
this.trainNo = trainNo;
}
public void setDepartStation(String departStation) {
this.departStation = departStation;
}
public void setArriveStation(String arriveStation) {
this.arriveStation = arriveStation;
}
@Override
public String toString() {
return JsonUtil.transferToJson(this);
}
}
public static class PassengerInfosItem {
/**
* 姓名
*/
@JsonProperty("name")
private String name;
/**
* 证件号
*/
@JsonProperty("card_no")
private String cardNo;
/**
* 证件类型
*/
@JsonProperty("card_type")
private String cardType;
/**
* 车票类型
*/
@JsonProperty("ticket_type")
private Integer ticketType;
/**
* 拼多多子单号
*/
@JsonProperty("sub_pdd_order_id")
private String subPddOrderId;
/**
* 过期时间
*/
@JsonProperty("effective_date")
private String effectiveDate;
/**
* 性别
*/
@JsonProperty("sex")
private String sex;
/**
* 国家
*/
@JsonProperty("country")
private String country;
/**
* 生日
*/
@JsonProperty("birthday")
private String birthday;
/**
* 拼多多C端订单号
*/
@JsonProperty("order_sn")
private String orderSn;
/**
* 手机号
*/
@JsonProperty("mobile")
private String mobile;
/**
* 邮箱
*/
@JsonProperty("email")
private String email;
public void setName(String name) {
this.name = name;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public void setCardType(String cardType) {
this.cardType = cardType;
}
public void setTicketType(Integer ticketType) {
this.ticketType = ticketType;
}
public void setSubPddOrderId(String subPddOrderId) {
this.subPddOrderId = subPddOrderId;
}
public void setEffectiveDate(String effectiveDate) {
this.effectiveDate = effectiveDate;
}
public void setSex(String sex) {
this.sex = sex;
}
public void setCountry(String country) {
this.country = country;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return JsonUtil.transferToJson(this);
}
}
}