com.pdd.pop.sdk.http.api.ark.request.PddTrainCreateReserveRequest Maven / Gradle / Ivy
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.PddTrainCreateReserveResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;
import java.util.List;
import java.util.Map;
public class PddTrainCreateReserveRequest extends PopBaseHttpRequest {
/**
* 拼多多火车票单号
*/
@JsonProperty("pdd_order_id")
private String pddOrderId;
/**
* 出发站
*/
@JsonProperty("depart_station")
private String departStation;
/**
* 到达站
*/
@JsonProperty("arrive_station")
private String arriveStation;
/**
* 列车日期
*/
@JsonProperty("train_date")
private String trainDate;
/**
* 车次
*/
@JsonProperty("train_no")
private String trainNo;
/**
* 出发时间
*/
@JsonProperty("depart_time")
private String departTime;
/**
* 到达时间
*/
@JsonProperty("arrive_time")
private String arriveTime;
/**
* 是否接受无座(0-接 受 1-不接受)
*/
@JsonProperty("no_seat")
private Integer noSeat;
/**
* 选座
*/
@JsonProperty("choose_seat")
private String chooseSeat;
/**
* 12306 账号
*/
@JsonProperty("crh_account")
private String crhAccount;
/**
* 12306 密码
*/
@JsonProperty("crh_password")
private String crhPassword;
/**
* 是否切换供应商账号
*/
@JsonProperty("switch_account")
private Integer switchAccount;
/**
* 乘车人信息集合
*/
@JsonProperty("passenger_infos")
private List passengerInfos;
@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.create.reserve";
}
@Override
public HttpMethod getHttpMethod() {
return HttpMethod.POST;
}
@Override
public Class getResponseClass() {
return PddTrainCreateReserveResponse.class;
}
@Override
protected void setUserParams(Map params) {
setUserParam(params, "pdd_order_id", pddOrderId);
setUserParam(params, "depart_station", departStation);
setUserParam(params, "arrive_station", arriveStation);
setUserParam(params, "train_date", trainDate);
setUserParam(params, "train_no", trainNo);
setUserParam(params, "depart_time", departTime);
setUserParam(params, "arrive_time", arriveTime);
setUserParam(params, "no_seat", noSeat);
setUserParam(params, "choose_seat", chooseSeat);
setUserParam(params, "crh_account", crhAccount);
setUserParam(params, "crh_password", crhPassword);
setUserParam(params, "switch_account", switchAccount);
setUserParam(params, "passenger_infos", passengerInfos);
}
public void setPddOrderId(String pddOrderId) {
this.pddOrderId = pddOrderId;
}
public void setDepartStation(String departStation) {
this.departStation = departStation;
}
public void setArriveStation(String arriveStation) {
this.arriveStation = arriveStation;
}
public void setTrainDate(String trainDate) {
this.trainDate = trainDate;
}
public void setTrainNo(String trainNo) {
this.trainNo = trainNo;
}
public void setDepartTime(String departTime) {
this.departTime = departTime;
}
public void setArriveTime(String arriveTime) {
this.arriveTime = arriveTime;
}
public void setNoSeat(Integer noSeat) {
this.noSeat = noSeat;
}
public void setChooseSeat(String chooseSeat) {
this.chooseSeat = chooseSeat;
}
public void setCrhAccount(String crhAccount) {
this.crhAccount = crhAccount;
}
public void setCrhPassword(String crhPassword) {
this.crhPassword = crhPassword;
}
public void setSwitchAccount(Integer switchAccount) {
this.switchAccount = switchAccount;
}
public void setPassengerInfos(List passengerInfos) {
this.passengerInfos = passengerInfos;
}
public static class PassengerInfosItem {
/**
* 证件类型
*/
@JsonProperty("card_type")
private String cardType;
/**
* 证件号
*/
@JsonProperty("card_no")
private String cardNo;
/**
* 姓名
*/
@JsonProperty("name")
private String name;
/**
* 车票类型
*/
@JsonProperty("ticket_type")
private Integer ticketType;
/**
* 座位类型
*/
@JsonProperty("seat_type")
private Integer seatType;
/**
* 票价(单位:分)
*/
@JsonProperty("ticket_price")
private Long ticketPrice;
/**
* 拼多多子单号
*/
@JsonProperty("sub_pdd_order_id")
private String subPddOrderId;
/**
* 生日
*/
@JsonProperty("birthday")
private String birthday;
/**
* 证件过期时间
*/
@JsonProperty("effective_Date")
private String effectiveDate;
/**
* 性别
*/
@JsonProperty("sex")
private String sex;
/**
* 国家
*/
@JsonProperty("country")
private String country;
/**
* 手机
*/
@JsonProperty("mobile")
private String mobile;
/**
* 邮箱
*/
@JsonProperty("email")
private String email;
public void setCardType(String cardType) {
this.cardType = cardType;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public void setName(String name) {
this.name = name;
}
public void setTicketType(Integer ticketType) {
this.ticketType = ticketType;
}
public void setSeatType(Integer seatType) {
this.seatType = seatType;
}
public void setTicketPrice(Long ticketPrice) {
this.ticketPrice = ticketPrice;
}
public void setSubPddOrderId(String subPddOrderId) {
this.subPddOrderId = subPddOrderId;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
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 setMobile(String mobile) {
this.mobile = mobile;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return JsonUtil.transferToJson(this);
}
}
}