package com.yonge.cooleshow.sdk.req;

import com.yonge.cooleshow.enums.OrderStatusEnum;
import com.yonge.cooleshow.enums.PayChannelEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 下单支付请求
 *
 * @Author: liweifan
 * @Data: 2022/3/31 14:55
 */
@ApiModel(value = "OrderPayReq对象", description = "下单支付请求")
public class OrderPayReq {
    @NotBlank(message = "订单号不能为空")
    @ApiModelProperty(value = "订单号 ", required = true)
    private String orderNo;
    @NotNull(message = "支付渠道不能为空")
    @ApiModelProperty(value = "支付渠道:  alipay 支付宝  wx_lite 微信 ", required = true)
    private PayChannelEnum payChannel;
    @ApiModelProperty(value = "用户id ")
    private Long userId;
    @ApiModelProperty(value = "用户端公网ip ")
    private String ipAddress;
    @ApiModelProperty(value = "微信用户openId（微信支付必传）")
    private String openId;

    @ApiModelProperty(value = "订单状态",hidden = true)
    private OrderStatusEnum orderStatus;

    @ApiModelProperty(value = "订单金额",hidden = true)
    private BigDecimal orderPrice;

    @ApiModelProperty(value = "商品标题",hidden = true)
    private String goodTitle;

    @ApiModelProperty(value = "商品描述",hidden = true)
    private String goodDesc;

    @ApiModelProperty("拉起支付信息")
    private String payInfo;

    public void orderStatus(Integer orderStatus) {
        if (orderStatus == 0) {
            this.orderStatus = OrderStatusEnum.PAYING;
        } else if (orderStatus == 1) {
            this.orderStatus = OrderStatusEnum.PAID;
        }else if (orderStatus == 2) {
            this.orderStatus = OrderStatusEnum.CLOSE;
        }else if (orderStatus == 3) {
            this.orderStatus = OrderStatusEnum.CLOSE;
        }else if (orderStatus == 4) {
            this.orderStatus = OrderStatusEnum.CLOSE;
        }else if (orderStatus == 5) {
            this.orderStatus = OrderStatusEnum.CLOSE;
        }else if (orderStatus == 6) {
            this.orderStatus = OrderStatusEnum.WAIT_PAY;
        } else {
            this.orderStatus = OrderStatusEnum.CLOSE;
        }
    }

    public OrderStatusEnum getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(OrderStatusEnum orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }

    public String getGoodTitle() {
        return goodTitle;
    }

    public void setGoodTitle(String goodTitle) {
        this.goodTitle = goodTitle;
    }

    public String getGoodDesc() {
        return goodDesc;
    }

    public void setGoodDesc(String goodDesc) {
        this.goodDesc = goodDesc;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public PayChannelEnum getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(PayChannelEnum payChannel) {
        this.payChannel = payChannel;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getPayInfo() {
        return payInfo;
    }

    public void setPayInfo(String payInfo) {
        this.payInfo = payInfo;
    }
}
