All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pdd.pop.sdk.http.api.ark.request.PddTrainCreateOtcbookRequest 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.PddTrainCreateOtcbookResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

import java.util.List;
import java.util.Map;

public class PddTrainCreateOtcbookRequest extends PopBaseHttpRequest {

    /**
     * 出发车站
     */
    @JsonProperty("depart_station")
    private String departStation;

    /**
     * 到达车站
     */
    @JsonProperty("arrive_station")
    private String arriveStation;

    /**
     * 列车日期(yyyy-MM-dd)
     */
    @JsonProperty("train_date")
    private String trainDate;

    /**
     * 车次
     */
    @JsonProperty("train_no")
    private String trainNo;

    /**
     * 出发时间(yyyy-MM-dd HH:mm)
     */
    @JsonProperty("depart_time")
    private String departTime;

    /**
     * 到达时间(yyyy-MM-dd HH:mm)
     */
    @JsonProperty("arrive_time")
    private String arriveTime;

    /**
     * 不符合定制时,是否接受其他座(0-不 接受 1-接受)
     */
    @JsonProperty("accept_other_seat")
    private Integer acceptOtherSeat;

    /**
     * 是否接受无座(0-不接受 1-接受)
     */
    @JsonProperty("accept_stand_seat")
    private Integer acceptStandSeat;

    /**
     * 拼多多订单号
     */
    @JsonProperty("pdd_order_id")
    private String pddOrderId;

    /**
     * 线下票选座信息集合
     */
    @JsonProperty("otc_choose_seat")
    private List otcChooseSeat;

    /**
     * 乘车人信息集合
     */
    @JsonProperty("passenger_infos")
    private List passengerInfos;

    /**
     * 请求唯一标示
     */
    @JsonProperty("request_id")
    private String requestId;

    /**
     * 备注
     */
    @JsonProperty("comment")
    private String comment;

    @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.otcbook";
    }

    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }

    @Override
    public Class getResponseClass() {
        return PddTrainCreateOtcbookResponse.class;
    }

    @Override
    protected void setUserParams(Map params) {
        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, "accept_other_seat", acceptOtherSeat);
        setUserParam(params, "accept_stand_seat", acceptStandSeat);
        setUserParam(params, "pdd_order_id", pddOrderId);
        setUserParam(params, "otc_choose_seat", otcChooseSeat);
        setUserParam(params, "passenger_infos", passengerInfos);
        setUserParam(params, "request_id", requestId);
        setUserParam(params, "comment", comment);
    }

    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 setAcceptOtherSeat(Integer acceptOtherSeat) {
        this.acceptOtherSeat = acceptOtherSeat;
    }

    public void setAcceptStandSeat(Integer acceptStandSeat) {
        this.acceptStandSeat = acceptStandSeat;
    }

    public void setPddOrderId(String pddOrderId) {
        this.pddOrderId = pddOrderId;
    }

    public void setOtcChooseSeat(List otcChooseSeat) {
        this.otcChooseSeat = otcChooseSeat;
    }

    public void setPassengerInfos(List passengerInfos) {
        this.passengerInfos = passengerInfos;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public static class OtcChooseSeatItem {

        /**
         * 选座类型,见枚举值
         */
        @JsonProperty("otc_choose_seat_type")
        private Integer otcChooseSeatType;

        /**
         * 数量
         */
        @JsonProperty("count")
        private Integer count;

        public void setOtcChooseSeatType(Integer otcChooseSeatType) {
            this.otcChooseSeatType = otcChooseSeatType;
        }

        public void setCount(Integer count) {
            this.count = count;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    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;

        /**
         * 出生日期(yyyy-MM- dd)
         */
        @JsonProperty("birthday")
        private String birthday;

        /**
         * 过期时间 yyyy-MM- dd
         */
        @JsonProperty("effective_date")
        private String effectiveDate;

        /**
         * 手机号
         */
        @JsonProperty("mobile")
        private String mobile;

        /**
         * 性别(M-男 F-女)
         */
        @JsonProperty("sex")
        private String sex;

        /**
         * 国家二字码
         */
        @JsonProperty("country")
        private String country;

        /**
         * 邮箱
         */
        @JsonProperty("email")
        private String email;

        /**
         * 备注
         */
        @JsonProperty("comment")
        private String comment;

        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 setMobile(String mobile) {
            this.mobile = mobile;
        }

        public void setSex(String sex) {
            this.sex = sex;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        public void setEmail(String email) {
            this.email = email;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy