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

com.pdd.pop.sdk.http.api.pop.request.PddDdkRpPromUrlGenerateRequest Maven / Gradle / Ivy

package com.pdd.pop.sdk.http.api.pop.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.pop.response.PddDdkRpPromUrlGenerateResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

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

public class PddDdkRpPromUrlGenerateRequest extends PopBaseHttpRequest {

    /**
     * 初始金额(单位分),有效金额枚举值:300、500、700、1100和1600,默认300
     */
    @JsonProperty("amount")
    private Long amount;

    /**
     * 营销工具类型,必填:-1-活动列表,0-红包(需申请推广权限),2–新人红包,3-刮刮卡,5-员工内购,6-购物车,10-生成绑定备案链接,12-砸金蛋;红包推广权限申请流程链接:https: jinbao.pinduoduo.com/qa-system?questionId=289
     */
    @JsonProperty("channel_type")
    private Integer channelType;

    /**
     * 自定义参数,为链接打上自定义标签;自定义参数最长限制64个字节;格式为:  {"uid":"11111","sid":"22222"} ,其中 uid 用户唯一标识,可自行加密后传入,每个用户仅且对应一个标识,必填; sid 上下文信息标识,例如sessionId等,非必填。该json字符串中也可以加入其他自定义的key
     */
    @JsonProperty("custom_parameters")
    private String customParameters;

    /**
     * 转盘自定义参数
     */
    @JsonProperty("diy_lottery_param")
    private DiyLotteryParam diyLotteryParam;

    /**
     * 红包自定义参数
     */
    @JsonProperty("diy_red_packet_param")
    private DiyRedPacketParam diyRedPacketParam;

    /**
     * 是否生成qq小程序
     */
    @JsonProperty("generate_qq_app")
    private Boolean generateQqApp;

    /**
     * 是否返回 schema URL
     */
    @JsonProperty("generate_schema_url")
    private Boolean generateSchemaUrl;

    /**
     * 是否生成短链接。true-是,false-否,默认false
     */
    @JsonProperty("generate_short_url")
    private Boolean generateShortUrl;

    /**
     * 是否生成拼多多福利券微信小程序推广信息
     */
    @JsonProperty("generate_we_app")
    private Boolean generateWeApp;

    /**
     * 推广位列表,例如:["60005_612"]
     */
    @JsonProperty("p_id_list")
    private List pIdList;

    /**
     * 刮刮卡指定金额(单位分),可指定2-100元间数值,即有效区间为:[200,10000]
     */
    @JsonProperty("scratch_card_amount")
    private Long scratchCardAmount;

    @Override
    public String getVersion() {
        return "V1";
    }

    @Override
    public String getDataType() {
        return "JSON";
    }

    @Override
    public Integer getPlatform() {
        return 0;
    }

    @Override
    public String getType() {
        return "pdd.ddk.rp.prom.url.generate";
    }

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

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

