package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import shop.alien.util.typehandler.BlobByteArrayTypeHandler;

import java.util.Date;

/**
 * 支付配置表（支付宝等）
 *
 * @author system
 */
@Data
@JsonInclude
@TableName("store_payment_config")
@ApiModel(value = "StorePaymentConfig对象", description = "支付配置表")
public class StorePaymentConfig {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "店铺ID")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "店铺用户id")
    @TableField("store_user_id")
    private Integer storeUserId;

    @ApiModelProperty(value = "应用ID")
    @TableField("app_id")
    private String appId;

    @ApiModelProperty(value = "应用私钥")
    @TableField("app_secret_cert")
    private String appSecretCert;

    @ApiModelProperty(value = "应用公钥证书文件（存储文件内容）（支付宝）BLOB，原样存取不经过字符编码")
    @TableField(value = "app_public_cert", typeHandler = BlobByteArrayTypeHandler.class)
    private byte[] appPublicCert;

    @ApiModelProperty(value = "应用公钥证书路径")
    @TableField("app_public_cert_path")
    private String appPublicCertPath;

    @ApiModelProperty(value = "应用公钥证书文件名称")
    @TableField("app_public_cert_name")
    private String appPublicCertName;

    @ApiModelProperty(value = "支付宝公钥证书文件（存储文件内容）（支付宝）BLOB，原样存取不经过字符编码")
    @TableField(value = "alipay_public_cert", typeHandler = BlobByteArrayTypeHandler.class)
    private byte[] alipayPublicCert;

    @ApiModelProperty(value = "支付宝公钥证书路径")
    @TableField("alipay_public_cert_path")
    private String alipayPublicCertPath;

    @ApiModelProperty(value = "支付宝公钥证书文件名称")
    @TableField("alipay_public_cert_name")
    private String alipayPublicCertName;

    @ApiModelProperty(value = "支付宝根证书文件（存储文件内容）（支付宝）BLOB，原样存取不经过字符编码")
    @TableField(value = "alipay_root_cert", typeHandler = BlobByteArrayTypeHandler.class)
    private byte[] alipayRootCert;

    @ApiModelProperty(value = "支付宝根证书路径")
    @TableField("alipay_root_cert_path")
    private String alipayRootCertPath;

    @ApiModelProperty(value = "支付宝根证书文件名称")
    @TableField("alipay_root_cert_name")
    private String alipayRootCertName;

    @ApiModelProperty(value = "微信appId")
    @TableField("wechat_app_id")
    private String wechatAppId;

    @ApiModelProperty(value = "微信支付mini appId")
    @TableField("wechat_mini_app_id")
    private String wechatMiniAppId;

    @ApiModelProperty(value = "微信mchId")
    @TableField("wechat_mch_id")
    private String wechatMchId;

    @ApiModelProperty(value = "微信商户API证书序列号")
    @TableField("merchant_serial_number")
    private String merchantSerialNumber;

    @ApiModelProperty(value = "微信商户的 APIv3 Key")
    @TableField("api_v3_key")
    private String apiV3Key;

    @ApiModelProperty(value = "微信支付公钥ID")
    @TableField("wechat_pay_public_key_id")
    private String wechatPayPublicKeyId;

    @ApiModelProperty(value = "微信私钥路径")
    @TableField("wechat_private_key_path")
    private String wechatPrivateKeyPath;

    @ApiModelProperty(value = "微信私钥文件名")
    @TableField("wechat_private_key_name")
    private String wechatPrivateKeyName;

    @ApiModelProperty(value = "微信私钥文件（存储文件内容）BLOB，原样存取不经过字符编码")
    @TableField(value = "wechat_private_key_file", typeHandler = BlobByteArrayTypeHandler.class)
    private byte[] wechatPrivateKeyFile;

    @ApiModelProperty(value = "微信公钥路径")
    @TableField("wechat_pay_public_key_file_path")
    private String wechatPayPublicKeyFilePath;

    @ApiModelProperty(value = "微信公钥文件名")
    @TableField("wechat_pay_public_key_file_name")
    private String wechatPayPublicKeyFileName;

    @ApiModelProperty(value = "微信公钥文件（存储文件内容）BLOB，原样存取不经过字符编码")
    @TableField(value = "wechat_pay_public_key_file", typeHandler = BlobByteArrayTypeHandler.class)
    private byte[] wechatPayPublicKeyFile;

    @ApiModelProperty(value = "收款银行卡号")
    @TableField("bank_card_no")
    private String bankCardNo;

    @ApiModelProperty(value = "开户银行名称")
    @TableField("bank_name")
    private String bankName;

    @ApiModelProperty(value = "商家微信 appid")
    @TableField("store_wechat_id")
    private String storeWechatId;

    @ApiModelProperty(value = "商家微信名称")
    @TableField("store_wechat_name")
    private String storeWechatName;

    @ApiModelProperty(value = "商家支付宝 appid")
    @TableField("store_ali_id")
    private String storeAliId;

    @ApiModelProperty(value = "商家支付宝名称")
    @TableField("store_ali_name")
    private String storeAliName;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;
}
