package com.yiqi.order.domain.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yiqi.order.domain.vo.weapp.AppPayRespVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 充值订单对象 order_recharge
 *
 * @author ruoyi
 * @date 2023-09-27
 */
@ApiModel("充值支付后返回结果")
@Data
public class OrderPayResultVO {

    /**
     * 是否成功  0未支付 100 支付中等待结果   101 ：支付失败   200 成功
     */
    @ApiModelProperty("支付结果")
    private Integer payResult = 0;

    @ApiModelProperty("支付返回")
    private String payMsg = "支付成功";

    @ApiModelProperty("订单id")
    private Long orderId;

    @ApiModelProperty("订单编号")
    private String orderNo;

    @ApiModelProperty("是否全部支付完")
    private Boolean isAllPayEnd;


    @ApiModelProperty("app支付返回对象")
    private AppPayRespVO appPayRespVO;

    public static OrderPayResultVO payError(String msg) {
        OrderPayResultVO orderPayResultVO = new OrderPayResultVO();
        orderPayResultVO.setPayMsg(msg);
        orderPayResultVO.setPayResult(101);
        return orderPayResultVO;
    }

    public static OrderPayResultVO payWait(String orderNo) {
        OrderPayResultVO orderPayResultVO = new OrderPayResultVO();
        orderPayResultVO.setOrderNo(orderNo);
        orderPayResultVO.setPayMsg("支付中，请稍后");
        orderPayResultVO.setPayResult(100);
        return orderPayResultVO;
    }

    public static OrderPayResultVO paySuccess(String orderNo) {
        OrderPayResultVO orderPayResultVO = new OrderPayResultVO();
        orderPayResultVO.setOrderNo(orderNo);
        orderPayResultVO.setPayMsg("支付成功");
        orderPayResultVO.setPayResult(200);
        return orderPayResultVO;
    }
}