    @Override
    protected void setUserParams(Map params) {
        setUserParam(params, "amount", amount);
        setUserParam(params, "channel_type", channelType);
        setUserParam(params, "custom_parameters", customParameters);
        setUserParam(params, "diy_lottery_param", diyLotteryParam);
        setUserParam(params, "diy_red_packet_param", diyRedPacketParam);
        setUserParam(params, "generate_qq_app", generateQqApp);
        setUserParam(params, "generate_schema_url", generateSchemaUrl);
        setUserParam(params, "generate_short_url", generateShortUrl);
        setUserParam(params, "generate_we_app", generateWeApp);
        setUserParam(params, "p_id_list", pIdList);
        setUserParam(params, "scratch_card_amount", scratchCardAmount);
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public void setChannelType(Integer channelType) {
        this.channelType = channelType;
    }

    public void setCustomParameters(String customParameters) {
        this.customParameters = customParameters;
    }

    public void setDiyLotteryParam(DiyLotteryParam diyLotteryParam) {
        this.diyLotteryParam = diyLotteryParam;
    }

    public void setDiyRedPacketParam(DiyRedPacketParam diyRedPacketParam) {
        this.diyRedPacketParam = diyRedPacketParam;
    }

    public void setGenerateQqApp(Boolean generateQqApp) {
        this.generateQqApp = generateQqApp;
    }

    public void setGenerateSchemaUrl(Boolean generateSchemaUrl) {
        this.generateSchemaUrl = generateSchemaUrl;
    }

    public void setGenerateShortUrl(Boolean generateShortUrl) {
        this.generateShortUrl = generateShortUrl;
    }

    public void setGenerateWeApp(Boolean generateWeApp) {
        this.generateWeApp = generateWeApp;
    }

    public void setPIdList(List pIdList) {
        this.pIdList = pIdList;
    }

    public void setScratchCardAmount(Long scratchCardAmount) {
        this.scratchCardAmount = scratchCardAmount;
    }

    public static class DiyLotteryParam {

        /**
         * 优先展示类目
         */
        @JsonProperty("opt_id")
        private Integer optId;

        /**
         * 自定义价格和商品佣金区间
         */
        @JsonProperty("range_items")
        private List rangeItems;

        public void setOptId(Integer optId) {
            this.optId = optId;
        }

        public void setRangeItems(List rangeItems) {
            this.rangeItems = rangeItems;
        }

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

    public static class DiyLotteryParamRangeItemsItem {

        /**
         * 区间的开始值
         */
        @JsonProperty("range_from")
        private Long rangeFrom;

        /**
         * range_id为1表示价格(单位分), range_id为2表示商品佣金(单位千分之几)
         */
        @JsonProperty("range_id")
        private Integer rangeId;

        /**
         * 区间的结束值
         */
        @JsonProperty("range_to")
        private Long rangeTo;

        public void setRangeFrom(Long rangeFrom) {
            this.rangeFrom = rangeFrom;
        }

        public void setRangeId(Integer rangeId) {
            this.rangeId = rangeId;
        }

        public void setRangeTo(Long rangeTo) {
            this.rangeTo = rangeTo;
        }

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

    public static class DiyRedPacketParam {

        /**
         * 红包金额列表,200、300、500、1000、2000,单位分。红包金额和红包抵后价设置只能二选一,默认设置了红包金额会忽略红包抵后价设置
         */
        @JsonProperty("amount_probability")
        private List amountProbability;

        /**
         * 设置玩法,false-现金红包, true-现金券
         */
        @JsonProperty("dis_text")
        private Boolean disText;

        /**
         * 推广页设置,false-红包开启页, true-红包领取页
         */
        @JsonProperty("not_show_background")
        private Boolean notShowBackground;

        /**
         * 优先展示类目
         */
        @JsonProperty("opt_id")
        private Integer optId;

        /**
         * 自定义红包抵后价和商品佣金区间对象数组
         */
        @JsonProperty("range_items")
        private List rangeItems;

        public void setAmountProbability(List amountProbability) {
            this.amountProbability = amountProbability;
        }

        public void setDisText(Boolean disText) {
            this.disText = disText;
        }

        public void setNotShowBackground(Boolean notShowBackground) {
            this.notShowBackground = notShowBackground;
        }

        public void setOptId(Integer optId) {
            this.optId = optId;
        }

        public void setRangeItems(List rangeItems) {
            this.rangeItems = rangeItems;
        }

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

    public static class DiyRedPacketParamRangeItemsItem {

        /**
         * 区间的开始值
         */
        @JsonProperty("range_from")
        private Long rangeFrom;

        /**
         * range_id为1表示红包抵后价(单位分), range_id为2表示佣金比例(单位千分之几)
         */
        @JsonProperty("range_id")
        private Integer rangeId;

        /**
         * 区间的结束值
         */
        @JsonProperty("range_to")
        private Long rangeTo;

        public void setRangeFrom(Long rangeFrom) {
            this.rangeFrom = rangeFrom;
        }

        public void setRangeId(Integer rangeId) {
            this.rangeId = rangeId;
        }

        public void setRangeTo(Long rangeTo) {
            this.rangeTo = rangeTo;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy