package com.softwarebr.nunu.entity.pay;

import com.alibaba.fastjson.annotation.JSONField;
import com.brframework.commoncms.annatotion.column.RichTextColumn;
import io.swagger.annotations.ApiModel;
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 xu
 * @date 2019/11/1 17:38
 */
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name="shop_pay_notify_log")
@ApiModel
@Builder
public class PayNotifyLog {

    @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 = "11441578154756")
    private String outTradeNo;

    @ApiModelProperty(value = "回调平台", required = true, example = "11441578154756")
    private String platform;

    @ApiModelProperty(value = "通知类型", required = true, example = "11441578154756")
    private String notifyType;

    @ApiModelProperty(value = "回调结果", required = true, example = "11441578154756")
    @Column(length = Integer.MAX_VALUE)
    @RichTextColumn
    private String notifyResult;

    @ApiModelProperty(value = "通知内容", required = true, example = "11441578154756")
    @Column(length = Integer.MAX_VALUE)
    private String content;
}
