package com.softwarebr.nunu.entity.pay;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @Author ljr
 * @Date 2020/01/08 15:41:59
 */

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name="pay_pay_info")
@Builder
public class PayInfo {

	/**
	 * 支付押金
	 */
	public static final int CONSTANT_PAY_INFO_TYPE_DEPOSIT = 1;
	/**
	 * 支付订单
	 */
	public static final int CONSTANT_PAY_INFO_TYPE_BUY_ORDER = 2;
	/**
	 * 待前端支付状态
	 */
	public static final int CONSTANT_PAY_INFO_STATUS_WAIT = 1;
	/**
	 * 已回调状态
	 */
	public static final int CONSTANT_PAY_INFO_STATUS_CALLBACK = 2;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty(value = "id", required = true, example = "1")
	private Long id;
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间", required = true, example = "2018-03-12 21:32:33")
	private LocalDateTime createDate;
	@ApiModelProperty(value = "支付订单号", required = true, example = "")
	private String payOrderNo;
	@ApiModelProperty(value = "付款用户", required = true, example = "")
	private Long memberId;
	@ApiModelProperty(value = "总金额", required = true, example = "")
	private Long totalAmount;
	@ApiModelProperty(value = "支付方式", required = true, example = "")
	private Integer payMethod;
	@ApiModelProperty(value = "支付信息", required = true, example = "")
	private String message;
	@ApiModelProperty(value = "状态(1待前端支付 2已回调)", required = true, example = "")
	private Integer status;
	@ApiModelProperty(value = "支付类型(1押金auctionLogId 2商品订单buyOrderId)", required = true, example = "")
	private Integer type;
	@ApiModelProperty(value = "目标对象", required = true, example = "")
	private Long targetId;

}